Open Kunaalkk1 opened 1 year ago
Hi @Kunaalkk1 ,
The issue you proposed is basically a interrupt watchdog triggered. And seeing from your log the issue is a bit critical: the ISR which catches the issue can't be even executed. So the hardware directly resets the system.
Before we can effectively handle the issue, we need to find out which module causes the problem. There is a feature to show the PC of each core when the system resets: https://github.com/espressif/esp-idf/blob/master/components/bootloader_support/src/esp32/bootloader_esp32.c#L122.
But unfortunately it hasn't been displayed in your log. I guess it's because you have set BOOTLOADER_LOG_LEVEL to very low. Could you adjust that and provide more log?
We need:
@ginkgm I have disabled the watchdog timer in make menuconfig. This problem is coming after that.
Also, the watchdog timer does not reset the esp32, it only interrupts the processor.
As you can see in my Debug Logs section, there is no backtrace generated before the system crashes, so there is no point in sharing the elf.
Further, VS Code has set the BOOTLOADER_LOG_LEVEL as per its default. In fact, ALL parameters of SDK Config are default.
Anyway, I did some debugging. When I commented out line from my code: uart_flush(UART_NUM_0)
this issue was resolved. There has to be some issue in this function, please check it out.
BUT MY OVERALL PROBLEM IS NOT SOLVED.
I have a CAN Tool to send data from CAN and it is converting it to UART and writing my UART frames correctly.
However, when I send data from UART, I convert it to twai_message_t
and transmit it to CAN.
esp_err_t ret = twai_transmit(&msg, 10 / portTICK_PERIOD_MS);
if(ret != ESP_OK)
{
gpio_set_level(LED_BUILTIN, GPIO_LEVEL_HIGH);
}
The above code is supposed to turn on the LED when the message transmission fails, which is exactly what is happening.
Since the exact same code I am using has been tested and verified as OK, I do not believe that it is a problem with the firmware. However, I will try to print the id, DLC, and data to see if there is some mistake in that.
Please check my BOARD CONFIG and DRIVER CONFIG that I have enclosed in the first message above.
Regards, Kunaal
Answers checklist.
IDF version.
v4.4
Operating System used.
Windows
How did you build your project?
VS Code IDE
If you are using Windows, please specify command line type.
CMD
Development Kit.
ESP32 Dev Module (via USB Bridge)
Power Supply used.
USB
What is the expected behavior?
My code was working perfectly as expected for two whole days, and on the third day of the test, the microcontroller resets unexpectedly.
It doesn't show any backtrace, or any verbose error via ESP_LOG. It just resets every few seconds.
What is the actual behavior?
For the past two days, it has been working perfectly, at its actual behavior.
The drivers I used are:
Following is my board configuration:
Following are my driver configurations:
Steps to reproduce.
I am writing firmware to convert UART to CAN data and vice versa.
Debug Logs.
NOTE: You'll see some bizarre characters such as "–@DD“@”@•@òöô" which is nothing but CAN data converted into UART. But there is no backtrace or verbose output that can tell why or when the error came. Also note that it only resets when UART communication is on.
More Information.
I tried it on two devices. For the first two days, both devices were working perfectly, for the third day, both have same problem. @espressif-abhikroy @espressif-bot @Espressif-liuuuu @espressif-zhanghu @esp-cjh @Esp-Doc @ESP-iPENCIL @esp-jiangguangming @esp-lis If anyone can please help?
Thanks in advance.
Regards, Kunaal