Invalid command in system_get_os_print

blubb
Posts: 116
Joined: Mon Jun 22, 2015 5:35 am

Invalid command in system_get_os_print

Postby blubb » Sat Oct 07, 2017 7:51 pm

Hi,

sometimes I observe a strange fatal exception. I cannot reproduce it consistently, but if it happens, it happens on the restart after an OTA upgrade.

On system start I do this:

struct rst_info *rst_info = system_get_rst_info();
os_printf("reason=%d exccause=%d epc1=0x%X epc2=0x%X epc3=0x%X excvaddr=0x%X depc=0x%X\n", rst_info->reason, rst_info->exccause, rst_info->epc1, rst_info->epc2, rst_info->epc3, rst_info->excvaddr, rst_info->depc);

Two examples of what I see when an exception happens:

reason=2 exccause=0 epc1=0x4021ED6C epc2=0x0 epc3=0x0 excvaddr=0x33 depc=0x0

reason=2 exccause=0 epc1=0x4029ED6C epc2=0x0 epc3=0x0 excvaddr=0x0 depc=0x0

According to the map file epc1 in both cases is system_get_os_print in the NEW image (so the crash does NOT happen while still the old image is active). What is system_get_os_print? What does it do? When is it called? I do not use this function.

My OTA update is done using spi_flash_erase_sector and spi_flash_write in the right places. After that I do

system_upgrade_flag_set(UPGRADE_FLAG_FINISH);
system_upgrade_reboot();

Updating works, i.e. the new image runs perfectly (despite the exception message). If I reboot the module after that, all is well, too (the exception does not happen again).

I am using the latest SDK from
https://github.com/espressif/ESP8266_NONOS_SDK

Ideas?

Her Mary
Posts: 537
Joined: Mon Oct 27, 2014 11:09 am

Re: Invalid command in system_get_os_print

Postby Her Mary » Wed Oct 11, 2017 1:57 pm

The only thing I know is that you should "make clean" after compiling user1.bin, and then to compile user2.bin.
Or maybe you can dump flash to check if the new firmware is downloaded correctly.

blubb
Posts: 116
Joined: Mon Jun 22, 2015 5:35 am

Re: Invalid command in system_get_os_print

Postby blubb » Thu Oct 12, 2017 5:56 pm

I will download and compare the binary next time the problem occurs. It is so rare, it did not occur since I wrote my first post.

But I doubt it has to do with binary corruption. There are checksums and also the exception always happens in system_get_os_print and nowhere else. My guess is that there is a problem right after switching from user1 to user2 (or vice versa) but before the new firmware runs.

Firmware update is done via a HTTP connection and I call

system_upgrade_flag_set(UPGRADE_FLAG_FINISH);
system_upgrade_reboot();

using a timer (1 second) so that the HTTP client gets a proper response and no timeout on a successful update. I noticed by varying the time the problem occurs more often when it is shorter.

Andrewgvks
Posts: 4
Joined: Thu Sep 21, 2017 7:22 am
Location: Bulgaria
Contact:

View first unread post

Postby Andrewgvks » Fri Oct 13, 2017 5:32 am

Be sure to post pics when you get it

What amp / effects are you running it through?
Time-tested expert advisor for self-earnings

Who is online

Users browsing this forum: No registered users and 120 guests