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

User avatar
By rudi
#4325
Bananis wrote:..........so you need to trick it to build user2.bin with the right linker script by getting it to link again. I did it by removing some temp output file such as libuser.a after building user1.bin.
/Bananis


wounder me last time :)
right - this do the job!
txs
User avatar
By chandan2002x
#4395 @ Bananis
I am failed to generate different user1.bin and user2.bin.
Both are same (checked with hex editor)
I could not use your makefile as I was using different setup (as per http://blog.electrodragon.com/esp8266-s ... ows-setup/)
But, followed the instruction (removing libuser.a). No help.

Can you please share copy of two different bin files that you have generated, so that I can check.
User avatar
By Bananis
#4456 Have you tried make clean between the builds:

make clean
./gen_misc_plus.sh 1
make clean
./gen_misc_plus.sh 2

I'm travelling at the moment, so i have no access to my files, but i'll post my examples when i'm back this weekend.

/bananis
User avatar
By chandan2002x
#4484 Dear Bananis,
I shall be waiting for the files.

Some progress and the result:
I am able to use your Makefile. It is generating several .bin files (0x00000.bin, 0x01000.bin etc) inside /firmware directory.
Now, when I am running the script file (original gen_misc_plus.sh by espressif), it is looking for eagle.app.v6.out to generate bin files as per below code
Code: Select all#!/bin/bash -x
cd /SDK/app
#rm ./user/.output/eagle/debug/lib/libuser.a

touch user_main.c

make APP=$1

if [ $? == 0 ];then
rm ../bin/upgrade/user$1.bin ../bin/upgrade/user$1.dump ../bin/upgrade/user$1.S

cd E:/cygwin/SDK/app/.output/eagle/debug/image/

/SDK/xtensa/bin/xtensa-lx106-elf-objdump -x -s eagle.app.v6.out > ../../../../../bin/upgrade/user$1.dump
/SDK/xtensa/bin/xtensa-lx106-elf-objdump -S eagle.app.v6.out > ../../../../../bin/upgrade/user$1.S
#/SDK/xtensa/bin/xtensa-lx106-elf-objdump -x -s eagle.app.v6.out > user$1.dump
#/SDK/xtensa/bin/xtensa-lx106-elf-objdump -S eagle.app.v6.out > user$1.S

/SDK/xtensa/bin/xtensa-lx106-elf-objcopy --only-section .text -O binary eagle.app.v6.out eagle.app.v6.text.bin
/SDK/xtensa/bin/xtensa-lx106-elf-objcopy --only-section .data -O binary eagle.app.v6.out eagle.app.v6.data.bin
/SDK/xtensa/bin/xtensa-lx106-elf-objcopy --only-section .rodata -O binary eagle.app.v6.out eagle.app.v6.rodata.bin
/SDK/xtensa/bin/xtensa-lx106-elf-objcopy --only-section .irom0.text -O binary eagle.app.v6.out eagle.app.v6.irom0text.bin



Am I missing anything or should I change the script (gen_misc_plus.sh) ? I think, I am doing mess with my directory structure. Please provide a link to understand the directory structure of SDK and app.
Thanks.