Unstable partition API flashing functions

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: Unstable partition API flashing functions

Postby ESP_Angus » Thu Mar 23, 2017 3:10 am

Sorry, I did indeed miss that you were running the ESP32 as an AP. It might be a couple of days before I get a chance to try and reproduce this again, sorry.

Does using the branch linked above help at all?
Its not slow because I when it does work I can send and write the whole 1Mbyte partition in a few seconds.
There are different scales of slow. :) I meant that a difference of tens of milliseconds for a particular SPI flash operation (during which time most other functions have to be suspended as the flash is busy) may be the key here. However, it sounds like I probably wasn't using the right method to reproduce! :P

imtiaz
Posts: 106
Joined: Wed Oct 26, 2016 1:34 am

Re: Unstable partition API flashing functions

Postby imtiaz » Fri Mar 24, 2017 12:10 am

Hi @ESP_Angus,

Did some testing on the branch .. spi_flash_lock_period as you suggested.

Initial results looked really good - I got stable OTA updates - 5/5. This was with wifi only enabled.

As soon as I enabled BL and setup a GATT server it started to crash. Crash happens when erasing partition. This is with Free RTOS on single core disabled in menu config - i.e free rtos not limited to single core and reserve memory for two cores ticked.

Code: Select all

erasing partition<\r><\n>
Guru Meditation Error of type IllegalInstruction occurred on core  0. Exception was unhandled.<\r><\n>
Register dump:<\r><\n>
PC      : 0x400d40ea  PS      : 0x00060f31  A0      : 0x8000beb2  A1      : 0x3ffc0ae0  <\r><\n>
A2      : 0x3ffd1de4  A3      : 0x00000018  A4      : 0x00060f21  A5      : 0x3ffc0c00  <\r><\n>
A6      : 0x00000001  A7      : 0x3ffc0c68  A8      : 0x800816ec  A9      : 0x3ffc0ac0  <\r><\n>
A10     : 0x00060f23  A11     : 0x00060f23  A12     : 0x00060f21  A13     : 0x00000000  <\r><\n>
A14     : 0x00000000  A15     : 0x3ffc38fc  SAR     : 0x00000017  EXCCAUSE: 0x00000000  <\r><\n>
EXCVADDR: 0x00000000  LBEG    : 0x4000c46c  LEND    : 0x4000c477  LCOUNT  : 0xffffffff  <\r><\n>
<\r><\n>
Backtrace: 0x400d40ea:0x3ffc0ae0 0x4000beb2:0x3ffc0b00 0x4000106c:0x3ffc0b20 0x40047490:0x3ffc0b40 0x40048524:0x3ffc0b70 0x40048675:0x3ffc0b90 0x40054ed9:0x3ffc0bb0 0x40082782:0x3ffc0bd0 0x4008128d:0x3ffc0c00<\r>

Code: Select all

(gdb) info symbol 0x400d40ea
pvPortMalloc + 2 in section .flash.text
(gdb)

imtiaz
Posts: 106
Joined: Wed Oct 26, 2016 1:34 am

Re: Unstable partition API flashing functions

Postby imtiaz » Fri Mar 24, 2017 12:23 am

and with free rtos on single core and reserve memory for two cores disabled - it goes a bit further but crashes while doing a flash write - same error code from gdb
(gdb) info symbol 0x400d3ba2
pvPortMalloc + 2 in section .flash.text

Trace below as file is received and written to data partition:

Code: Select all

1024 : 39156<\r><\n>
436 : 40180<\r><\n>
1024 : 40616<\r><\n>
436 : 41640<\r><\n>
436 : 42076<\r><\n>
1024 : 42512<\r><\n>
436 : 43536<\r><\n>
588 : 43972<\r><\n>
1024 : 44560<\r><\n>
436 : 45584<\r><\n>
1024 : 46020<\r><\n>
436 : 47044<\r><\n>
1024 : 47480<\r><\n>
436 : 48504<\r><\n>
436 : 48940<\r><\n>
1024 : 49376<\r><\n>
436 : 50400<\r><\n>
Guru Meditation Error of type IllegalInstruction occurred on core  0. Exception was unhandled.<\r><\n>
Register dump:<\r><\n>
PC      : 0x400d3ba2  PS      : 0x00060c31  A0      : 0x8000beb2  A1      : 0x3ffc04e0  <\r><\n>
A2      : 0x3ffe8dc0  A3      : 0x00000018  A4      : 0x00060021  A5      : 0x3ffc0600  <\r><\n>
A6      : 0x00000000  A7      : 0x3ffc0640  A8      : 0x800815d4  A9      : 0x3ffc04c0  <\r><\n>
A10     : 0x00060a23  A11     : 0x00060a23  A12     : 0x00060a21  A13     : 0x4008463c  <\r><\n>
A14     : 0x3ffe8b90  A15     : 0x3ff42000  SAR     : 0x00000017  EXCCAUSE: 0x00000000  <\r><\n>
EXCVADDR: 0x00000000  LBEG    : 0x4000c2e0  LEND    : 0x4000c2f6  LCOUNT  : 0xffffffff  <\r><\n>
<\r><\n>
Backtrace: 0x400d3ba2:0x3ffc04e0 0x4000beb2:0x3ffc0500 0x4000106c:0x3ffc0520 0x40047490:0x3ffc0540 0x40048524:0x3ffc0570 0x40048675:0x3ffc0590 0x40054ed9:0x3ffc05b0 0x4008276e:0x3ffc05d0 0x40081180:0x3ffc0600<\r><\n>

