Skip to content

Commit eb32026

Browse files
committed
Ensure build dirs and trim extra RAM sections
Add an explicit rule to create `$(BUILD_DIRS)` before building, preventing missing-directory failures. Update binary generation to strip `.dtcmram*` and `.coherent*` sections in addition to existing RAM sections so the output image excludes non-flash runtime data.
1 parent 93a5552 commit eb32026

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

firmware-template-gd32/Rules.mk

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,13 @@ lisdep: $(LIBDEP)
110110
$(LIBDEP):
111111
$(MAKE) -f Makefile.GD32 $(MAKECMDGOALS) 'FAMILY=${FAMILY}' 'BOARD=${BOARD}' 'ENET_PHY=${ENET_PHY}' 'MAKE_FLAGS=$(DEFINES)' -C $@
112112

113+
#
114+
# Build bin
115+
#
116+
117+
$(BUILD_DIRS) :
118+
mkdir -p $(BUILD_DIRS)
119+
113120
#
114121
# Startup and support objects
115122
#
@@ -172,6 +179,8 @@ $(TARGET): $(BUILD)main.elf
172179
-O binary \
173180
$@ \
174181
--remove-section=.tcmsram* \
182+
--remove-section=.dtcmram* \
183+
--remove-section=.coherent* \
175184
--remove-section=.sram1* \
176185
--remove-section=.sram2* \
177186
--remove-section=.ramadd* \

0 commit comments

Comments
 (0)