OTA problem

almaz1c
Posts: 13
Joined: Mon Aug 28, 2017 4:03 am

OTA problem

Postby almaz1c » Thu Feb 01, 2018 7:05 am

Hello!
I try to use OTA firmware upgrading without luck.
Used flash's size is 2MB.

In code config of flash upload structure:

Code: Select all

#ifdef OTA_FLASH_SIZE_K
CgiUploadFlashDef uploadParams={
   .type=CGIFLASH_TYPE_FW,
   .fw1Pos=0x1000,
   .fw2Pos=0x81000,
   .fwSize=0x70000,
   .tagName=OTA_TAGNAME
};
#define INCLUDE_FLASH_FNS
#endif


Compiling result:

Code: Select all

AR build/httpd_app.a
LD build/httpd.user1.out
LD build/httpd.user2.out
APPGEN build/httpd.user1.bin
2068872265
2068872266
** user1.bin uses 339412 bytes of available
APPGEN build/httpd.user2.bin
1541136729
1541136730
** user1.bin uses 339412 bytes of available
Header: 40 bytes, user1: 339412 bytes, user2: 339412 bytes.

Seems that it is enough place in 2MB (512+512) to store that firmware.

Here how I prepare flash IC to use:

Code: Select all

esptool.py -p /dev/ttyUSB0 erase_flash
esptool.py -p /dev/ttyUSB0 --baud 460800 write_flash -fm qio -ff 40m 0x1FC000 ../bin/esp_init_data_default.bin 0x1FE000 ../bin/blank.bin

Then I flash compilied firmware:

Code: Select all

esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash --flash_freq 40m --flash_mode qio --flash_size 16m 0x00000 "/home/al/Dropbox/linux/esp_nonos_2_1_0/sdk/bin/boot_v1.7.bin" 0x1000 build/httpd.user1.bin


So there is boot logs during first booting:

Code: Select all

mode : sta(68:c6:3a:a5:01:e3) + softAP(6a:c6:3a:a5:01:e3)
add if0
add if1
dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
bcn 100
scandone
scandone
[b]MELODY storage initialized
MELODY events storage initialized
LIS3DH recognized
I2C initialized
[/b]
reconnect
scandone
state: 0 -> 2 (b0)
\C0state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 2
connected with 106, channel 9
dhcp client start...
ip:192.168.100.7,mask:255.255.255.0,gw:192.168.100.1
state: 5 -> 0 (0)
rm 0
bcn 0
del if1
del if0
usl
mode : null
force slp enable,type: 1
fpm open,type:1 0
fpm close 3
mode : sta(68:c6:3a:a5:01:e3) + softAP(6a:c6:3a:a5:01:e3)
add if0
add if1
dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
bcn 100
scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 2


Now request for upgrade is coming:

Code: Select all

Next firmware: user2.bin (got 0)
Firmware upload cgi start.
Flashing user2.bin from ota image
\E6 @87\FF?;\FF?Writing 64 bytes of data to SPI pos 0x81000...
Upload done. Sending response.
\D6"@\C0;\FF?D\B0\FE?@\B0\FE?\F3!@@(\FF?reboot to use2
state: 5 -> 0 (0)
rm 0
del if0
station: 74:04:2b:d6:b7:10 leave, AID = 1
rm 1
bcn 0
del if1
usl

 ets Jan  8 2013,rst cause:1, boot mode:(3,0)

load 0x40100000, len 2592, room 16
tail 0
chksum 0xf3
load 0x3ffe8000, len 764, room 8
tail 4
chksum 0x92
load 0x3ffe82fc, len 676, room 4
tail 0
chksum 0x22
csum 0x22

2nd boot version : 1.7(5d6f877)
SPI Speed : 40MHz
SPI Mode : QIO
SPI Flash Size & Map: 16Mbit(512KB+512KB)
jump to run user2 @ 81000

