F0 blink -flto

This commit is contained in:
Edward Emelianov 2023-01-12 12:03:48 +03:00
parent e98aa11f72
commit 491d930b0c
3 changed files with 4 additions and 5 deletions

View File

@ -44,7 +44,7 @@ DEPS := $(OBJS:.o=.d)
INC_DIR ?= ../inc
INCLUDE := -I$(INC_DIR)/F0 -I$(INC_DIR)/cm
INCLUDE := -I$(INC_DIR)/Fx -I$(INC_DIR)/cm
LIB_DIR := $(INC_DIR)/ld
###############################################################################
@ -53,12 +53,11 @@ 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
#--specs=nano.specs
LDFLAGS += --static -nostartfiles -flto --specs=nano.specs
LDFLAGS += -L$(LIB_DIR)
LDFLAGS += -T$(LDSCRIPT)
LDFLAGS += -Wl,-Map=$(OBJDIR)/$(BINARY).map

BIN
F0:F030,F042,F072/blink/blink.bin Normal file → Executable file

Binary file not shown.

View File

@ -19,7 +19,7 @@
* MA 02110-1301, USA.
*/
#include "stm32f0.h"
#include <stm32f0.h>
static volatile uint32_t blink_ctr = 0;