1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/cpu/esp8266/Makefile.include
Gunar Schorcht f23b20f91f cpu/esp: use FLASHFILE_POS for image position in flash
Instead of using a fixed position of the image file in the flash, the variable `FLASHFILE_POS` is used which allows to override the default position of the image in the flash at 0x10000.
2022-12-31 14:10:57 +01:00

56 lines
1.7 KiB
Makefile

# With the '-Os' option, char arrays have not to be 32-bit word aligned. This
# leads to an alignment exception when the address of a char array is assigned
# to an 'uint32_t' pointer and the pointer is used for the access.
CFLAGS_OPT ?= -O2
# ESP8266 specific flashing options
# DO NOT CHANGE, ESP8266/ESP8285 modules only work with dout and 26m
FLASH_CHIP = esp8266
FLASH_OPTS = --version 3
FLASH_MODE = dout
FLASH_FREQ = 26m
FLASH_SIZE ?= 1
BOOTLOADER_POS = 0x0000
FLASHFILE_POS = 0x10000
include $(RIOTCPU)/esp_common/Makefile.include
# regular Makefile
TARGET_ARCH_ESP8266 ?= xtensa-esp8266-elf
TARGET_ARCH ?= $(TARGET_ARCH_ESP8266)
PSEUDOMODULES += esp_sw_timer
INCLUDES += -I$(RIOTCPU)/$(CPU)
INCLUDES += -I$(RIOTCPU)/$(CPU)/include
INCLUDES += -I$(RIOTCPU)/$(CPU)/vendor
INCLUDES += -I$(RIOTCPU)/$(CPU)/vendor/esp-idf/
INCLUDES += -I$(RIOTCPU)/$(CPU)/vendor/esp-idf/bootloader_support/include
INCLUDES += -I$(RIOTCPU)/$(CPU)/vendor/esp-idf/esp8266/include
INCLUDES += -I$(RIOTCPU)/$(CPU)/vendor/esp-idf/esp8266/include/esp8266
INCLUDES += -I$(RIOTCPU)/$(CPU)/vendor/esp-idf/heap/include
INCLUDES += -I$(RIOTCPU)/$(CPU)/vendor/esp-idf/log/include
CFLAGS += -D__ESP_FILE__=__FILE__
ifneq (,$(filter esp_gdbstub,$(USEMODULE)))
GDBSTUB_DIR ?= $(RIOTCPU)/$(CPU)/vendor/esp-gdbstub
CFLAGS += -DGDBSTUB_BREAK_ON_INIT=1
INCLUDES += -I$(GDBSTUB_DIR)
endif
ifneq (,$(filter esp_now,$(USEMODULE)))
ARCHIVES += -lespnow
endif
ARCHIVES += -lgcc -lhal -lwpa -lcore -lnet80211 -lphy -lpp -lstdc++
LINKFLAGS += -L$(RIOTCPU)/$(CPU)/ld
LINKFLAGS += -Tesp8266.rom.ld
LINKFLAGS += -Tesp8266.riot-os.ld
LINKFLAGS += -Tesp8266.peripherals.ld
LINKFLAGS += -Wl,-wrap=pp_attach
LINKFLAGS += -Wl,-wrap=pm_attach