Page 1 of 2

spi and rtos panics

Posted: Thu Mar 30, 2017 11:05 am
by danny@cs.huji.ac.il
Hi,
I am developing for an ESP32-wroom (i have 2 dev boards, one from Adafruit, and one fro Doit)
I have so far managed to write code that connects to an access point, and listens
to my commands, mainly OTA update, which works.
So now I'm trying the SPI stuff, and as soon as I start a transaction it panics:
Guru Meditation Error: Core 0 panic'ed (Interrupt wdt timeout on CPU1)

on the Saleae I see that the CS is lowered, but no clock, nothing.

I'm using the latest esp-idf (rc2?)

danny

Re: spi and rtos panics

Posted: Thu Mar 30, 2017 3:57 pm
by ESP_Sprite
What code do you use to set up & start the spi transaction?

Re: spi and rtos panics

Posted: Fri Mar 31, 2017 5:25 am
by danny@cs.huji.ac.il
the code is work-in-progress, but the last message printed is the one just before the
begining of the transfer.

thanks,
danny
PS: why is plain text not acceptable as attachment?

Re: spi and rtos panics

Posted: Fri Mar 31, 2017 8:19 am
by ESP_Sprite
You're doing an ESP_LOGI from the pre-transfer callback, which is executed in interrupt context. ESP_LOGI calls printf, which can't be used in interrupt context. Use ESP_EARLY_LOGI instead.

Re: spi and rtos panics

Posted: Fri Mar 31, 2017 11:53 am
by danny@cs.huji.ac.il
I only added the print out of frustration, It panics without it too.

even if the callback is null.

danny

Re: spi and rtos panics

Posted: Sat Apr 01, 2017 4:54 am
by ESP_Sprite
Hmm . Any chance you could get us a backtrace of where the error happens?

Re: spi and rtos panics

Posted: Sat Apr 01, 2017 7:51 am
by danny@cs.huji.ac.il
sure:
Guru Meditation Error: Core 0 panic'ed (Interrupt wdt timeout on CPU1)
Register dump:
PC : 0x400d1b0c PS : 0x00060b34 A0 : 0x80084118 A1 : 0x3ffb9fd0
A2 : 0x00000008 A3 : 0x00000001 A4 : 0x00060623 A5 : 0x3ffba088
A6 : 0x00000001 A7 : 0x00000001 A8 : 0x3ffb25d0 A9 : 0x3ffb9fb0
A10 : 0x00000000 A11 : 0x00060b20 A12 : 0x80084f2d A13 : 0x3ffbe6d0
A14 : 0x00000003 A15 : 0x00060d23 SAR : 0x00000000 EXCCAUSE: 0x00000006
EXCVADDR: 0x00000000 LBEG : 0x00000000 LEND : 0x00000000 LCOUNT : 0x00000000

Backtrace: 0x400d1b0c:0x3ffb9fd0 0x40084118:0x3ffb9ff0

Rebooting...


xtensa-esp32-elf-addr2line -pfia -e build/mfrc.elf 0x400d1b0c:0x3ffb9fd0
0x400d1b0c: esp_vApplicationIdleHook at /vol/src/esp/esp-idf/components/esp32/./freertos_hooks.c:52
esp32> xtensa-esp32-elf-addr2line -pfia -e build/mfrc.elf 0x40084118:0x3ffb9ff0
0x40084118: prvIdleTask at /vol/src/esp/esp-idf/components/freertos/./tasks.c:3424

Re: spi and rtos panics

Posted: Sat Apr 01, 2017 8:59 am
by WiFive
Does msdelay use vtaskdelay? Probably want bigger stack size.

Re: spi and rtos panics

Posted: Sat Apr 01, 2017 10:33 am
by danny@cs.huji.ac.il
any particular one? I increased (doubled) the ISR in freeRTOS, and one in esp32 specific main stack stack size

but it's still panics

thanks,
danny

Re: spi and rtos panics

Posted: Tue Apr 04, 2017 6:01 am
by danny@cs.huji.ac.il
problem solved!
increased task stack size in xTaskCreate

thanks!!!

danny