This commit is contained in:
Edward Emelianov
2023-01-11 21:19:18 +03:00
parent a5e420ac51
commit e98aa11f72
29 changed files with 54 additions and 46 deletions

View File

@@ -61,13 +61,12 @@ CFLAGS += -O2 -g -MD -D__thumb2__=1
CFLAGS += -Wall -Werror -Wextra -Wshadow -Wimplicit-function-declaration
CFLAGS += -Wredundant-decls $(INCLUDE)
# -Wmissing-prototypes -Wstrict-prototypes
CFLAGS += -fno-common -ffunction-sections -fdata-sections
CFLAGS += -fno-common -ffunction-sections -fdata-sections -flto
###############################################################################
# Linker flags
LDFLAGS += --static -nostartfiles -nostdlib
LDFLAGS += -Wl,--gc-sections -Wl,--print-memory-usage
#--specs=nano.specs
LDFLAGS += -Wl,--gc-sections -Wl,--print-memory-usage --specs=nano.specs -flto
LDFLAGS += -L$(LIB_DIR)
LDFLAGS += -T$(LDSCRIPT)
LDFLAGS += -Wl,-Map=$(OBJDIR)/$(BINARY).map

View File

@@ -1,2 +1,2 @@
#define BUILD_NUMBER "168"
#define BUILD_DATE "2022-06-17"
#define BUILD_NUMBER "169"
#define BUILD_DATE "2023-01-11"

View File

@@ -795,7 +795,7 @@ typedef struct {
extern unsigned _stack;
vector_table_t vector_table __attribute__ ((section(".vector_table"))) = {
vector_table_t vector_table __attribute__ ((used, section(".vector_table"))) = {
.initial_sp_value = &_stack,
.reset = reset_handler,
.nmi = nmi_handler,
@@ -828,7 +828,7 @@ void WEAK __attribute__ ((naked)) __attribute__ ((noreturn)) reset_handler(void)
char *src = &_ldata;
// enable 8-byte stack alignment to comply with AAPCS
SCB->CCR |= 0x00000200;
// SCB->CCR |= 0x00000200;
// copy initialized variables data
while ( dst < &_edata ) { *dst++ = *src++; }