imtiaz
Posts: 106
Joined: Wed Oct 26, 2016 1:34 am

Re: Unstable partition API flashing functions

Postby imtiaz » Fri Mar 24, 2017 12:25 am

Is BL using an insane amount of RAM ?

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: Unstable partition API flashing functions

Postby ESP_Angus » Fri Mar 24, 2017 12:41 am

Hi Imtiaz,
imtiaz wrote:flash write - same error code from gdb
(gdb) info symbol 0x400d3ba2
pvPortMalloc + 2 in section .flash.text
This sounds like a different underlying issue. Can you please decode the full stack trace (you can paste the whole backtrace line into xtensa-esp32-elf-addr2line, or if you have a recent IDF then 'make monitor' should decode them automatically.)

Angus

imtiaz
Posts: 106
Joined: Wed Oct 26, 2016 1:34 am

Re: Unstable partition API flashing functions

Postby imtiaz » Fri Mar 24, 2017 1:20 am

Hi Angus,

Make monitor is not working on the latest IDF from what I know.

imtiaz
Posts: 106
Joined: Wed Oct 26, 2016 1:34 am

Re: Unstable partition API flashing functions

Postby imtiaz » Fri Mar 24, 2017 1:23 am

make monitor
MONITOR
/bin/sh: winpty: command not found
make: *** [/c/esp32/esp-idf/components/esptool_py/Makefile.projbuild:92: monitor] Error 127

imtiaz
Posts: 106
Joined: Wed Oct 26, 2016 1:34 am

Re: Unstable partition API flashing functions

Postby imtiaz » Fri Mar 24, 2017 1:53 am

not sure how to do this - can you provide some guidance please
Can you please decode the full stack trace (you can paste the whole backtrace line into xtensa-esp32-elf-addr2line

ESP_igrr
Posts: 2067
Joined: Tue Dec 01, 2015 8:37 am

Re: Unstable partition API flashing functions

Postby ESP_igrr » Fri Mar 24, 2017 1:59 am

http://esp-idf.readthedocs.io/en/latest ... on-windows

You may run "pacman -S winpty" to fix this.

imtiaz
Posts: 106
Joined: Wed Oct 26, 2016 1:34 am

Re: Unstable partition API flashing functions

Postby imtiaz » Fri Mar 24, 2017 2:17 am

Thanks monitor works :)

