Closed rfx77 closed 3 years ago
Here is the same problem: https://github.com/sandeepmistry/arduino-LoRa/issues/224#issuecomment-771884658
@rfx77 What happens is, SPIClass::beginTransaction
function is invoked from an interrupt handler (you can see __onPinInterrupt
in the call stack). However this function doesn't support being called from an interrupt — it acquires a mutex using xSemaphoreTake function (hidden in SPI_MUTEX_LOCK macro):
https://github.com/espressif/arduino-esp32/blob/4b385690bc4171b75b398e57fb1a3be33c5980f4/cores/esp32/esp32-hal-spi.c#L714-L719
I don't know whether Arduino SPI API requires that beginTransaction works from ISRs. If yes, then this needs to be fixed in arduino-esp32 project, where SPIClass
is implemented.
I'm going to close this ticket as it doesn't seem to be an issue in ESP-IDF.
Probably you are doing some reading from LoRa in ISR function. I am recommending to use this library: https://github.com/StuartsProjects/SX12XX-LoRa
When i put the reading out of the ISR and do a polling in a seperate Tasks i get this error sometimes:
assertion in freertos "tasks.c:1438" when the delay(1) is called (see below) (with vTaskDelay )
This is my recieving-loop:
void receiveTask(void*) {
int ps = 0;
while (true) {
ps = LoRa.parsePacket();
if(ps) {
doRcv(ps);
}
delay(1);
}
}
I only do polling now without an ISR
@rfx77 Please decode the backtrace reported by the panic handler, it will help understand the cause of this assertion.
I do Lora with interrupt-receive. in the main loop i update a oled display. when i do not use a delay (to reproduce error) i get this stacktrace every minute or so when i use a delay it is not often but still happens.
With no delay the issue is reproduceable because it happens every minute or so. (see last line of code)
here is my code:
My Board is a T-Beam with Lora. I use PlatformIO
Originally posted by @rfx77 in https://github.com/espressif/arduino-esp32/issues/4580#issuecomment-771850378