\8C\E3\EC\83N\EC\92r\83\F2n|\E4 d\8F\80\E4\8F{lb\DB\BE\84r\93l\9Cn\E0\83o\E3\00l \8C\E2{\92l\84l\FEmode : sta(68:c6:3a:a5:01:e3) + softAP(6a:c6:3a:a5:01:e3)
add if0
add if1
dhcp server start:(ip:192.168.4.1,mask:255.255.255.0,gw:192.168.4.1)
bcn 100
scandone
scandone

MELODY storage initialized
d
d
Almazzzzz

reconnect
scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 1
cnt


Seems that user2.bin binary is flashed at 0x81000 and ESP8266 is able to boot from that address but strange is that some logs are missed totally (Bolded messages of first booting logs) and after that I see ESP8266's access point, I can to connect to it using smartphone but my web interface is totally missed.
There is Flash writing operations are used in firmware as well as sleep modes.

What is a possible reason of that? Any suggestions and steps to fix that.

almaz1c
Posts: 13
Joined: Mon Aug 28, 2017 4:03 am

Re: OTA problem

Postby almaz1c » Thu Feb 01, 2018 7:11 am

E.g. firmware flashed OTA has reduced functionality. I don't see logs from parts of function that called during initialization and not at all any logs of http requests processing.

AgentSmithers
Posts: 123
Joined: Sat Apr 01, 2017 1:21 am
Contact:

Re: OTA problem

Postby AgentSmithers » Thu Feb 01, 2018 8:02 am

Almaz,
Are you using the NONOS SDK? Do you have a Skype, I'd be interested in diving in and see if I can help. I got OTA to work with my implementation and I used the same addresses. If I had to guess it would be your MAKEfile.
I'm sure together we can hammer it out. If not good luck. Ima stay tuned to see if anyone else has any ideas.

almaz1c
Posts: 13
Joined: Mon Aug 28, 2017 4:03 am

Re: OTA problem

Postby almaz1c » Fri Feb 02, 2018 4:25 am

AgentSmithers wrote:Almaz,
Are you using the NONOS SDK? Do you have a Skype, I'd be interested in diving in and see if I can help. I got OTA to work with my implementation and I used the same addresses. If I had to guess it would be your MAKEfile.
I'm sure together we can hammer it out. If not good luck. Ima stay tuned to see if anyone else has any ideas.

Hi!
Yes, I am using NONOS SDK.
I sent you my skype.
There is Makefiles:
https://cloud.mail.ru/public/CLTs/3BhSWxFvH
https://cloud.mail.ru/public/8HYu/w61tre1L2

When I flash user binary to 0x1000 it boots successfully. When I flash exactly same project to 0x81000 after preparing 0x1FE000 and 0x1FC000 I get following logs on 76880 baud rate:

Code: Select all

load 0x40100000, len 2592, room 16
tail 0
chksum 0xf3
load 0x3ffe8000, len 764, room 8
tail 4
chksum 0x92
load 0x3ffe82fc, len 676, room 4
tail 0
chksum 0x22
csum 0x22

2nd boot version : 1.7(5d6f877)
SPI Speed : 40MHz
SPI Mode : QIO
SPI Flash Size & Map: 16Mbit(512KB+512KB)
jump to run user2 @ 81000

Fatal exception (0):
epc1=0x40201ddc, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x0                                                                                    0000000
Fatal exception (0):
epc1=0x40201ddc, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x0                                                                                    0000000
Fatal exception (0):
epc1=0x40201ddc, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x0                                                                                    0000000
Fatal exception (0):
epc1=0x40201ddc, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x0                                                                                    0000000
Fatal exception (0):
epc1=0x40201ddc, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x0                                                                                    0000000
Fatal exception (0):
epc1=0x40201ddc, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x0                                                                                    0000000
Fatal exception (0):
epc1=0x40201ddc, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x0                                                                                    0000000
Fatal exception (0):
epc1=0x40201ddc, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x0                                                                                    0000000
Fatal exception (0):
epc1=0x40201ddc, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x0                                                                                    0000000

AgentSmithers
Posts: 123
Joined: Sat Apr 01, 2017 1:21 am
Contact:

Re: OTA problem

Postby AgentSmithers » Fri Feb 02, 2018 6:20 am

almaz1c wrote:
AgentSmithers wrote:Almaz,
Are you using the NONOS SDK? Do you have a Skype, I'd be interested in diving in and see if I can help. I got OTA to work with my implementation and I used the same addresses. If I had to guess it would be your MAKEfile.
I'm sure together we can hammer it out. If not good luck. Ima stay tuned to see if anyone else has any ideas.

Hi!
Yes, I am using NONOS SDK.
I sent you my skype.
There is Makefiles:
https://cloud.mail.ru/public/CLTs/3BhSWxFvH
https://cloud.mail.ru/public/8HYu/w61tre1L2

When I flash user binary to 0x1000 it boots successfully. When I flash exactly same project to 0x81000 after preparing 0x1FE000 and 0x1FC000 I get following logs on 76880 baud rate:

Code: Select all

load 0x40100000, len 2592, room 16
tail 0
chksum 0xf3
load 0x3ffe8000, len 764, room 8
tail 4
chksum 0x92
load 0x3ffe82fc, len 676, room 4
tail 0
chksum 0x22
csum 0x22

2nd boot version : 1.7(5d6f877)
SPI Speed : 40MHz
SPI Mode : QIO
SPI Flash Size & Map: 16Mbit(512KB+512KB)
jump to run user2 @ 81000

Fatal exception (0):
epc1=0x40201ddc, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x0                                                                                    0000000
Fatal exception (0):
epc1=0x40201ddc, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x0                                                                                    0000000
Fatal exception (0):
epc1=0x40201ddc, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x0                                                                                    0000000
Fatal exception (0):
epc1=0x40201ddc, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x0                                                                                    0000000
Fatal exception (0):
epc1=0x40201ddc, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x0                                                                                    0000000
Fatal exception (0):
epc1=0x40201ddc, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x0                                                                                    0000000
Fatal exception (0):
epc1=0x40201ddc, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x0                                                                                    0000000
Fatal exception (0):
epc1=0x40201ddc, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x0                                                                                    0000000
Fatal exception (0):
epc1=0x40201ddc, epc2=0x00000000, epc3=0x00000000, excvaddr=0x00000000, depc=0x0                                                                                    0000000


I got it, Ill try to hit you up when Im out of the office here in a bit if not tomorrow. Maybe we can tackle this today. I am also on NONOS.

AgentSmithers
Posts: 123
Joined: Sat Apr 01, 2017 1:21 am
Contact:

Re: OTA problem

Postby AgentSmithers » Sat Feb 03, 2018 3:35 am

Everyone,
So almaz1c and I had a moment to connect over skype. We, however, were not able to rule out his eagle.ld file being the correct file to use for his ESP8266 SPI. Anyone know what the best documentation is to get a technical understanding of the Eagle.LD files to ensure we can say we are using the correct LD?
Thanks!
-Agent

almaz1c
Posts: 13
Joined: Mon Aug 28, 2017 4:03 am

Re: OTA problem

Postby almaz1c » Sat Feb 03, 2018 5:03 pm

Seems that problem is localized.
Flashing following way is work on 1MB flash IC(ESP_SPI_FLASH_SIZE_K=1024):

Code: Select all

esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash --flash_freq 40m --flash_mode qio --flash_size 8m 0x00000 "/home/al/Dropbox/linux/esp_nonos_2_1_0/sdk/bin/boot_v1.7.bin" 0x1000 build/httpd.user1.bin 0xFC000 ../bin/esp_init_data_default.bin 0xFE000 ../bin/blank.bin

Code: Select all

esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash --flash_freq 40m --flash_mode qio --flash_size 8m 0x00000 "/home/al/Dropbox/linux/esp_nonos_2_1_0/sdk/bin/boot_v1.7.bin" 0x81000 build/httpd.user2.bin 0xFC000 ../bin/esp_init_data_default.bin 0xFE000 ../bin/blank.bin


After moving for 2MB flash IC(ESP_SPI_FLASH_SIZE_K=2048) I can boot only using user2.bin:

Code: Select all

esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash --flash_freq 40m --flash_mode qio --flash_size 16m 0x00000 "/home/al/Dropbox/linux/esp_nonos_2_1_0/sdk/bin/boot_v1.7.bin" 0x1000 build/httpd.user1.bin 0x1FC000 ../bin/esp_init_data_default.bin 0x1FE000 ../bin/blank.bin

Following is NOT work:

Code: Select all

esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash --flash_freq 40m --flash_mode qio --flash_size 16m 0x00000 "/home/al/Dropbox/linux/esp_nonos_2_1_0/sdk/bin/boot_v1.7.bin" 0x81000 build/httpd.user2.bin 0x1FC000 ../bin/esp_init_data_default.bin 0x1FE000 ../bin/blank.bin


Same story with (ESP_SPI_FLASH_SIZE_K=4096)
Does someone able to run NONOS SDK based firmware on flash IC higher than 1MB? Point me please to correct makefile.

almaz1c
Posts: 13
Joined: Mon Aug 28, 2017 4:03 am

Re: OTA problem

Postby almaz1c » Sun Feb 04, 2018 7:34 am

AgentSmithers wrote:Everyone,
So almaz1c and I had a moment to connect over skype. We, however, were not able to rule out his eagle.ld file being the correct file to use for his ESP8266 SPI. Anyone know what the best documentation is to get a technical understanding of the Eagle.LD files to ensure we can say we are using the correct LD?
Thanks!
-Agent


Thank you very much!
You saved probably weeks of my life!
Just using esptool's correct settings)

AgentSmithers
Posts: 123
Joined: Sat Apr 01, 2017 1:21 am
Contact:

Re: OTA problem

Postby AgentSmithers » Sun Feb 04, 2018 7:36 am

Team,
The most important thing when it comes to this kind of stuff is reporting back the solution which many people forget on forums. I hope this helps someone else as well.

[2/1/2018 5:35:48 PM] *** Agent would like to add you on Skype

Espressif ***
[2/1/2018 9:49:27 PM] almaz1c: Hi!
[2/1/2018 9:49:56 PM] Agent: Hey
[2/1/2018 9:49:58 PM] Agent: How goes it
[2/1/2018 9:50:24 PM] almaz1c: Still no luck
[2/1/2018 9:50:29 PM] Agent: kk 1 tick
[2/1/2018 9:50:32 PM] Agent: let me test my Mic
[2/1/2018 9:50:34 PM] Agent: 1 moment
[2/1/2018 9:52:49 PM] *** Call to almaz1c ***
[2/1/2018 9:57:22 PM] *** Call ended, duration 04:33 ***
[2/1/2018 9:57:31 PM] Agent: Yeah, Ill reach out to you tomorrow
[2/1/2018 9:57:35 PM] Agent: one more question
[2/1/2018 9:57:41 PM] Agent: how are you pushing the firmward to the chip
[2/1/2018 9:57:50 PM] Agent: through an HTTP socket or by some other means?
[2/1/2018 9:58:48 PM] almaz1c: I push it via com port on PC. /dev/ttyUSB0
[2/1/2018 9:59:27 PM] Agent: Ummm OTA would be like over the network you mean you normally push it via ttyUSB0 but when you test OTA you do it still through TTY0?
[2/1/2018 9:59:31 PM] Agent: ttyUSB0?
[2/1/2018 9:59:44 PM] almaz1c: Oh
[2/1/2018 9:59:59 PM] Agent: OTA = Over the Air so I assume some sort of Ethernet / IP protocol
[2/1/2018 10:01:04 PM] almaz1c: For ota upgrading i connect to esp by opening its web interface
[2/1/2018 10:01:14 PM] almaz1c: Via wifi
[2/1/2018 10:01:27 PM] Agent: Is this an interface you build or someone else?
[2/1/2018 10:01:58 PM] almaz1c: Yes web interface
[2/1/2018 10:02:07 PM] almaz1c: Based on esphttpd
[2/1/2018 10:02:22 PM] Agent: So you are using the HTML file inputbox to select your .BIN ?
[2/1/2018 10:02:31 PM] Agent: in your web interface
[2/1/2018 10:02:36 PM] almaz1c: Yes
[2/1/2018 10:02:39 PM] Agent: Gotcha
[2/1/2018 10:02:52 PM] Agent: So its over the HTTP protocol
[2/1/2018 10:03:01 PM] almaz1c: Yep
[2/1/2018 10:03:14 PM] Agent: IPv4/TCP/HTTP layer 3,4,5
[2/1/2018 10:03:33 PM] Agent: Do it have to be though this method or are you just trying to get it to work at all?
[2/1/2018 10:04:26 PM] almaz1c: Not sure about what of that exactly used
[2/1/2018 10:05:47 PM] Agent: If your using a Web Interface it's using that with a File Input box
[2/1/2018 10:06:05 PM] almaz1c: Yes
[2/1/2018 10:06:19 PM] Agent: IPv4 is layer 3, TCP layer 4, HTTP layer 5, Cookies layer 6 and File button is layer 7
[2/1/2018 10:06:34 PM] Agent: Do it have to be though this method or are you just trying to get it to work at all?
[2/1/2018 10:06:49 PM] Agent: Like does it have to be via this method
[2/1/2018 10:06:52 PM] Agent: or can we do another?
[2/1/2018 10:07:21 PM] almaz1c: I think i use this method
[2/1/2018 10:07:58 PM] Agent: kk I have another way 1 moment let me see if its ready you may find it better but we can still work on yours aswell
[2/1/2018 10:08:21 PM] almaz1c: Sure
[2/1/2018 10:08:34 PM] almaz1c: Seems that problem in following: i can't boot using user2.bin
[2/1/2018 10:09:16 PM] Agent: take that
[2/1/2018 10:09:20 PM] Agent: we can use it to test
[2/1/2018 10:09:21 PM] Agent: 1 sec
[2/1/2018 10:09:38 PM] almaz1c: Maybe i missed some difference in flashing for boot via 0x1000 and 0x81000
[2/1/2018 10:11:13 PM] almaz1c: Got it
[2/1/2018 10:11:19 PM] Agent: When you use that header, just call init_fota(8888)
[2/1/2018 10:11:26 PM] almaz1c: Thank you)
[2/1/2018 10:11:26 PM] Agent: then FOTA will work on that port
[2/1/2018 10:11:34 PM] Agent: let me get you a script to test pushing the firmware
[2/1/2018 10:11:35 PM] Agent: 1 sec
[2/1/2018 10:14:42 PM] Agent: [osboxes@osboxes Main]$ ./upgradeota.sh 192.168.1.142:8888 blinky-0x01000.bin blinky-0x81000.bin
[2/1/2018 10:14:52 PM] Agent: that should do it
[2/1/2018 10:15:09 PM] Agent: for testing, but if that does not work then its something with your binary's we can dive into it tomorrow ^^
[2/1/2018 10:16:01 PM] Agent: That code is tested and works
[2/1/2018 10:16:39 PM] Agent: That script u run from your computer to push the firmware
[2/1/2018 10:16:46 PM] almaz1c: Awesome!
[2/1/2018 10:16:59 PM] Agent: yea, I worked alot to get that crap to work
[2/1/2018 10:17:11 PM] almaz1c: I will test it today after coming back from my work
[2/1/2018 10:17:18 PM] Agent: What ESP are you using? 01, 09?? Wemos d1?
[2/1/2018 10:17:26 PM] almaz1c: Thank you very much!
[2/1/2018 10:17:33 PM] Agent: No worries, thank me when we get it working
[2/1/2018 10:17:49 PM] almaz1c: Custom hardware)
[2/1/2018 10:17:56 PM] Agent: Oh no shit... kk
[2/1/2018 10:18:03 PM] Agent: Thats no problem
[2/1/2018 10:18:31 PM] Agent: Yeah we cna knock this out easy i hope
[2/1/2018 10:20:09 PM] almaz1c: I think that i missed about booting esp using 0x81000
[2/1/2018 10:20:26 PM] Agent: Umm I dont think thats somehing u have to worrie about
[2/1/2018 10:20:31 PM] Agent: im more concerned about your eagle.ld file
[2/1/2018 10:20:49 PM] Agent: a differnt LD file has to be genereated for OTA
[2/1/2018 10:20:54 PM] almaz1c: Because can't get it running if i flaah it using esptool at all. Without using ota at all
[2/1/2018 10:21:06 PM] Agent: I need to review your make file to see if it does that
[2/1/2018 10:21:09 PM] Agent: Yeah
[2/1/2018 10:21:15 PM] Agent: If your eagle.LD is wrong
[2/1/2018 10:21:17 PM] Agent: you cant OTA
[2/1/2018 10:21:21 PM] almaz1c: esptool.py --port /dev/ttyUSB0 --baud 460800 writeflash --flashfreq 40m --flashmode qio --flashsize 32m 0x00000 "/home/al/Dropbox/linux/espnonos210/sdk/bin/bootv1.7.bin" 0x1000 build/httpd.user1.bin 0x3FC000 ../bin/espinitdatadefault.bin 0x3FE000 ../bin/blank.bin 
[2/1/2018 10:21:25 PM] Agent: only ttyUSB0 with normal flash
[2/1/2018 10:21:51 PM] Agent: basud 460800 works for you?
[2/1/2018 10:21:55 PM] Agent: baud?
[2/1/2018 10:22:15 PM] Agent: im only at 115200 maybe I need to up mine :-\
[2/1/2018 10:22:16 PM] almaz1c: I can't run esp from 0x81000 after flashing via ttyUSB0 as well as if i use ota
[2/1/2018 10:22:27 PM] almaz1c: I tried 115200 too
[2/1/2018 10:22:57 PM] Agent: U don't pick where the software boots.. thats does by the ESP, it checks a bit in the SPI flash i believe.
[2/1/2018 10:22:58 PM] Agent: 1 sec
[2/1/2018 10:23:40 PM] Agent: flash: LDFLAGS=-Teagle.app.v6.ld this for normal flash
[2/1/2018 10:23:42 PM] Agent: OTA is different
[2/1/2018 10:24:12 PM] Agent: build-fotablinky-0x81000.bin: LDFLAGS=-Teagle.app.v6.new.2048.ld
build-fotablinky-0x81000.bin: blinky
esptool.py elf2image --version 2 blinky -o blinky-0x81000.bin
build-fotablinky-0x01000.bin: LDFLAGS=-Teagle.app.v6.new.2048.ld
build-fotablinky-0x01000.bin: blinky
esptool.py elf2image --version 2 blinky -o blinky-0x01000.bin
[2/1/2018 10:24:15 PM] Agent: Thats OTA
[2/1/2018 10:24:21 PM] almaz1c: esptool.py --port /dev/ttyUSB0 --baud 460800 writeflash --flashfreq 40m --flashmode qio --flashsize 32m 0x00000 "/home/al/Dropbox/linux/espnonos210/sdk/bin/bootv1.7.bin" 0x81000 build/httpd.user2.bin 0x3FC000 ../bin/espinitdatadefault.bin 0x3FE000 ../bin/blank.bin
[2/1/2018 10:24:22 PM] Agent: it uses a different LD file in your makefile
[2/1/2018 10:24:53 PM] almaz1c: Doea it correct command to flash 4MB to run from 81000 ?
[2/1/2018 10:25:03 PM] Agent: Yes, that is what I am running
[2/1/2018 10:25:11 PM] Agent: 32mb aka 4MB
[2/1/2018 10:25:34 PM] Agent: What does your esptool.py elf2image say in your make file?
[2/1/2018 10:25:51 PM] Agent: esptool.py elf2image --version 2 blinky -o blinky-0x81000.bin
[2/1/2018 10:26:31 PM] almaz1c: I will check this in evening after cming back
[2/1/2018 10:26:35 PM] Agent: Kk
[2/1/2018 10:26:37 PM] Agent: ima go to sleep
[2/1/2018 10:26:38 PM] Agent: :)
[2/1/2018 10:26:41 PM] Agent: good luck!
[2/1/2018 10:26:44 PM] Agent: let me know how it goes!
[2/1/2018 10:27:01 PM] almaz1c: Here is my makefile
[2/1/2018 10:27:07 PM] almaz1c: Sure!
[2/1/2018 10:27:19 PM] almaz1c: Godd night)
[2/1/2018 10:27:30 PM] almaz1c: Thank you for your help!!!
[2/1/2018 10:27:33 PM] Agent: ^^ np
[2/1/2018 10:27:37 PM] Agent: no problem*
[2/1/2018 10:29:06 PM] almaz1c: Project is based on following:
https://github.com/Spritetm/esphttpd
[2/1/2018 10:29:39 PM] Agent: I guess I should ask what your goal is?
[2/1/2018 10:29:44 PM] Agent: maybe there is an easyer way
[2/1/2018 10:30:21 PM] almaz1c: I can use OTA with default settings (for 1024KB) but it stops to work if i try to use it for 2048KB flash
[2/1/2018 10:30:29 PM] Agent: yeah
[2/1/2018 10:30:39 PM] Agent: that sounds like your .LD file to me
[2/1/2018 10:30:49 PM] almaz1c: I need to provide wireless firmware upgrade
[2/1/2018 10:31:19 PM] Agent: I understand.
[2/1/2018 10:31:27 PM] Agent: research the .LD and try to rule that out
[2/1/2018 10:31:41 PM] Agent: I still think thats what it is hearing you describe your issue
[2/1/2018 10:32:15 PM] almaz1c: https://www.dropbox.com/
[2/1/2018 10:32:33 PM] almaz1c: Here is my project if it can help
[2/1/2018 10:33:03 PM] almaz1c: Can't answer for a call at work)
[2/1/2018 10:33:15 PM] Agent: I'll try and give it a shot after work tomorrow
[2/1/2018 10:33:24 PM] Agent: will do, Talk to you later!
[2/1/2018 10:33:47 PM] almaz1c: Ok, i will start to check my LD)
[2/2/2018 2:53:16 PM] almaz1c: Hi!
[2/2/2018 2:53:31 PM] almaz1c: Seems that I localized a problem
[2/2/2018 2:53:41 PM] almaz1c: And it is not in OTA at all
[2/2/2018 2:53:55 PM] almaz1c: I think it is in LD as you mentioned
[2/2/2018 2:54:07 PM] almaz1c: Here is my experiments
[2/2/2018 2:55:41 PM] almaz1c: Same project compilied with ESP_SPI_FLASH_SIZE_K=1024 starts running both from 0x1000 and 0x81000
[2/2/2018 2:57:04 PM] almaz1c: But exactly that project without any changes in code, with only one changes in Makeflie (ESP_SPI_FLASH_SIZE_K=2048) starts to run only from 0x1000 and won;t to start from 0x81000
[2/2/2018 2:58:44 PM] almaz1c: I think that it is elementary mistake in Makefile but can't figure it)
[2/2/2018 2:59:11 PM] Agent: I think so too. I posted on the forum
[2/2/2018 2:59:25 PM] Agent: see if anyone can chime on on the technicality of the issue
[2/2/2018 2:59:48 PM] Agent: I am really really bad at make files but I think I know where the issue is ^^
[2/2/2018 3:13:07 PM] Agent: Brb running to office. ill be back in around 4 hours
[2/2/2018 3:13:09 PM] Agent: maybe 5
[12:49:23 AM] almaz1c: Are you able to boot user2.bin on 2MB flash?)
[12:49:33 AM] almaz1c: Where is the issue?)
[1:47:37 PM] Agent: I'll load it on mine today / tomorrow with OTA
[1:47:43 PM] Agent: see if I can get it to work on my controller
[1:48:15 PM] almaz1c: Hi!
[1:48:25 PM] almaz1c: Thank you for your help!
[1:48:53 PM] almaz1c: Here is project on which based my project
[1:48:59 PM] almaz1c: It is not work too
[1:49:24 PM] almaz1c: Can't run it on any flash sizes higher than 0x81000
[1:50:16 PM] almaz1c: *higher that 1MB
[1:50:34 PM] almaz1c: Can't start it from 0x81000
[1:50:47 PM] Agent: did u get a chance to try the OTA.h i sent you
[1:50:59 PM] Agent: that will rule out the Espresso code
[1:54:07 PM] almaz1c: I came to a conclusion that there is no issue with OTA procedure since there is prime cause with LD/Makefile/Configs around flash size
[1:55:36 PM] almaz1c: Both projects that I send you works fine with config of 1MB flash size (OTA procedure work too). But when I change config in Makefile to 2MB it stops to work (no booting of user2.bin from ox81000
[1:57:18 PM] almaz1c: So I pretty sure that OTA is works for me but only with ESP_SPI_FLASH_SIZE_K=1024
[1:57:38 PM] almaz1c: Sorry if I don't noticed you that details
[2:19:56 PM] Agent: no its okay
[2:20:05 PM] Agent: then its your Makefile and the way it selects its Eagle.ld
[2:20:16 PM] Agent: want a copy of my make file so you can compare
[2:20:19 PM] Agent: ?
[2:20:23 PM] almaz1c: Sure!
[2:20:29 PM] Agent: kk i custom wrote mine
[2:20:44 PM] almaz1c: Makefile and Makefile.ota if it is possible)
[2:21:21 PM] Agent: I use the same file
[2:21:26 PM] Agent: I just pass diffent arguments to it
[2:21:31 PM] Agent: for nonota i use make flash
[2:21:36 PM] Agent: for ota I use make ota
[2:21:49 PM] Agent: here
[2:22:10 PM] Agent: all it does it change where it flashes and the eagle ld and the esptool.py = --version 2
[2:22:17 PM] Agent: version 2 is OTA
[2:22:28 PM] Agent: thats how the Esptool knows how to compile the binary differently
[2:23:19 PM] Agent: then makefile takes that version 2 and applys it to address 0x01000 and 0x81000
[2:23:43 PM] Agent: it also uses LDFLAGS=-Teagle.app.v6.new.2048.ld
[2:24:01 PM] Agent: instead of Teagle.app.v6.ld
[2:24:13 PM] Agent: in your make file when you pass the OTA flag put this in
[2:24:18 PM] Agent: echo $(LDFLAGS)
[2:24:27 PM] Agent: to see if your make file is applying the correct LD file
[2:24:45 PM] Agent: that's assuming your variable name is LDFLAGS like mine
[2:24:46 PM] Agent: LDFLAGS = -Teagle.app.v6.ld
[2:35:07 PM] almaz1c: $(FW_BASE): $(TARGET_BIN) libesphttpd/mkupgimg/mkupgimg
$(Q) libesphttpd/mkupgimg/mkupgimg $(TARGET_BIN_USR1) $(TARGET_BIN_USR2) $(TAGNAME) $(TARGET_OTAFILE)
echo "Almaz" $(LD_SCRIPT_USR2)
[2:35:27 PM] almaz1c: Output is:
echo "Almaz" -T/home/al/Dropbox/linux/esp_nonos_2_1_0/sdk/ld/eagle.app.v6.new.2048.ld
Almaz -T/home/al/Dropbox/linux/esp_nonos_2_1_0/sdk/ld/eagle.app.v6.new.2048.ld
[2:37:38 PM] almaz1c: Do you have any simple NONOS SDK based project to test it in my environment
[2:37:40 PM] almaz1c: ?
[2:37:50 PM] almaz1c: Some none secret project
[2:39:18 PM] almaz1c: to try to flash it in 0x81000
[2:39:57 PM] Agent: like a blinky?
[2:39:59 PM] Agent: or something
[2:40:41 PM] Agent: I may
[2:40:42 PM] Agent: 1 tick
[2:40:44 PM] almaz1c: yes
[2:40:45 PM] Agent: does it require OTA?
[2:40:51 PM] almaz1c: no
[2:40:54 PM] Agent: I have projects but non with ota
[2:40:56 PM] Agent: yeah 1 sec
[2:41:02 PM] almaz1c: just able to start from 0x81000
[2:41:18 PM] Agent: U cant start from 81000 without OTA
[2:41:31 PM] Agent: What ur asking for is OTA firmware
[2:41:44 PM] Agent: thats not a bad idea
[2:41:48 PM] Agent: I can burn OTA firmware
[2:41:56 PM] Agent: and u can burn it to your ESP to test t
[2:41:58 PM] Agent: it
[2:42:15 PM] almaz1c: Great!
[2:42:21 PM] Agent: yea let me create some and test on my end
[2:43:02 PM] almaz1c: I am in stuck why after setting ESP_SPI_FLASH_SIZE_K=2048 I can't boot from 0x81000
[2:43:06 PM] almaz1c: It is magic)
[2:47:07 PM] Agent: im working on your ota firmware
[2:47:09 PM] Agent: 1 moment
[2:47:50 PM] almaz1c: will it work on NONOS 2.1.0 or should I download another version of sdk?
[2:49:01 PM] Agent: no it will owrk on 2.1.0
[2:49:08 PM] Agent: and it dosnt matter what I build it with
[2:49:17 PM] almaz1c: awesome!
[2:51:41 PM] Agent: testing on my end
[2:51:45 PM] Agent: havent done fota in a bit
[2:52:34 PM] Agent: huh
[2:52:36 PM] Agent: you know whats weird
[2:52:43 PM] Agent: I seem to be burning to a different address
[2:55:12 PM] almaz1c: If it is possible - can you try to run my project that I sent you last time via skype?
[2:55:27 PM] Agent: yeah
[2:55:31 PM] Agent: i can do that by tomorrow
[2:55:31 PM] almaz1c: esphttpd-master.rar
[2:55:35 PM] Agent: I found something interesting
[2:55:36 PM] Agent: 1 second
[2:55:40 PM] Agent: ima have you try something
[2:55:45 PM] Agent: i dont think 81000 is correct
[2:56:06 PM] almaz1c: 0x101000?
[2:56:13 PM] Agent: yea
[2:56:17 PM] Agent: im tripple checking
[2:56:54 PM] almaz1c: #ifdef OTA_FLASH_SIZE_K
CgiUploadFlashDef uploadParams={
.type=CGIFLASH_TYPE_FW,
.fw1Pos=0x1000,
.fw2Pos=0x101000,
.fwSize=0x7B000,
.tagName=OTA_TAGNAME
};
#define INCLUDE_FLASH_FNS
#endif
[2:57:06 PM] almaz1c: Should I change it in my code too?
[2:57:21 PM] almaz1c: As well as in esptool params?
[2:58:02 PM] Agent: im testing
[2:58:03 PM] Agent: one moment
[2:58:05 PM] Agent: ^^
[2:59:48 PM] Agent: yeah this worked for me
[2:59:59 PM] Agent: but I used 0x1000
[2:59:59 PM] Agent: and
[3:00:31 PM] Agent: 0x101000
[3:01:36 PM] Agent: burn that to both addresses
[3:01:52 PM] Agent: i tested it on mine
[3:01:56 PM] Agent: works fine
[3:02:45 PM] Agent: the code itself may crash but it should at least give you a prompt
[3:02:51 PM] Agent: that it loaded
[3:07:20 PM] almaz1c: Does it uses 115200 ?
[3:07:27 PM] Agent: mine does
[3:07:35 PM] Agent: ive never gone higher without issues of burning
[3:07:48 PM] Agent: it may be because my FTDI cant handle it
[3:07:50 PM] Agent: yours may
[3:08:57 PM] almaz1c: I downloaded your file following way:
esptool.py -p /dev/ttyUSB0 erase_flash
esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash --flash_freq 40m --flash_mode qio --flash_size 2MB 0x00000 "/home/al/Dropbox/linux/esp_nonos_2_1_0/sdk/bin/boot_v1.7.bin" 0x101000 build/blinky-0x01000.bin 0x1FC000 ../bin/esp_init_data_default.bin 0x1FE000 ../bin/blank.bin
[3:09:20 PM] Agent: let me check my addresses
[3:09:23 PM] almaz1c: After running it I see that scrap on uart
[3:09:33 PM] Agent: send me a picture on the output
[3:09:41 PM] Agent: Oh I see it
[3:09:54 PM] Agent: yea theres something up with your flash addreses that for sure should work
[3:09:56 PM] Agent: 1 tick
[3:10:24 PM] almaz1c: Do you use boot_v1.7.bin?
[3:10:42 PM] Agent: esptool.py write_flash --flash_size 32m-c1 0 boot_v1.7.bin 0x1000 blinky-0x01000.bin 0x7e000 blank.bin 0xFE000 blank.bin 0x3FC000 esp_init_data_default_adc33.bin
[3:11:48 PM] Agent: whats up with your flashsizedont burn to 101000 from the get go, burn to 0x1000
[3:12:11 PM] Agent: i also burn to 3fc000 with espinit
[3:12:22 PM] Agent: it may be do to your flashsize SPI
[3:12:32 PM] Agent: are you 4MB or 32mbit?
[3:12:37 PM] Agent: if ur flash you have 2MB
[3:12:52 PM] Agent: 2MB = 16mb
[3:16:24 PM] almaz1c: Awesome!!!!
[3:16:30 PM] almaz1c: esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash --flash_freq 40m --flash_mode qio --flash_size 32m-c1 0x00000 "/home/al/Dropbox/linux/esp_nonos_2_1_0/sdk/bin/boot_v1.7.bin" 0x101000 build/blinky-0x01000.bin 0x7E000 ../bin/blank.bin 0xFE000 ../bin/blank.bin 0x3FC000 ../bin/esp_init_data_default.bin
[3:16:34 PM] almaz1c: Works fine!!!
[3:16:48 PM] almaz1c: Flashing mine binary:
esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash --flash_freq 40m --flash_mode qio --flash_size 32m-c1 0x00000 "/home/al/Dropbox/linux/esp_nonos_2_1_0/sdk/bin/boot_v1.7.bin" 0x101000 build/httpd.user2.bin 0x7E000 ../bin/blank.bin 0xFE000 ../bin/blank.bin 0x3FC000 ../bin/esp_init_data_default.bin
[3:16:48 PM] Agent: Show me a screenshot
[3:16:54 PM] almaz1c: Works fine!!!
[3:17:02 PM] Agent: yeah ur flashsize was wrong
[3:17:06 PM] Agent: 2mb does not match your SPI
[3:17:28 PM] almaz1c: I tried 32m and 32m-c1 too
[3:17:44 PM] Agent: ur probly running 32mb/4MB like me on the wemos d1 mini pro
[3:17:57 PM] almaz1c: But I never flashed blank to 0x7E000 in a case of 4MB
[3:18:16 PM] almaz1c: Why 7E000 in a case of 4MB?
[3:18:32 PM] almaz1c: There is no any word about that in Espressif's guide!
[3:19:39 PM] Agent: yea that looks good
[3:20:18 PM] Agent: my memory isnt fresh on 7e000 1 sec let me see
[3:21:01 PM] almaz1c: esptool settings you sent me uses blank for 0x7e000
[3:21:22 PM] Agent: yeah
[3:21:24 PM] Agent: i see that
[3:21:31 PM] Agent: so are u sure that was the part of it?
[3:21:35 PM] Agent: just want to confirm
[3:21:43 PM] almaz1c: esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash --flash_freq 40m --flash_mode qio --flash_size 32m-c1 0x00000 "/home/al/Dropbox/linux/esp_nonos_2_1_0/sdk/bin/boot_v1.7.bin" 0x101000 build/httpd.user2.bin 0x7E000 ../bin/blank.bin 0xFE000 ../bin/blank.bin 0x3FC000 ../bin/esp_init_data_default.bin
[3:21:52 PM] almaz1c: esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash --flash_freq 40m --flash_mode qio --flash_size 32m-c1 0x00000 "/home/al/Dropbox/linux/esp_nonos_2_1_0/sdk/bin/boot_v1.7.bin" 0x101000 build/blinky-0x01000.bin 0x7E000 ../bin/blank.bin 0xFE000 ../bin/blank.bin 0x3FC000 ../bin/esp_init_data_default.bin
[3:21:53 PM] Agent: or was it updating the 2mb to 32mbit
[3:22:18 PM] almaz1c: I can leave 0x7E000 flashing to check it
[3:22:43 PM] Agent: yeah we need to narrow it down so we can report back
[3:23:45 PM] almaz1c: esptool.py --port /dev/ttyUSB0 --baud 460800 write_flash --flash_freq 40m --flash_mode qio --flash_size 32m-c1 0x00000 "/home/al/Dropbox/linux/esp_nonos_2_1_0/sdk/bin/boot_v1.7.bin" 0x101000 build/httpd.user2.bin 0xFE000 ../bin/blank.bin 0x3FC000 ../bin/esp_init_data_default.bin
[3:23:50 PM] almaz1c: It started too
[3:24:11 PM] Agent: so it seems it was your --flash_size then?
[3:24:11 PM] almaz1c: Ohh
[3:26:58 PM] almaz1c: Yeah
[3:27:27 PM] almaz1c: Seems that I tried 32m and 32m-c1 with 0x81000 only
[3:27:56 PM] almaz1c: I wasted a week trying different ways
[3:28:16 PM] almaz1c: You saved probably another some weeks of my life!))
[3:28:22 PM] almaz1c: Thank you very much!
[3:28:34 PM] Agent: Yea, I burned 6 months of mine doing it myself
[3:29:59 PM] Agent: so all clear?
[3:31:05 PM] almaz1c: Thank you so much!!!

Who is online

Users browsing this forum: No registered users and 12 guests