CANbus / CAN Peripheral RX issue, not receiving messages



  • I have been using the CAN bus library mostly without issue. It definitely has not fully matured but overall has the core needs.

    Right now I have a device that is not much more than 100 lines of code, running in a continues loop, that receives a message and then rebroadcast it on a different address in a slightly different format. It basically translates between two devices.

    When I have had it run for longer periods of time (1-3 weeks) it often stops working as expected. After working on some debugging and adding a default message if no others are received, so that I can at least see the Wipy module send messages even if it is not receiving them. What I observed is that when the "issue" happened, the device would continue to send the default message, but the software appeared to not be reading any new messages.

    The loop essentially has no delay and besides reading the message, and sending a new one, does nothing else besides some basic counters.

    This does not seem typical to CAN "BUS PASSIVE" and "BUS OFF" states when there is faults/errors.

    I see the need to get RX/TX buffer counts, and the several different ERROR register flags and counts visible to the CAN peripheral library. Also the need for a proper CAN reset and reinit capability would be needed.

    I worked with Damien at Micropython to add some improvements to their STM32 CAN library, which includes the items I am talking about. I know that all CAN peripherals are not created equal and some features might not be the same.
    https://docs.micropython.org/en/latest/pyboard/library/pyb.CAN.html

    Some things to note is I do use the library supplied software filters, if this has any effect on potential bugs or long running issues.


 

Hello World?

Pylife on Kickstarter - November 2018








Back Us On Kickstarter >

Pycom on Twitter