Discuss here different C compiler set ups, and compiling executables for the ESP8266

User avatar
By sky_nine
#2059 I am a Chinese wokring on ESP 8266 development and module vendor.
Also interested in setup ESP development on linux.

Follow the step, I have compile OK llinux, using esptool to gernerate the flash bin and rom.bin.
but this is different with what ESP SDK using genflashbinv6.exe generate flash.bin and using objcopy to generate rom.bin,

generate flash.bin

genflashbinv6.exe eagle.app.v6.text.bin 40100004 eagle.app.v6.data.bin 3ffe8000 eagle.app.v6.rodata.bin 3ffe8e60

generate rom.bin
xt-objcopy -S -g -O binary eagle.app.v6.irom0text.out eagle.app.v6.irom0text.bin

xcopy /y eagle.app.v6.irom0text.bin ..\..\..\..\..\bin\

And I also find the usage is different, May anyone know the difference of esptool and genflashbinv6.exe ?
User avatar
By mamalala
#2181
sky_nine wrote:I am a Chinese wokring on ESP 8266 development and module vendor.
Also interested in setup ESP development on linux.

Follow the step, I have compile OK llinux, using esptool to gernerate the flash bin and rom.bin.
but this is different with what ESP SDK using genflashbinv6.exe generate flash.bin and using objcopy to generate rom.bin,

generate flash.bin

genflashbinv6.exe eagle.app.v6.text.bin 40100004 eagle.app.v6.data.bin 3ffe8000 eagle.app.v6.rodata.bin 3ffe8e60

generate rom.bin
xt-objcopy -S -g -O binary eagle.app.v6.irom0text.out eagle.app.v6.irom0text.bin

xcopy /y eagle.app.v6.irom0text.bin ..\..\..\..\..\bin\

And I also find the usage is different, May anyone know the difference of esptool and genflashbinv6.exe ?



The original method that Espressif uses is quite a mess. First it extracts the required segments from the ELF output file, then calls genflashbin, givin the addresses needed, to reassemble them into a flash firmware file. My esptool works directly on the ELF output file and extractx all the needed segments and addresses from there. That means it is a single tool that can assemble the flash file, extract any segment needed, and also upload the result to the ESP chip (and when using RTS and DTR to handle the GPIO0 and reset line, it can upload multiple files in one go). It allows people to use a single command to get from the ELF output file to a flashed/programmed chip.

Greetings,

Chris
User avatar
By OpenThings
#5917 On Linux, can replace genflashbinv6.exe with esptool as following to generate ultimate flash.bin:
esptool -eo eagle.app.v6.out -bo 0x00000 -bs .text -bs .data -bs .rodata -bc -ec
esptool -eo eagle.app.v6.out -es .irom0.text 0x40000 -ec

This method can run on linux and mac, and fast.