Author Topic: PSA: ESP32 CAN Frequency Assignment Broken in Chip Revision..........  (Read 1310 times)

0 Members and 1 Guest are viewing this topic.

Offline SmokeyTopic starter

  • Super Contributor
  • ***
  • Posts: 3290
  • Country: us
  • Not An Expert
Been wrestling with getting CAN working on "ESP32-WROOM-32E".  Turns out they made a silicon revision that changes the way you set the CANBUS frequency that broke the existing drivers.  I found a board with the older hardware revision chip and it just works with the existing library and frequency assignment where the new revisions don't.

There has been an open pull request to fix this in the library since 2021 but it hasn't been merged yet.  wtf?
https://github.com/sandeepmistry/arduino-CAN/pull/71

....... So if your CANBUS is hooked up correctly but just refuses to work, try doubling the assigned value for the frequency (ie. If you want 500kb, set it to 1000kb).

 

Offline liaifat85

  • Regular Contributor
  • *
  • !
  • Posts: 172
  • Country: bd
 

Offline SmokeyTopic starter

  • Super Contributor
  • ***
  • Posts: 3290
  • Country: us
  • Not An Expert
Re: PSA: ESP32 CAN Frequency Assignment Broken in Chip Revision..........
« Reply #2 on: September 14, 2023, 08:56:53 am »
I think you can ask this to the ESP32 forum: https://www.esp32.com/viewforum.php?f=23&sid=983fcc53b91be6ea1b3fd85e384ffd8f

It's not really a question.. it's a public service announcement.  Doing my civic duty and all that...
 

Offline ace1903

  • Regular Contributor
  • *
  • Posts: 243
  • Country: mk
Re: PSA: ESP32 CAN Frequency Assignment Broken in Chip Revision..........
« Reply #3 on: September 14, 2023, 11:14:09 am »
Thanks for the info.
Not so long ago I made one hobby project with can bus and ESP32 using Arduino.
It worked well because it was very simple application, to show on led display number received from CAN(DRO for milling machine).
But if messages arrived faster that I can process them I saw garbage data.
I was suppressed that I was not able to find information for CAN FIFO size inside ESP32.
Also I was expecting some messages to be lost not to get garbage.
I know that Arduino libraries are not highest quality but want to know your experience about communication stability with ESP32?
What software stack are you using on ESP32?
 

Offline SmokeyTopic starter

  • Super Contributor
  • ***
  • Posts: 3290
  • Country: us
  • Not An Expert
Re: PSA: ESP32 CAN Frequency Assignment Broken in Chip Revision..........
« Reply #4 on: September 14, 2023, 07:06:05 pm »
I'm using Arduino stuff in this case.

You should check the errata.  There are like 7 or 8 entries for the canbus, which they call TWAI.  Some sound like what you are describing.

https://www.espressif.com/sites/default/files/documentation/esp32_errata_en.pdf
« Last Edit: September 14, 2023, 08:06:08 pm by Smokey »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf