You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have had issues with a few devices failing to recover from bus off state. I located the cause to be the absence of CONFIG_TWAI_ERRATA_FIX_BUS_OFF_REC set in the Arduino framework. I spent quite a bit of time converting over to ESP-IDF to allow the extra flexibility of setting various sdkconfig (tools/sdk/esp32/sdkconfig) options. I copied the latest arduino sdkconfig to get started but when I went to change the TWAI errata options I found they were already set. I thought I was losing my mind as I had checked before and they were not set. I went back through the commits and found "ESP-IDF v4.4.2 and build time elf2bin for the bootloaders (#7259)".
I see that 4 errata fixes were enabled in that commit without any mention of them in release notes or issues. I am happy they are changed, I think it's the right thing, however, I have some questions.
Was there a particular reason these were just set now in this commit?
Are these options going to stay set, can I rely on them or is they going to change in the future.
Is there a way that I can verify these options are set at compile time to warn me incase I miss checking the source of each update.
#
# TWAI configuration
#
# CONFIG_TWAI_ISR_IN_IRAM is not set
CONFIG_TWAI_ERRATA_FIX_BUS_OFF_REC=y
CONFIG_TWAI_ERRATA_FIX_TX_INTR_LOST=y
CONFIG_TWAI_ERRATA_FIX_RX_FRAME_INVALID=y
CONFIG_TWAI_ERRATA_FIX_RX_FIFO_CORRUPT=y
# end of TWAI configuration
Sketch
N/A
Debug Message
N/A
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
I confirm I have checked existing issues, online documentation and Troubleshooting guide.
The text was updated successfully, but these errors were encountered:
It should be safe to assume these are enabled by default going forward, however, you can also add checks for these being defined in your code using something like:
#include "sdkconfig.h"
#if !defined(CONFIG_TWAI_ERRATA_FIX_BUS_OFF_REC) || ...
#error CONFIG_TWAI_ERRATA_FIX_BUS_OFF_REC is required to be enabled....
#endif
This way you have a build time failure if these options ever change from what you expect.
Ahh, this is why I was not able to find it. I did figure out how to add a check, just wasn't sure if platformio was finding the correct sdkconfig.h as it was prebuilt, thanks!
Board
ESP32-WROOM-32E/ESP32-DevkitC
Device Description
Custom PCB or Dev Module.
Hardware Configuration
CAN Bus transceiver connected to pins 4 and 5.
Version
v2.0.5
IDE Name
PlatformIO
Operating System
macOS 12.0.1
Flash frequency
80Mhz
PSRAM enabled
yes
Upload speed
921600
Description
I have had issues with a few devices failing to recover from bus off state. I located the cause to be the absence of CONFIG_TWAI_ERRATA_FIX_BUS_OFF_REC set in the Arduino framework. I spent quite a bit of time converting over to ESP-IDF to allow the extra flexibility of setting various sdkconfig (tools/sdk/esp32/sdkconfig) options. I copied the latest arduino sdkconfig to get started but when I went to change the TWAI errata options I found they were already set. I thought I was losing my mind as I had checked before and they were not set. I went back through the commits and found "ESP-IDF v4.4.2 and build time elf2bin for the bootloaders (#7259)".
I see that 4 errata fixes were enabled in that commit without any mention of them in release notes or issues. I am happy they are changed, I think it's the right thing, however, I have some questions.
Was there a particular reason these were just set now in this commit?
Are these options going to stay set, can I rely on them or is they going to change in the future.
Is there a way that I can verify these options are set at compile time to warn me incase I miss checking the source of each update.
Thanks!
The sdkconfig commit in question: https://github.com/espressif/arduino-es ... d333cd4bb7
Sketch
Debug Message
Other Steps to Reproduce
No response
I have checked existing issues, online documentation and the Troubleshooting Guide
The text was updated successfully, but these errors were encountered: