Hi,
Can driver on ESP32 from master branch stop transmitting after running for few minutes. Rx CAN driver still gets triggered and working.
In Debug build. It works. any idea?
Can driver stop transmitting after a while in release
Re: Can driver stop transmitting after a while in release
Can you try the following:
- Have a task periodically call can_get_status_info() and print the values of can_status_info_t before and after the CAN driver stops transmitting.
- When initializing your CAN driver, enable the alerts that indicate some form of error (e.g. CAN_ALERT_ERR_PASS). The various alerts that occur better indicate what's going on with the CAN controller.
Re: Can driver stop transmitting after a while in release
ok, thanks. we are investigating. we will try out your suggestion as well.ESP_Dazz wrote: ↑Fri Mar 08, 2019 7:03 amCan you try the following:
- Have a task periodically call can_get_status_info() and print the values of can_status_info_t before and after the CAN driver stops transmitting.
- When initializing your CAN driver, enable the alerts that indicate some form of error (e.g. CAN_ALERT_ERR_PASS). The various alerts that occur better indicate what's going on with the CAN controller.
Re: Can driver stop transmitting after a while in release
Should I use
CONFIG_FREERTOS_CORETIMER_0=y
or
CONFIG_FREERTOS_CORETIMER_1=
for Can driver.
CONFIG_FREERTOS_CORETIMER_0=y
or
CONFIG_FREERTOS_CORETIMER_1=
for Can driver.
Re: Can driver stop transmitting after a while in release
Not entirely sure how this relates to CAN driver. CONFIG_FREERTOS_CORETIMER selects which timer to use to generate the tick interrupt for FreeRTOS, thus affects the entire operating system not just the CAN driver. I would recommend you use FREERTOS_CORETIMER_0 as tick interrupts should be of the lowest priority. This will allow other interrupts of higher priority (such as various driver interrupts) to be handled first.
Re: Can driver stop transmitting after a while in release
Thanks for reply.ESP_Dazz wrote: ↑Thu Mar 14, 2019 6:49 amNot entirely sure how this relates to CAN driver. CONFIG_FREERTOS_CORETIMER selects which timer to use to generate the tick interrupt for FreeRTOS, thus affects the entire operating system not just the CAN driver. I would recommend you use FREERTOS_CORETIMER_0 as tick interrupts should be of the lowest priority. This will allow other interrupts of higher priority (such as various driver interrupts) to be handled first.
Yes not related. Sorry misunderstanding. I found later.
OK, Sys Tick of FreeRTOS as low prioirty make sense. as we are using Can driver Interrupt.
Just a though. how do we write in custom interrupt handler. Any example code.
I need interrupt handler to keep checking brownout using GPIO pin level checking. ESP32 brown detection is too late for our use case.
Re: Can driver stop transmitting after a while in release
To allocate a GPIO interrupt, have a look at the GPIO example or the interrupt allocation API reference.snahmad75 wrote: Just a though. how do we write in custom interrupt handler. Any example code.
I need interrupt handler to keep checking brownout using GPIO pin level checking. ESP32 brown detection is too late for our use case.
How are you planning to detect brownout using GPIO? Are you planning to use an external brownout detector?
Re: Can driver stop transmitting after a while in release
This is an old post but in case it helps..
CAN will stop transmitting if it detects a bus error and goes into bus off state.
Common reasons are loose cables and/or that you place two of your own devices on the CAN bus and have forgotten to change the source address.
To recover you must close and reopen the device. I found that this was quite a lengthy process on the ESP.
CAN will stop transmitting if it detects a bus error and goes into bus off state.
Common reasons are loose cables and/or that you place two of your own devices on the CAN bus and have forgotten to change the source address.
To recover you must close and reopen the device. I found that this was quite a lengthy process on the ESP.
& I also believe that IDF CAN should be fixed.
Who is online
Users browsing this forum: No registered users and 121 guests