Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TW#24742] Boot crash with CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=0 and CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH=y #2229

Closed
vonnieda opened this issue Jul 26, 2018 · 1 comment
Labels
Status: In Progress Work is in progress

Comments

@vonnieda
Copy link
Contributor

IDF: 3.0.2

If you set CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=0 in menuconfig (Component config -> ESP32-specific -> SPI RAM config -> Reserve this amount of bytes...), and have core dumps set to Flash then the chip fails to boot:

Guru Meditation Error: Core  0 panic'ed (Cache disabled but cached memory region accessed)
Register dump:
PC      : 0x4008648c  PS      : 0x00060334  A0      : 0x800866b6  A1      : 0x3ffe3ad0  
0x4008648c: spi_flash_mmap_pages at /Users/jason/esp/esp-idf/components/spi_flash/./flash_mmap.c:300

A2      : 0x3f8003e8  A3      : 0x00000001  A4      : 0x00000000  A5      : 0x3ffe3b40  
A6      : 0x3ffe3b44  A7      : 0x00000000  A8      : 0x3f8003e8  A9      : 0x3ffe3ab0  
A10     : 0xbad00bad  A11     : 0x00010000  A12     : 0x3ffaff50  A13     : 0x00000000  
A14     : 0x00000000  A15     : 0x00000000  SAR     : 0x00000017  EXCCAUSE: 0x00000007  
EXCVADDR: 0x00000000  LBEG    : 0x40095ddc  LEND    : 0x40095de7  LCOUNT  : 0x00000000  
0x40095ddc: memset at /home/jeroen/esp8266/esp32/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/machine/xtensa/../../../../.././newlib/libc/machine/xtensa/memset.S:142

0x40095de7: memset at /home/jeroen/esp8266/esp32/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/machine/xtensa/../../../../.././newlib/libc/machine/xtensa/memset.S:152


Backtrace: 0x4008648c:0x3ffe3ad0 0x400866b3:0x3ffe3b10 0x40153131:0x3ffe3b40 0x401532f2:0x3ffe3b70 0x40153347:0x3ffe3b90 0x40090b28:0x3ffe3bb0 0x40081251:0x3ffe3bd0 0x40081393:0x3ffe3c00 0x40078c6a:0x3ffe3c40 0x40078d1d:0x3ffe3c70 0x40078f8e:0x3ffe3cb0 0x400790d6:0x3ffe3e70 0x40007c31:0x3ffe3eb0 0x4000073d:0x3ffe3f20
0x4008648c: spi_flash_mmap_pages at /Users/jason/esp/esp-idf/components/spi_flash/./flash_mmap.c:300

0x400866b3: spi_flash_mmap at /Users/jason/esp/esp-idf/components/spi_flash/./flash_mmap.c:300

0x40153131: load_partitions at /Users/jason/esp/esp-idf/components/spi_flash/./partition.c:148

0x401532f2: esp_partition_find at /Users/jason/esp/esp-idf/components/spi_flash/./partition.c:67

0x40153347: esp_partition_find_first at /Users/jason/esp/esp-idf/components/spi_flash/./partition.c:119

0x40090b28: esp_core_dump_init at /Users/jason/esp/esp-idf/components/esp32/./core_dump.c:547

0x40081251: start_cpu0_default at /Users/jason/esp/esp-idf/components/esp32/./cpu_start.c:355

0x40081393: call_start_cpu0 at /Users/jason/esp/esp-idf/components/esp32/./cpu_start.c:203 (discriminator 1)

My purpose for setting this to 0 is that I don't want mbledtls using any internal memory. See #2184

So, if load_partitions specifically needs internal memory, shouldn't it use the heap caps allocator, and not just malloc?

Thanks,
Jason

@FayeY FayeY changed the title Boot crash with CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=0 and CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH=y [TW#24742] Boot crash with CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=0 and CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH=y Jul 31, 2018
@igrr igrr added the Status: In Progress Work is in progress label Jul 31, 2018
@igrr igrr closed this as completed in 79e7f02 Aug 6, 2018
@vonnieda
Copy link
Contributor Author

vonnieda commented Aug 6, 2018

Thank you!

igrr added a commit that referenced this issue Aug 13, 2018
* spi_flash_mmap_pages needs pages array to be in internal memory.
  Document and check this.

* Fix a bug that spi_flash_mmap did not allocate pages array in
  internal memory.

* Minor style fixes: const-ify pages argument of spi_flash_mmap, add
  spaces around operators, mark output arguments with [out].

Closes #2229.
catalinio pushed a commit to catalinio/pycom-esp-idf that referenced this issue Jun 28, 2019
* spi_flash_mmap_pages needs pages array to be in internal memory.
  Document and check this.

* Fix a bug that spi_flash_mmap did not allocate pages array in
  internal memory.

* Minor style fixes: const-ify pages argument of spi_flash_mmap, add
  spaces around operators, mark output arguments with [out].

Closes espressif/esp-idf#2229.
catalinio pushed a commit to catalinio/pycom-esp-idf that referenced this issue Jun 28, 2019
* spi_flash_mmap_pages needs pages array to be in internal memory.
  Document and check this.

* Fix a bug that spi_flash_mmap did not allocate pages array in
  internal memory.

* Minor style fixes: const-ify pages argument of spi_flash_mmap, add
  spaces around operators, mark output arguments with [out].

Closes espressif/esp-idf#2229.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: In Progress Work is in progress
Projects
None yet
Development

No branches or pull requests

2 participants