Compare commits
4 Commits
ecd8d2537d
...
v0.1-hardw
Author | SHA1 | Date | |
---|---|---|---|
a7c91cee0e | |||
acbde24c2f | |||
47d8df052a | |||
3705cc09d1 |
@@ -13,7 +13,7 @@ LIBRARYPATH = -L. -Lmathlib
|
|||||||
LIBRARIES = -larm_cortexM4lf_math -lm
|
LIBRARIES = -larm_cortexM4lf_math -lm
|
||||||
|
|
||||||
DEFINES = -DSTM32F407xx -DSTM32F4XX -DARM_MATH_CM4 -DHSE_VALUE=8000000UL
|
DEFINES = -DSTM32F407xx -DSTM32F4XX -DARM_MATH_CM4 -DHSE_VALUE=8000000UL
|
||||||
mapfile = memory-mapping
|
MAPFILE_BASE = memory-mapping
|
||||||
|
|
||||||
export GIT_VER = $(shell git describe --always --dirty --tags)
|
export GIT_VER = $(shell git describe --always --dirty --tags)
|
||||||
DEFINES += -DGIT_VER=$(GIT_VER)
|
DEFINES += -DGIT_VER=$(GIT_VER)
|
||||||
@@ -61,34 +61,39 @@ OBJCOPY=$(CROSS_COMPILE)objcopy
|
|||||||
OBJDUMP=$(CROSS_COMPILE)objdump
|
OBJDUMP=$(CROSS_COMPILE)objdump
|
||||||
SIZE=$(CROSS_COMPILE)size
|
SIZE=$(CROSS_COMPILE)size
|
||||||
|
|
||||||
LFLAGS = -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork
|
|
||||||
LFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16 --disable-newlib-supplied-syscalls -nostartfiles
|
|
||||||
LFLAGS += -Tstm32f407vet6_flash.ld -Wl,-Map=$(mapfile).map
|
|
||||||
|
|
||||||
CFLAGS = -c -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork
|
|
||||||
CFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16 -nostartfiles
|
|
||||||
CFLAGS += -Wall -Wextra -Wold-style-declaration -Wuninitialized -Wmaybe-uninitialized -Wunused-parameter -Wimplicit-fallthrough=3 -Wsign-compare
|
|
||||||
|
|
||||||
CFLAGS_RELEASE = -O3 -g
|
CFLAGS_RELEASE = -O3 -g
|
||||||
CFLAGS_DEBUG = -O0 -g
|
CFLAGS_DEBUG = -O0 -g
|
||||||
|
|
||||||
LFLAGS_RELEASE = -Wl,--gc-sections
|
LFLAGS_RELEASE = -Wl,--gc-sections
|
||||||
LFLAGS_DEBUG =
|
LFLAGS_DEBUG =
|
||||||
|
|
||||||
|
CFLAGS =
|
||||||
|
LFLAGS =
|
||||||
|
|
||||||
ifneq ($(DEBUGBUILD),true)
|
ifneq ($(DEBUGBUILD),true)
|
||||||
DEFINES += $(RELEASE_DEFINES)
|
DEFINES += $(RELEASE_DEFINES)
|
||||||
CFLAGS += $(CFLAGS_RELEASE)
|
CFLAGS += $(CFLAGS_RELEASE)
|
||||||
LFLAGS += $(LFLAGS_RELEASE)
|
LFLAGS += $(LFLAGS_RELEASE)
|
||||||
target = $(TARGET_BASE)-release
|
target = $(TARGET_BASE)-release
|
||||||
OBJDIR = $(OBJDIR_BASE)/release
|
OBJDIR = $(OBJDIR_BASE)/release
|
||||||
|
MAPFILE = $(MAPFILE_BASE)-release
|
||||||
else
|
else
|
||||||
DEFINES += $(DEBUG_DEFINES)
|
DEFINES += $(DEBUG_DEFINES)
|
||||||
target = $(TARGET_BASE)-debug
|
target = $(TARGET_BASE)-debug
|
||||||
CFLAGS += $(CFLAGS_DEBUG)
|
CFLAGS += $(CFLAGS_DEBUG)
|
||||||
LFLAGS += $(LFLAGS_DEBUG)
|
LFLAGS += $(LFLAGS_DEBUG)
|
||||||
OBJDIR = $(OBJDIR_BASE)/debug
|
OBJDIR = $(OBJDIR_BASE)/debug
|
||||||
|
MAPFILE = $(MAPFILE_BASE)-debug
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
LFLAGS += -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork
|
||||||
|
LFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16 --disable-newlib-supplied-syscalls -nostartfiles
|
||||||
|
LFLAGS += -Tstm32f407vet6_flash.ld -Wl,-Map=$(MAPFILE).map
|
||||||
|
|
||||||
|
CFLAGS += -c -mlittle-endian -mthumb -mcpu=cortex-m4 -mthumb-interwork
|
||||||
|
CFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16 -nostartfiles
|
||||||
|
CFLAGS += -Wall -Wextra -Wold-style-declaration -Wuninitialized -Wmaybe-uninitialized -Wunused-parameter -Wimplicit-fallthrough=3 -Wsign-compare
|
||||||
|
|
||||||
####################################################################################
|
####################################################################################
|
||||||
|
|
||||||
OBJ = $(CFILES:%.c=$(OBJDIR)/%.c.o)
|
OBJ = $(CFILES:%.c=$(OBJDIR)/%.c.o)
|
||||||
@@ -129,7 +134,10 @@ $(ASOBJ):
|
|||||||
$(QUIET)$(CC) $(CFLAGS) -MMD -MT $@ $(INCLUDEPATH) $(DEFINES) -o $@ $(@:$(OBJDIR)/%.S.o=%.S)
|
$(QUIET)$(CC) $(CFLAGS) -MMD -MT $@ $(INCLUDEPATH) $(DEFINES) -o $@ $(@:$(OBJDIR)/%.S.o=%.S)
|
||||||
|
|
||||||
|
|
||||||
.PHONY: qtproject-legacy qtproject qtproject-debug clean mrproper objcopy disassemble program
|
.PHONY: qtproject-legacy qtproject qtproject-debug clean mrproper objcopy disassemble program program-debug
|
||||||
|
|
||||||
|
program-debug:
|
||||||
|
$(QUIET)$(MAKE) DEBUGBUILD=true program
|
||||||
|
|
||||||
program: $(target).elf
|
program: $(target).elf
|
||||||
./program-device.sh $<
|
./program-device.sh $<
|
||||||
|
@@ -238,6 +238,8 @@ static int sdio_check_status_register_cmd13(uint16_t rca, uint32_t *status)
|
|||||||
uint32_t response;
|
uint32_t response;
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
|
*status = 0UL;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
sdio_send_cmd(13, (rca<<16)&0xFFFF0000, SHORT_ANS);
|
sdio_send_cmd(13, (rca<<16)&0xFFFF0000, SHORT_ANS);
|
||||||
if (!(res = sdio_get_response(13, SHORT_ANS, &response))) {
|
if (!(res = sdio_get_response(13, SHORT_ANS, &response))) {
|
||||||
@@ -465,10 +467,14 @@ static int sdio_send_select_card_cmd7(uint16_t rca) {
|
|||||||
} while(--timeout > 0);
|
} while(--timeout > 0);
|
||||||
|
|
||||||
/* Check, if card in in TRANS state */
|
/* Check, if card in in TRANS state */
|
||||||
if (sdio_check_status_register_cmd13(rca, &(status.value)))
|
if (sdio_check_status_register_cmd13(rca, &status.value)) {
|
||||||
res = -1;
|
res = -1;
|
||||||
|
goto ret_val;
|
||||||
|
}
|
||||||
if (status.statusstruct.CURRENT_STATE != CURRENT_STATE_TRAN)
|
if (status.statusstruct.CURRENT_STATE != CURRENT_STATE_TRAN)
|
||||||
res = -2;
|
res = -2;
|
||||||
|
|
||||||
|
ret_val:
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -705,9 +711,10 @@ DRESULT sdio_disk_write(const BYTE *buff, DWORD sector, UINT count)
|
|||||||
|
|
||||||
while (count) {
|
while (count) {
|
||||||
do {
|
do {
|
||||||
sdio_check_status_register_cmd13(card_info.rca, &status.value);
|
ret = sdio_check_status_register_cmd13(card_info.rca, &status.value);
|
||||||
} while (status.statusstruct.CURRENT_STATE == CURRENT_STATE_PRG ||
|
} while (status.statusstruct.CURRENT_STATE == CURRENT_STATE_PRG ||
|
||||||
status.statusstruct.CURRENT_STATE == CURRENT_STATE_RCV);
|
status.statusstruct.CURRENT_STATE == CURRENT_STATE_RCV ||
|
||||||
|
!ret);
|
||||||
|
|
||||||
if (status.statusstruct.CURRENT_STATE == CURRENT_STATE_STBY) {
|
if (status.statusstruct.CURRENT_STATE == CURRENT_STATE_STBY) {
|
||||||
if (sdio_send_select_card_cmd7(card_info.rca))
|
if (sdio_send_select_card_cmd7(card_info.rca))
|
||||||
|
@@ -155,7 +155,11 @@ static void reflow_menu_about(struct lcd_menu *menu, enum menu_entry_func_entry
|
|||||||
if (strlen(xstr(GIT_VER)) > LCD_CHAR_WIDTH) {
|
if (strlen(xstr(GIT_VER)) > LCD_CHAR_WIDTH) {
|
||||||
menu_lcd_outputf(menu, 2, "%s", &xstr(GIT_VER)[LCD_CHAR_WIDTH]);
|
menu_lcd_outputf(menu, 2, "%s", &xstr(GIT_VER)[LCD_CHAR_WIDTH]);
|
||||||
}
|
}
|
||||||
|
#ifdef DEBUGBUILD
|
||||||
|
menu_lcd_output(menu, 3, "Page 2/5 [DEBUG]");
|
||||||
|
#else
|
||||||
menu_lcd_output(menu, 3, "Page 2/5");
|
menu_lcd_output(menu, 3, "Page 2/5");
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
menu_lcd_output(menu, 0, "Compile Info");
|
menu_lcd_output(menu, 0, "Compile Info");
|
||||||
|
Reference in New Issue
Block a user