Heres what is being decoded on the crash - sorry I dont know if it will be helpful or not.
  • erasing partition
    Guru Meditation Error of type IllegalInstruction occurred on core 0. Exception was unhandled.
    Register dump:
    PC : 0x400d3c3a PS : 0x00060931 A0 : 0x8000beb2 A1 : 0x3ffc0ae0
    0x400d3c3a: pvPortMalloc at C:/esp32/esp-idf/components/esp32/heap_alloc_caps.c:305
    A2 : 0x3ffd1eb4 A3 : 0x00000018 A4 : 0x00060521 A5 : 0x3ffc0c00
    A6 : 0x3ff51038 A7 : 0x3ffc0c68 A8 : 0x80081844 A9 : 0x3ffc0ac0
    A10 : 0x00060923 A11 : 0x00060923 A12 : 0x00060921 A13 : 0x40084abc
    0x40084abc: _frxt_int_enter at ??:?
    A14 : 0x00000000 A15 : 0x3ffc39c8 SAR : 0x00000017 EXCCAUSE: 0x00000000
    EXCVADDR: 0x00000000 LBEG : 0x4000c2e0 LEND : 0x4000c2f6 LCOUNT : 0xffffffff

    Backtrace: 0x400d3c3a:0x3ffc0ae0 0x4000beb2:0x3ffc0b00 0x4000106c:0x3ffc0b20 0x40047490:0x3ffc0b40 0x40048524:0x3ffc0b70 0x40048675:0x3ffc0b90 0x40054ed9:0x3ffc0bb0 0x40082b86:0x3ffc0bd0 0x400813d5:0x3ffc0c00
    0x400d3c3a: pvPortMalloc at C:/esp32/esp-idf/components/esp32/heap_alloc_caps.c:305
    0x40082b86: r_rwbtdm_isr_wrapper at intc.c:?
    0x400813d5: _xt_lowint1 at xtensa_vectors.o:?

    Entering gdb stub now.
    Guru Meditation Error of type IllegalInstruction occurred on core 0. Exception was unhandled.
    Register dump:
    PC : 0x400d3df2 PS : 0x00060033 A0 : 0x80085bac A1 : 0x3ffc0980
    0x400d3df2: esp_gdbstub_panic_handler at C:/esp32/esp-idf/components/esp32/gdbstub.c:348
    A2 : 0x3ffc0a20 A3 : 0x00000017 A4 : 0x3ffc0a80 A5 : 0x00000018
    A6 : 0x3ffd1e40 A7 : 0x00060923 A8 : 0x80085a28 A9 : 0x3ffc0960
    A10 : 0x00000018 A11 : 0x00000018 A12 : 0x3ffc0c00 A13 : 0x3ffc09e0
    A14 : 0x3ffc21c0 A15 : 0x3ffc21cc SAR : 0x0000001b EXCCAUSE: 0x00000000
    EXCVADDR: 0x00000000 LBEG : 0x4000c2e0 LEND : 0x4000c2f6 LCOUNT : 0x00000000

    Backtrace: 0x400d3df2:0x3ffc0980 0x40085bac:0x3ffc0a00 0x40081171:0x3ffc0a20 0x400d3c3a:0x3ffc0ae0 0x400d3c3a:0x3ffc0b00 0x4000106c:0x3ffc0b20 0x40047490:0x3ffc0b40 0x40048524:0x3ffc0b70 0x40048675:0x3ffc0b90 0x40054ed9:0x3ffc0bb0 0x4008
    2b86:0x3ffc0bd0 0x400813d5:0x3ffc0c00
    0x400d3df2: esp_gdbstub_panic_handler at C:/esp32/esp-idf/components/esp32/gdbstub.c:348
    0x40085bac: xt_unhandled_exception at C:/esp32/esp-idf/components/esp32/panic.c:444
    0x40081171: _xt_user_exc at xtensa_vectors.o:?
    0x400d3c3a: pvPortMalloc at C:/esp32/esp-idf/components/esp32/heap_alloc_caps.c:305
    0x400d3c3a: pvPortMalloc at C:/esp32/esp-idf/components/esp32/heap_alloc_caps.c:305
    0x40082b86: r_rwbtdm_isr_wrapper at intc.c:?
    0x400813d5: _xt_lowint1 at xtensa_vectors.o:?

    Entering gdb stub now.
    Guru Meditation Error of type IllegalInstruction occurred on core 0. Exception was unhandled.
    Register dump:
    PC : 0x400d3df2 PS : 0x00060033 A0 : 0x80085bac A1 : 0x3ffc0820
    0x400d3df2: esp_gdbstub_panic_handler at C:/esp32/esp-idf/components/esp32/gdbstub.c:348
    A2 : 0x3ffc08c0 A3 : 0x00000017 A4 : 0x3ffc0920 A5 : 0x00000018
    A6 : 0x00000000 A7 : 0x00000000 A8 : 0x80085a28 A9 : 0x3ffc0800
    A10 : 0x00000018 A11 : 0x00000018 A12 : 0x3ffc0c00 A13 : 0x3ffc0880
    A14 : 0x3ffc21c0 A15 : 0x3ffc21cc SAR : 0x00000018 EXCCAUSE: 0x00000000
    EXCVADDR: 0x00000000 LBEG : 0x4000c2e0 LEND : 0x4000c2f6 LCOUNT : 0x00000000

    Backtrace: 0x400d3df2:0x3ffc0820 0x40085bac:0x3ffc08a0 0x40081171:0x3ffc08c0 0x400d3df2:0x3ffc0980 0x400d3df2:0x3ffc0a00 0x40081171:0x3ffc0a20 0x400d3c3a:0x3ffc0ae0 0x400d3c3a:0x3ffc0b00 0x4000106c:0x3ffc0b20 0x40047490:0x3ffc0b40 0x4004
    8524:0x3ffc0b70 0x40048675:0x3ffc0b90 0x40054ed9:0x3ffc0bb0 0x40082b86:0x3ffc0bd0 0x400813d5:0x3ffc0c00
    0x400d3df2: esp_gdbstub_panic_handler at C:/esp32/esp-idf/components/esp32/gdbstub.c:348
    0x40085bac: xt_unhandled_exception at C:/esp32/esp-idf/components/esp32/panic.c:444
    0x40081171: _xt_user_exc at xtensa_vectors.o:?
    0x400d3df2: esp_gdbstub_panic_handler at C:/esp32/esp-idf/components/esp32/gdbstub.c:348
    0x400d3df2: esp_gdbstub_panic_handler at C:/esp32/esp-idf/components/esp32/gdbstub.c:348
    0x40081171: _xt_user_exc at xtensa_vectors.o:?
    0x400d3c3a: pvPortMalloc at C:/esp32/esp-idf/components/esp32/heap_alloc_caps.c:305
    0x400d3c3a: pvPortMalloc at C:/esp32/esp-idf/components/esp32/heap_alloc_caps.c:305
    0x40082b86: r_rwbtdm_isr_wrapper at intc.c:?
    0x400813d5: _xt_lowint1 at xtensa_vectors.o:?

Who is online

Users browsing this forum: No registered users and 125 guests