spi and rtos panics

Wilberforce
Posts: 8
Joined: Sun Apr 02, 2017 4:50 am

Re: spi and rtos panics

Postby Wilberforce » Wed Aug 30, 2017 9:34 am

I'm getting a similar kind of panic.

The code is for the Espruino interpreter, and occurs when trying to set timers after about 150 iterations:

```
var count=0;

function blip() {
digitalPulse(21, 1, 15);
}

function start() {
setInterval(blip, 30);
}

start();
```


I have increase stack size in the vTask and also stack sizes in the menuconfig, but still getting the crash:

```
>abort() was called at PC 0x400827ef on core 0
Backtrace: 0x400876ac:0x3ffb0470 0x400877ab:0x3ffb0490 0x400827ef:0x3ffb04b0 0x400828dd:0x3ffb04e0 0x400d353e:0x3ffb0500 0x400829b8:0x3ffb0520 0x40117c3d:0x3ffb0540 0x40103539:0x3ffb0560 0x400e89a4:0x3ffb0590 0x40082b1f:0x3ffb05e0 0x400816f5:0x3ffb0600
================= CORE DUMP START =================
```

```
root@office-pc:~/esp32/EspruinoBuildTools/esp32/build/Espruino# ../../build/esp-idf/components/espcoredump/espcoredump.py info_corefile -t b64 -c coredump.dat espruino_1v94.20_esp32.elf
espcoredump.py v0.1-dev
===============================================================
==================== ESP32 CORE DUMP START ====================

================== CURRENT THREAD REGISTERS ===================
pc 0x401284d8 0x401284d8 <esp_vApplicationIdleHook+40>
lbeg 0x0 0
lend 0x0 0
lcount 0x0 0
sar 0x0 0
ps 0x60820 395296
threadptr <unavailable>
br <unavailable>
scompare1 <unavailable>
acclo <unavailable>
acchi <unavailable>
m0 <unavailable>
m1 <unavailable>
m2 <unavailable>
m3 <unavailable>
expstate <unavailable>
f64r_lo <unavailable>
f64r_hi <unavailable>
f64s <unavailable>
fcr <unavailable>
fsr <unavailable>
a0 0x40085c38 1074289720
a1 0x3ffcd740 1073534784
a2 0x8 8
a3 0x1 1
a4 0x60023 393251
a5 0x3ffafd18 1073413400
a6 0x1 1
a7 0x0 0
a8 0x3ffb33d8 1073427416
a9 0x3ffcd720 1073534752
a10 0x0 0
a11 0x60820 395296
a12 0x60021 393249
a13 0x3ffafab0 1073412784
a14 0x3ffb0824 1073416228
a15 0x60720 395040

==================== CURRENT THREAD STACK =====================
#0 0x401284d8 in esp_vApplicationIdleHook () at /mnt/c/Users/rhys/esp32/EspruinoBuildTools/esp32/build/esp-idf/components/esp32/./freertos_hooks.c:52
#1 0x40085c38 in prvIdleTask (pvParameters=0x0) at /mnt/c/Users/rhys/esp32/EspruinoBuildTools/esp32/build/esp-idf/components/freertos/./tasks.c:3322

======================== THREADS INFO =========================
Id Target Id Frame
9 process 8 xQueueGenericReceive (xQueue=0x3ffae5bc, pvBuffer=0x0, xTicksToWait=4294967295, xJustPeeking=0) at /mnt/c/Users/rhys/esp32/EspruinoBuildTools/esp32/build/esp-idf/components/freertos/./queue.c:1452
8 process 7 xQueueGenericReceive (xQueue=0x3ffd6cd8, pvBuffer=0x3ffd82d0, xTicksToWait=4294967295, xJustPeeking=0) at /mnt/c/Users/rhys/esp32/EspruinoBuildTools/esp32/build/esp-idf/components/freertos/./queue.c:1452
7 process 6 xQueueGenericReceive (xQueue=0x3ffdd94c, pvBuffer=0x3ffde750, xTicksToWait=4294967295, xJustPeeking=0) at /mnt/c/Users/rhys/esp32/EspruinoBuildTools/esp32/build/esp-idf/components/freertos/./queue.c:1452
6 process 5 xQueueGenericReceive (xQueue=0x3ffd5828, pvBuffer=0x3ffd69c0, xTicksToWait=4294967295, xJustPeeking=0) at /mnt/c/Users/rhys/esp32/EspruinoBuildTools/esp32/build/esp-idf/components/freertos/./queue.c:1452
5 process 4 xQueueGenericReceive (xQueue=0x3ffdcc40, pvBuffer=0x3ffdd6b0, xTicksToWait=4294967295, xJustPeeking=0) at /mnt/c/Users/rhys/esp32/EspruinoBuildTools/esp32/build/esp-idf/components/freertos/./queue.c:1452
4 process 3 prvTimerTask (pvParameters=0x0) at /mnt/c/Users/rhys/esp32/EspruinoBuildTools/esp32/build/esp-idf/components/freertos/./timers.c:445
3 process 2 xQueueGenericReceive (xQueue=0x3ffce7b0, pvBuffer=0x3ffcf240, xTicksToWait=100, xJustPeeking=0) at /mnt/c/Users/rhys/esp32/EspruinoBuildTools/esp32/build/esp-idf/components/freertos/./queue.c:1452
2 process 1 xQueueGenericReceive (xQueue=0x3ffdfe38, pvBuffer=0x0, xTicksToWait=100, xJustPeeking=0) at /mnt/c/Users/rhys/esp32/EspruinoBuildTools/esp32/build/esp-idf/components/freertos/./queue.c:1452
* 1 <main task> 0x401284d8 in esp_vApplicationIdleHook () at /mnt/c/Users/rhys/esp32/EspruinoBuildTools/esp32/build/esp-idf/components/esp32/./freertos_hooks.c:52

======================= ALL MEMORY REGIONS ========================
Name Address Size Attrs
.rtc.text 0x400c0000 0x0 RW
.iram0.vectors 0x40080000 0x400 R XA
.iram0.text 0x40080400 0x14014 R XA
.dram0.data 0x3ffb0000 0x2614 RW A
.flash.rodata 0x3f400010 0x1e8b8 RW A
.flash.text 0x400d0018 0x95ad0 R XA
.coredump.tasks 0x3ffafd18 0x174 RW
.coredump.tasks 0x3ffcd680 0x164 RW
.coredump.tasks 0x3ffdfa44 0x174 RW
.coredump.tasks 0x3ffe0a30 0x248 RW
.coredump.tasks 0x3ffcf2e0 0x174 RW
.coredump.tasks 0x3ffcf0f0 0x1e4 RW
.coredump.tasks 0x3ffcdff8 0x174 RW
.coredump.tasks 0x3ffcde90 0x15c RW
.coredump.tasks 0x3ffdd750 0x174 RW
.coredump.tasks 0x3ffdd5b0 0x194 RW
.coredump.tasks 0x3ffd6a84 0x174 RW
.coredump.tasks 0x3ffd68c0 0x1b8 RW
.coredump.tasks 0x3ffde7f8 0x174 RW
.coredump.tasks 0x3ffde650 0x19c RW
.coredump.tasks 0x3ffd8374 0x174 RW
.coredump.tasks 0x3ffd81c0 0x1a8 RW
.coredump.tasks 0x3ffaea18 0x174 RW
.coredump.tasks 0x3ffae880 0x18c RW

===================== ESP32 CORE DUMP END =====================
```


freertos_hooks.c:52

```
50 if (doWait) {
51 //Wait for whatever interrupt comes next... this should save some power.
52 asm("waiti 0");
53 }
```
How does an asm instruction call abort?

Any help appreciated!

Who is online

Users browsing this forum: Google [Bot] and 145 guests