Mbed 5.15 broke CAN?

A simple CAN application writing a single message on CAN bus on STM32L43x fails. The write fails and the controller apparently keeps retrying the write (the CAN analyser I have on the other end of the bus quickly reports 128 RX errors and goes to Error Passive state).

The same test works fine on Mbed OS 5.13.4 and 5.14.2 at least, but consistently fails on 5.15.0, 5.15.2 and 5.15.3. Tested with STM32L432KC Nucleo and STM32L431KB custom board.

Hi there,
I tried the CAN BUS on latest MbedOS and it seems be OK.

My connection:

  • Nucleo-L432KC write a message with a simple counter to CAN BUS every 100ms
  • 2x 120ohm terminators
  • 2x MCP2551 as CAN transceivers
  • Nucleo-F767ZI as receiver of these messages
  • rderror tderror are zero on both sides.

Can you share code what you tried?

BR, Jan

Hi! Thanks! Sorry I didn’t keep the exact code, but can reproduce a failing scenario easily if needed - I tried several variations of basically just initiating a CAN object (PA_11, PA_12, speed) where speed varied from 50000 to 250000, constructing a CANMessage and sending it with the CAN object’s .write(). Various delays etc., never got a single message sent until I tried switching to an older mbed OS version and there everything worked right away.

One detail from the code is that I need to use CANExtended format with long message IDs, all attempts were done using that. The Nucleo board setup uses a TI 65HVD251 transceiver, not sure about what the custom board has, but functioning was identical. Receiving end is a Microchip CAN bus analyzer connected to a PC.

Hi again,

I tied it on 500000hz, with a message every 100ms and a random extended ID 530563210. Still no errors.

BR, Jan

Hi! Thanks for testing, so not about the extended IDs at least. Are both your devices running mbed 5.15? Would it be easy to send from mbed 5.15 device and receive with something else, maybe running an older mbed on the other device (if you don’t happen to have a CAN analyzer or something)?

Cheers,
Jussi

Both boards are on the latest MbedOS version, but it was also tested on 5.15.1 . I have no usable analyzer at home.

BR, Jan