But I have no clue on how to determine that for sure, so that I either rule out this as the cause for the OTA failure or find a way to fix it.
Here's what happens :
1. I build everything under the eclipse environment;
2. once everything is ok, i use the ubuntu VM to build the .bin files
The build environment is slightly modified :
1. the irom0_text in both LD files is increased to 0x30000 (192 Kb)
2. I removed the user input commands from the gen_build.sh, so that both user1/user2 files get built without other intervention
I flash the boot.bin and both user1/user2.bin to the module; no other flash areas are affected (user and system parameters, etc.). So the module will boot to what it last used.
Next, I try my OTA update. As I said in my previous post, sometimes it works, sometimes not. When it crashes, it is while writing to the address 0x010000 in flash, or immediately after, and the module becomes unusable unless I flash it again over serial.
Now, even if it sounds a bit sci-fi, one of the possible reasons I can think of is this :
1. the module gets updated with both user.bin files
2. it boots to the user2.bin
3. somewhere in the code, it executes an absolute jump (not sure if this exists in this chip, by the way)
4. code continues execution in the user1.bin
5. when it tries to update the user1.bin (according to the flag) it, naturally, crashes.
Of course this can happen because the user.bin files are not correctly built. Hence the question in the subject : how can I tell if this is the case ?
Because the fact that the module becomes unusable after crashing tells me I'm writing to the wrong spot in the flash. If I'm writing to the right user.bin area and it fails, the module should still use the good user.bin and still start.
Any ideas are welcome. Thanks.Statistics: Posted by sharkx — Mon Jan 25, 2016 11:27 pm
]]>