Commit d2b9ad57 authored by Deomid Ryabkov's avatar Deomid Ryabkov Committed by rojer

Add a custom linker script for 4m flash

    PUBLISHED_FROM=a92b86588923fb54075b1c3ed8ca8112164c36c5
parent 5b36f329
...@@ -23,4 +23,14 @@ $ esptool.py --port /dev/ttyUSB0 --baud 230400 \ ...@@ -23,4 +23,14 @@ $ esptool.py --port /dev/ttyUSB0 --baud 230400 \
0x01000 ${BIN_PATH}/upgrade/user1.4096.new.6.bin 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
```
/* 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"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment