ESP32 Crashing on Queue access in another Task

dnsmcbr
Posts: 2
Joined: Fri Jan 25, 2019 12:16 am

ESP32 Crashing on Queue access in another Task

Postby dnsmcbr » Fri Jan 25, 2019 12:39 am

Hi all,

I'm having some difficulty in accessing a queue from a handle that I've passed via the task parameters pointer.

I've verified that the handle works in the same task it is created in.

Googling seems to indicate a stack size issue, however I'm not able to resolve it by setting to high stacksize.

Code: Select all

ets Jun  8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:6276
load:0x40078000,len:11152
load:0x40080400,len:6632
entry 0x40080764
I (29) boot: ESP-IDF v3.3-beta1-223-ga62cbfec9-dirty 2nd stage bootloader
I (29) boot: compile time 20:33:54
I (30) boot: Enabling RNG early entropy source...
I (36) boot: SPI Speed      : 40MHz
I (40) boot: SPI Mode       : DIO
I (44) boot: SPI Flash Size : 4MB
I (48) boot: Partition Table:
I (52) boot: ## Label            Usage          Type ST Offset   Length
I (59) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (66) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (74) boot:  2 factory          factory app      00 00 00010000 00100000
I (81) boot: End of partition table
I (85) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x18a54 (100948) map
I (130) esp_image: segment 1: paddr=0x00028a7c vaddr=0x3ff80000 size=0x00000 (     0) load
I (130) esp_image: segment 2: paddr=0x00028a84 vaddr=0x3ff80000 size=0x00000 (     0) load
I (136) esp_image: segment 3: paddr=0x00028a8c vaddr=0x3ffb0000 size=0x02ccc ( 11468) load
I (150) esp_image: segment 4: paddr=0x0002b760 vaddr=0x3ffb2ccc size=0x00000 (     0) load
I (154) esp_image: segment 5: paddr=0x0002b768 vaddr=0x40080000 size=0x00400 (  1024) load
0x40080000: _WindowOverflow4 at C:/msys32/home/my_user/esp/esp-idf/components/freertos/xtensa_vectors.S:1685

I (164) esp_image: segment 6: paddr=0x0002bb70 vaddr=0x40080400 size=0x044a0 ( 17568) load
I (180) esp_image: segment 7: paddr=0x00030018 vaddr=0x400d0018 size=0x603a4 (394148) map
0x400d0018: _stext at ??:?

I (319) esp_image: segment 8: paddr=0x000903c4 vaddr=0x400848a0 size=0x0d838 ( 55352) load
0x400848a0: ieee80211_output_process at ??:?

I (342) esp_image: segment 9: paddr=0x0009dc04 vaddr=0x400c0000 size=0x00000 (     0) load
I (343) esp_image: segment 10: paddr=0x0009dc0c vaddr=0x50000000 size=0x00000 (     0) load
I (349) esp_image: segment 11: paddr=0x0009dc14 vaddr=0x50000000 size=0x00000 (     0) load
I (369) boot: Loaded app from partition at offset 0x10000
I (369) boot: Disabling RNG early entropy source...
I (370) cpu_start: Pro cpu up.
I (374) cpu_start: Application information:
I (378) cpu_start: Project name:     app-template
I (384) cpu_start: App version:      1
I (388) cpu_start: Compile time:     20:32:51
I (393) cpu_start: Compile date:     Jan 24 2019
I (399) cpu_start: ESP-IDF:          v3.3-beta1-223-ga62cbfec9-dirty
I (406) cpu_start: Starting app cpu, entry point is 0x400810e4
0x400810e4: call_start_cpu1 at C:/msys32/home/my_user/esp/esp-idf/components/esp32/cpu_start.c:265

I (398) cpu_start: App cpu up.
I (416) heap_init: Initializing. RAM available for dynamic allocation:
I (423) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (429) heap_init: At 3FFB8CF8 len 00027308 (156 KiB): DRAM
I (435) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (442) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (448) heap_init: At 400920D8 len 0000DF28 (55 KiB): IRAM
I (454) cpu_start: Pro cpu start user code
I (137) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (221) wifi: wifi driver task: 3ffc12a4, prio:23, stack:3072, core=0
I (221) wifi: wifi firmware version: 44ce2e2
I (221) wifi: config NVS flash: enabled
I (221) wifi: config nano formating: enabled
I (231) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (241) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (311) wifi: Init dynamic tx buffer num: 32
I (311) wifi: Init data frame dynamic rx buffer num: 32
I (311) wifi: Init management frame dynamic rx buffer num: 32
I (311) wifi: Init static rx buffer size: 1600
I (311) wifi: Init static rx buffer num: 10
I (321) wifi: Init dynamic rx buffer num: 32
I (321) WIFI: Setting WiFi configuration SSID my_ssid...
I (391) phy: phy_version: 4006, e540b8e, Dec 17 2018, 11:53:06, 0, 0
I (391) wifi: mode : sta (3c:71:bf:42:24:b0)
I (391) main: DATA RCVD:TestDataForTest1 TestDataForTest2
I (391) main: LCD Q: 0x0x3ffc6550
I (401) lcd_task: LCD_OK
I (401) lcd_task: Time Q1: 0x0x3ffc6550
I (411) lcd_task: Time Q2: 0x0x3ffc6550
RES:51f6b099, coreID:43947, portMUX_FREE_VAL:-1287651329
assertion "res == coreID || res == portMUX_FREE_VAL" failed: file "C:/msys32/home/my_user/esp/esp-idf/components/freertos/portmux_impl.inc.h", line 108, function: vPortCPUAcquireMutexIntsDisabledInternal
abort() was called at PC 0x400d2ce3 on core 1
0x400d2ce3: __assert_func at /Users/ivan/e/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/stdlib/../../../.././newlib/libc/stdlib/assert.c:63 (discriminator 8)


Backtrace: 0x4008cd94:0x3ffc8470 0x4008cfc1:0x3ffc8490 0x400d2ce3:0x3ffc84b0 0x4008f151:0x3ffc84e0 0x40090a98:0x3ffc8500 0x400d2b1c:0x3ffc8540 0x40090199:0x3ffc85a0
0x4008cd94: invoke_abort at C:/msys32/home/my_user/esp/esp-idf/components/esp32/panic.c:707

0x4008cfc1: abort at C:/msys32/home/my_user/esp/esp-idf/components/esp32/panic.c:707

0x400d2ce3: __assert_func at /Users/ivan/e/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/stdlib/../../../.././newlib/libc/stdlib/assert.c:63 (discriminator 8)

0x4008f151: vPortCPUAcquireMutexIntsDisabledInternal at C:/msys32/home/my_user/esp/esp-idf/components/freertos/tasks.c:3537
 (inlined by) vPortCPUAcquireMutexIntsDisabled at C:/msys32/home/my_user/esp/esp-idf/components/freertos/portmux_impl.h:98
 (inlined by) vTaskEnterCritical at C:/msys32/home/my_user/esp/esp-idf/components/freertos/tasks.c:4231

0x40090a98: xQueueGenericReceive at C:/msys32/home/my_user/esp/esp-idf/components/freertos/queue.c:2037

0x400d2b1c: lcd_task at C:/msys32/home/my_user/esp/launch-countdown/main/lcd_task.c:54

0x40090199: vPortTaskWrapper at C:/msys32/home/my_user/esp/esp-idf/components/freertos/port.c:403


Rebooting...
Any pointers to the issue would be appreciated, thanks!

ESP_Sprite
Posts: 9764
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32 Crashing on Queue access in another Task

Postby ESP_Sprite » Fri Jan 25, 2019 3:17 am

Hard to say... The backtrace comes down to memory corruption, that is, a spinlock variable is clobbered by something, but that's about all I can see.

dnsmcbr
Posts: 2
Joined: Fri Jan 25, 2019 12:16 am

Re: ESP32 Crashing on Queue access in another Task

Postby dnsmcbr » Fri Jan 25, 2019 12:12 pm

Yes, something like that. How do I effectively debug such issues?

ESP_Sprite
Posts: 9764
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32 Crashing on Queue access in another Task

Postby ESP_Sprite » Mon Jan 28, 2019 3:05 am

You could try if any of the tricks stated on https://docs.espressif.com/projects/esp ... debug.html work, for starters.

Who is online

Users browsing this forum: No registered users and 175 guests