ES32 Hello World project crashing in the target

Please go to Stack Overflow for help and support:

System information

  • Have I written custom code (as opposed to using a stock example script
    provided in TensorFlow)
    : No
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): macOS Catalina
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue
    happens on a mobile device
    : No
  • TensorFlow installed from (source or binary): Source
  • TensorFlow version (use command below): v2.3.0
  • Python version: Python 3.7
  • Bazel version (if compiling from source):
  • GCC/Compiler version (if compiling from source):
  • CUDA/cuDNN version:
  • GPU model and memory:
  • Exact command to reproduce:

make -f tensorflow/lite/micro/tools/make/Makefile TARGET=esp generate_hello_world_esp_project

cd tensorflow/lite/micro/tools/make/gen/esp_xtensa-esp32/prj/hello_world/esp-idf build –port /dev/ttyUSB0 flash –port /dev/ttyUSB0 monitor

Describe the problem

I am trying the hello world example for tensor flow lite for microcontrollers. I am using an ESP32-CAM board which uses ESP32-S module. I generate the code as mentioned here

After flashing the binary the module continuously resets. Please check the idf monitor logs.

Source code / logs

ets Jun 8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
mode:DIO, clock div:2
ho 0 tail 12 room 4
0x40080400: _init at ??:?

entry 0x40080688
I (31) boot: ESP-IDF v4.2-dev-1660-g7d7521367 2nd stage bootloader
I (31) boot: compile time 15:00:22
I (31) boot: chip revision: 1
I (35) boot_comm: chip revision: 1, min. bootloader chip revision: 0
I (42) boot.esp32: SPI Speed : 40MHz
I (47) boot.esp32: SPI Mode : DIO
I (51) boot.esp32: SPI Flash Size : 2MB
I (56) boot: Enabling RNG early entropy source…
I (61) boot: Partition Table:
I (65) boot: ## Label Usage Type ST Offset Length
I (72) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (80) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (87) boot: 2 factory factory app 00 00 00010000 00100000
I (95) boot: End of partition table
I (99) boot_comm: chip revision: 1, min. application chip revision: 0
I (106) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x09af0 ( 39664) map
I (130) esp_image: segment 1: paddr=0x00019b18 vaddr=0x3ffb0000 size=0x02854 ( 10324) load
I (135) esp_image: segment 2: paddr=0x0001c374 vaddr=0x40080000 size=0x00404 ( 1028) load
0x40080000: _WindowOverflow4 at /Users/sudeep_subi/software/esp-idf/components/freertos/xtensa/xtensa_vectors.S:1730

I (137) esp_image: segment 3: paddr=0x0001c780 vaddr=0x40080404 size=0x03898 ( 14488) load
I (152) esp_image: segment 4: paddr=0x00020020 vaddr=0x400d0020 size=0x4ea20 (322080) map
0x400d0020: _stext at ??:?

I (277) esp_image: segment 5: paddr=0x0006ea48 vaddr=0x40083c9c size=0x063ec ( 25580) load
0x40083c9c: prvReceiveGeneric at /Users/sudeep_subi/software/esp-idf/components/esp_ringbuf/ringbuf.c:760

I (294) boot: Loaded app from partition at offset 0x10000
I (295) boot: Disabling RNG early entropy source…
I (295) cpu_start: Pro cpu up.
I (299) cpu_start: Application information:
I (303) cpu_start: Project name: hello_world
I (309) cpu_start: App version: 1
I (313) cpu_start: Compile time: Aug 9 2020 15:00:14
I (319) cpu_start: ELF file SHA256: 242d4cfeca1609d0…
I (325) cpu_start: ESP-IDF: v4.2-dev-1660-g7d7521367
I (332) cpu_start: Starting app cpu, entry point is 0x400816d4
0x400816d4: call_start_cpu1 at /Users/sudeep_subi/software/esp-idf/components/esp32/cpu_start.c:286

I (323) cpu_start: App cpu up.
I (342) heap_init: Initializing. RAM available for dynamic allocation:
I (349) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (355) heap_init: At 3FFB51A0 len 0002AE60 (171 KiB): DRAM
I (361) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (368) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (374) heap_init: At 4008A088 len 00015F78 (87 KiB): IRAM
I (380) cpu_start: Pro cpu start user code
I (399) spi_flash: detected chip: generic
I (399) spi_flash: flash io: dio
W (399) spi_flash: Detected size(4096k) larger than the size in the binary image header(2048k). Using the size in the binary image header.
I (410) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
8 bytes lost due to alignment. To avoid this loss, please make sure the tensor_arena is 16 bytes aligned.
Guru Meditation Error: Core 0 panic’ed (StoreProhibited). Exception was unhandled.

Core 0 register dump:
PC : 0x400d3848 PS : 0x00060230 A0 : 0x800d3805 A1 : 0x3ffb6fd0
0x400d3848: loop at /Users/sudeep_subi/junk/esp32_examples/esp-idf/build/../main/

A2 : 0x00000000 A3 : 0x00000014 A4 : 0x40c90fdb A5 : 0x383f8000
A6 : 0x3ffb8fc8 A7 : 0x00000000 A8 : 0x00000000 A9 : 0x3ffb6fc0
A10 : 0x00000000 A11 : 0x41a00000 A12 : 0x00000001 A13 : 0xffffffff
A14 : 0x00000005 A15 : 0x00000004 SAR : 0x00000001 EXCCAUSE: 0x0000001d
EXCVADDR: 0x00000000 LBEG : 0x400029ac LEND : 0x400029cb LCOUNT : 0x00000000

Backtrace:0x400d3845:0x3ffb6fd0 0x400d3802:0x3ffb6ff0 0x400d21d6:0x3ffb7010 0x40084719:0x3ffb7040
0x400d3845: loop at /Users/sudeep_subi/junk/esp32_examples/esp-idf/build/../main/

0x400d3802: app_main at /Users/sudeep_subi/junk/esp32_examples/esp-idf/build/../main/esp/ (discriminator 1)

0x400d21d6: main_task at /Users/sudeep_subi/software/esp-idf/components/esp32/cpu_start.c:580

0x40084719: vPortTaskWrapper at /Users/sudeep_subi/software/esp-idf/components/freertos/xtensa/port.c:143

ELF file SHA256: 242d4cfeca1609d0

1 possible answer(s) on “ES32 Hello World project crashing in the target