-
Notifications
You must be signed in to change notification settings - Fork 7.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
esp32 hangs in intr_alloc.c ( portEXIT_CRITICAL(&spinlock); ) (IDF-188) #1981
Comments
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
|
Ok, found some more info on this, perhaps the issue or problem - please can someone test?! Spent this morning, completely installing the latest IDF, Arduino , everything new. If CONFIG_LOG_DEFAULT_LEVEL is set to NONE then there is no hanging. as soon as CONFIG_LOG_DEFAULT_LEVEL is set to VERBOSE the esp32 will hang and freeze about 20% of the time as per the above log output. Any ideas? Thanks |
@PhilColbert I couldn't reproduce the issue with latest IDF when using Arduino as a component. Could you please attach your sdkconfig file? Thanks. |
Thanks for the reply, hope its not something I am doing wrong, but its suddenly started with the new IDF code. Try reseting it a few times, sometimes its one in 10 or less.... but it does hang :( Standard SDK from one of the examples. #include <Arduino.h> #include "esp_log.h" HardwareSerial GPSSerial(2); void setup() } void loop()
} I have tried on heltec, ttgo and doit esp boards and the same. |
Hi @PhilColbert I see from the log you have provided that you might be using a different sketch from the one you have provided in the first post. The log indicates that your code is using UART2 (interrupt source 36) but the code actually refers to UART1 (in the HardwareSerial constructor). Can you please check what the actual code is? FWIW, even with your attached sdkconfig I couldn't reproduced the issue after 40 or so resets. |
It does the same on UART1 or 2, so does not matter which. Thanks for trying - not sure how to proceed from here then , i will just have to run without Logs for now. Just noticed that sdk I had set the log back to no log output, that was the one that worked in the end, sorry about that, really busy day ! That sdkconfig file will work as theres no logging. Attached is the sdkconfig file that doesnt work ( Verbose Logging ) Heres the log output - rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
And then press the reset button and it works - rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) code is #include "esp_log.h" HardwareSerial GPSSerial(2); void setup() } void loop()
if ( millis()>3000) |
Do you have anything connected to UART2 (or UART1) when the issue happens? I.e. is there any data coming in? If you disconnect the thing that sends data, do you still observe the issue? |
Hi, I thought I had tested it with and without a GPS attached, but seems I didnt do this properly. If the GPS isnt connected then it works fine, no hangs, but when theres a gps connected it hangs randomly, something to do with data in the buffer perhaps , tried 2 different gps units and its the same. Dont worry I can set logs to off and it works ok now :) Thanks |
That makes things slightly more clear @PhilColbert. I think this may be a genuine issue. The hint that we need to feed some data into UART will probably help us reproduce this! |
Thanks for testing, sorry for not giving you better description at the start. Where I found the hang is detailed in the first post if that helps. Doesnt happen on serial 0 however. I have a project where theres probably 200 people using esp32 to use as a flying instrument and this hasnt happened before I added the new codebase. Thanks |
Hi @PhilColbert,
Basically, what could be happening is the following series of events.
Could you please try adding the following to your #include "driver/periph_ctrl.h"
void setup()
{
periph_module_reset(PERIPH_UART2_MODULE);
} |
This commit prevents infinite restarts caused due to an interrupt flag was left uncleared. Closes: #1981 Closes: IDF-188
This commit prevents infinite restarts caused due to an interrupt flag was left uncleared. Closes: #1981 Closes: IDF-188
This commit prevents infinite restarts caused due to an interrupt flag was left uncleared. Closes: #1981 Closes: IDF-188
This commit prevents infinite restarts caused due to an interrupt flag was left uncleared. Closes: #1981 Closes: IDF-188
After installing the new espidf and arduino component, Serial 1 ( serial 2 ) randomly hangs on boot.
I have traced it to the last portEXIT_CRITICAL(&spinlock); call in function esp_err_t esp_intr_alloc_intrstatus in intr_alloc.c
80% of the time this works, 20% of the time the system just stops and hangs there.
There is a gps currently attached to the port and continuously feeding serial data into it if thats relevant.
Any ideas ?
Just a very simple program hangs 20% of the time., I know this is arduino but it hangs in the espidf code.
#include <Arduino.h>
#include "esp_log.h"
HardwareSerial GPSSerial(1);
void setup()
{
esp_log_level_set("*", ESP_LOG_VERBOSE);
Serial.begin(115200);
Serial.println("start");
GPSSerial.begin(9600, (uint32_t) SERIAL_8N1,33,(int8_t) 22);
}
void loop()
{
delay(1000);
Serial.println("running");
}
I have tried different setups, with and without the GPS attached and it randomly stops at the same place.
this never happened with the older ESPIDF code.
v3.1-dev-439-g37765d00-dirty - no hangs
v3.1-dev-858-gf885e8b8-dirty - hanging.
The text was updated successfully, but these errors were encountered: