nqd / esp8266-dev

ESP8266 Wifi SoC dev, with OTA made easy
44 stars 12 forks source link

does not compile with flash size 512,1024 or 2048 #9

Closed paritosharya408 closed 9 years ago

paritosharya408 commented 9 years ago

I was trying to compile the ota-update example per your instructions on ubuntu 14 running in virtualbox environment, but when I try to compile with with any of 512/1024/2048 flash sizes i keep on getting errors. It only works with 4096.

The changes i made were to the makefile.common present under root folder and set the FLASH_SIZE ?= 2048.

On compiling with make OTA=1, i get a lot of errors (attached are couple of screenshots of errors generated) error1 error2

Does your implementation not support 1024, and 2048 flash size options ( i know 512 is too out of date)?

Paritosh

nqd commented 9 years ago

To support other flash options, you will just need to change LD_SCRIPT, IMAGE_ADDRESS and other linkers. This will not affect your program is compile/not.

Seem you get error because missing including for gcc, leads to undefined.

atwoz commented 9 years ago

Hello Nguyen! Could you please provide a more detailed description on what to change to support 8Mbit Flash? I tried modifying the Makefile but I get exceptions once I download a user2 firmware section.

nqd commented 9 years ago

Hello atwoz, At first, try to change LD_SCRIPT, size, flash for equivalent flash size sothat user1/user2 is for 8Mbit.

Then bootloader need to recognize that what flash/user it is running. This is done via programming first user1 (assume you flash user1 first). This is to program for 32Mbit (1MB + 1MB) -$(ESPTOOL) --port $(ESPPORT) write_flash -fs 32m-c1 ...

Choose others ['4m', '2m', '8m', '16m', '32m', '16m-c1', '32m-c1', '32m-c2'] for your -fs.

Hope that help.

paritosharya408 commented 9 years ago

Hello Nguyen,

I did manage to compile the code for ota-update for 1024 and 2048 flash size (though 512 OTA version failed with error: .irom.text will not fit in region irom0_0_seg) after updating the linkers including LD_SCRIPT, IMAGE_ADDRESS and flash etc. But when i flashed the user1.bin (1024 size option) for the ota-update example on ESP, I keep on getting garbage (see attached image). errr

Following is the command i am using to flash it ../../tools/esptool/esptool.py --port /dev/ttyUSB0 -b 460800 write_flash -fs 8m 0x00000 ../../esp-sdk/bin/boot_v1.4(b1).bin 0x01000 firmwares/1024_user1.bin 0xFC000 ../../esp-sdk/bin/esp_init_data_default.bin 0xFE000 ../../esp-sdk/bin/blank.bin

I am missing something? Or is it an addressing issue?

paritosharya408 commented 9 years ago

Hello Nguyen,

I am having the same problem with my project as well. It keeps on spitting the garbage (as shown in the image above) as soon as I add the code for FOTA upgrade which results in code exceeding 256Kb to be accommodated in 512 flash size and has to be compiled as 1024 flash size. It works fine when FOTA upgrade code is not there (in which case it compiles with 512 flash size). Somehow 1024 flash size does not work as intended. Only 512 works but having to introduce FOTA code increases the size beyond 512 and hence the problems.

Any pointers will be much appreciated!

paritosharya408 commented 9 years ago

I managed to get it working. Thanks for the instructions. Really helpful.