Skip to content

Commit 77d2bbd

Browse files
committed
use linker file from esp_system
1 parent 2ef3c5f commit 77d2bbd

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
IDF_PATH ?= /root/.espressif/components
22
ESP_COMPONENTS = soc hal log esp_common esp_hw_support riscv \
3-
esp_rom newlib esp_system
3+
esp_rom newlib esp_system heap
44

55
all: build
66

7-
build:
7+
build: build-lib
88
make -C main build ARCH=esp32c3
99

1010
build-lib:
1111
@$(foreach item, $(ESP_COMPONENTS), make -C esp32c3/components/$(item) build-lib ARCH=esp32c3 LIBDIR=$(item) IDF_PATH=$(IDF_PATH);)
12+
13+
clean:
14+
make -C main clean ARCH=esp32c3
15+
@$(foreach item, $(ESP_COMPONENTS), rm -f esp32c3/components/$(item)/*.o esp32c3/components/$(item)/*.
16+

esp32c3/build.mk

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ ESPUTIL ?= $(MDK)/esputil/esputil
55
LIB_CFLAGS ?= -W \
66
-I$(MDK) \
77
-I/root/.espressif/components/esp_common/include \
8+
-I/root/.espressif/components/esp_system/include \
89
-I/root/.espressif/components/esp_rom/$(ARCH) \
910
-I/root/.espressif/components/esp_rom/include \
1011
-I/root/.espressif/components/esp_rom/include/$(ARCH) \
@@ -89,7 +90,9 @@ CFLAGS ?= -W \
8990
-I$(MDK)/components/firefly-display/include \
9091
-I$(MDK)/components/firefly-scene/include \
9192
$(EXTRA_CFLAGS)
92-
LINKFLAGS ?= -T$(MDK)/$(ARCH)/memory.ld -T$(MDK)/$(ARCH)/sections.ld -T$(MDK)/$(ARCH)/link.ld -nostdlib -nostartfiles -Wl,--gc-sections $(EXTRA_LINKFLAGS)
93+
LINKFLAGS ?= -T$(MDK)/$(ARCH)/components/esp_system/ld/memory.ld \
94+
-T$(MDK)/$(ARCH)/components/esp_system/ld/sections.ld \
95+
-T$(MDK)/$(ARCH)/link.ld -nostdlib -nostartfiles -Wl,--gc-sections $(EXTRA_LINKFLAGS)
9396
CWD ?= $(realpath $(CURDIR))
9497
FLASH_ADDR ?= 0 # 2nd stage bootloader flash offset
9598
FFY_SCENE ?= $(MDK)/components/firefly-scene
@@ -112,7 +115,7 @@ CRYPTO_SRCS ?= $(MDK)/components/crypto/bip32.c \
112115
PIXIE_SRCS ?= $(CRYPTO_SRCS) $(DISPLAY_SRCS) $(SCENE_SRCS)
113116
SRCS ?= $(MDK)/$(ARCH)/boot.c $(PIXIE_SRCS) $(SOURCES)
114117

115-
build: $(PROG).bin
118+
build: $(PROG).elf
116119

117120
$(PROG).elf: $(SRCS)
118121
gcc $(CFLAGS) $(SRCS) $(LINKFLAGS) -o $@

0 commit comments

Comments
 (0)