From d2b9ad570fd51acce86741b73af33291ad39e644 Mon Sep 17 00:00:00 2001 From: Deomid Ryabkov Date: Wed, 25 Nov 2015 11:57:00 +0000 Subject: [PATCH] Add a custom linker script for 4m flash PUBLISHED_FROM=a92b86588923fb54075b1c3ed8ca8112164c36c5 --- examples/ESP8266_RTOS/README.md | 12 ++++++++++- .../ld/eagle.app.v6.512.compact.ld | 20 +++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 examples/ESP8266_RTOS/ld/eagle.app.v6.512.compact.ld diff --git a/examples/ESP8266_RTOS/README.md b/examples/ESP8266_RTOS/README.md index f2a3c559..1ec54992 100644 --- a/examples/ESP8266_RTOS/README.md +++ b/examples/ESP8266_RTOS/README.md @@ -23,4 +23,14 @@ $ esptool.py --port /dev/ttyUSB0 --baud 230400 \ 0x01000 ${BIN_PATH}/upgrade/user1.4096.new.6.bin ``` -Note: the output can be made to fit in 512KB (4Mb) by moving `irom0_0_seg` in [eagle.app.v6.ld](https://github.com/espressif/ESP8266_RTOS_SDK/blob/master/ld/eagle.app.v6.ld) and increasing its size. + +The output can be made to fit in 512KB (4Mb), but stock linker scripts do not reserve enough space for code. +Custom linker script is provided for that, so you can use it for smaller devices like so (example that will work with ESP-01): + +``` + $ make clean; make BOOT=none APP=0 SPI_SPEED=40 SPI_MODE=qio SPI_SIZE_MAP=0 LD_FILE=ld/eagle.app.v6.512.compact.ld + $ esptool.py --port /dev/ttyUSB0 --baud 230400 \ + write_flash --flash_mode=qio --flash_size=4m \ + 0x00000 ${BIN_PATH}/eagle.flash.bin \ + 0x10000 ${BIN_PATH}/eagle.irom0text.bin +``` diff --git a/examples/ESP8266_RTOS/ld/eagle.app.v6.512.compact.ld b/examples/ESP8266_RTOS/ld/eagle.app.v6.512.compact.ld new file mode 100644 index 00000000..876bbd40 --- /dev/null +++ b/examples/ESP8266_RTOS/ld/eagle.app.v6.512.compact.ld @@ -0,0 +1,20 @@ +/* eagle.flash.bin @ 0x00000 */ +/* eagle.irom0text.bin @ 0x10000 */ + +/* + * Flash map for 512KB flash. + * + * There is 0x2000 (16KB) available between 0x8000 and 0x10000. + * + * Note: IROM images starts at 0x10000 (ignore Makefile output which says 0x40000. + */ + +MEMORY +{ + dport0_0_seg : org = 0x3FF00000, len = 0x10 + dram0_0_seg : org = 0x3FFE8000, len = 0x18000 + iram1_0_seg : org = 0x40100000, len = 0x8000 + irom0_0_seg : org = 0x40210000, len = 0x6C000 +} + +INCLUDE "../ld/eagle.app.v6.common.ld"