Skip to main content
guo qiang
Senior
May 25, 2023
Question

STM32H725 FDCAN:A CAN bus fault is caused when the FDCAN is Stoped

  • May 25, 2023
  • 2 replies
  • 3255 views

One VCU controller A, one USBCAN converter B, one my H7 device C.

A is sending, B and C are receiving. When C Stop FDCAN, both A and B report a bus failure.


_legacyfs_online_stmicro_images_0693W00000bkovMQAQ.png

One VCU controller A, two USBCAN converters B1 and B2, . A is transmitting, B1 and B2 are receiving. When B1 stops FDCAN, A and B2 are fine and do not report bus errors

USBCAN converters(B,B1,B2) are known to be a standard product and have passed the certification of many testing bodies.

So I think my H7 device caused a bus failure when it stopped FDCAN.

my code:

HAL_FDCAN_Stop(&hcan1);

​Transceiver:MCP25612FD

CANFD configuration:

Classic CAN, 500K

This topic has been closed for replies.

2 replies

LCE
Principal II
May 25, 2023

Sorry I cannot help... but I'm curious:

what happens if you do not call HAL_FDCAN_Stop(), but:

  • remove the CAN cable from the H7
  • power down the H7 board

?

And do the other devices recover from bus errors?

guo qiang
guo qiangAuthor
Senior
May 25, 2023
  • remove the CAN cable from the H7
  • power down the H7 board

-->other device not report can bus errors.

LCE
Principal II
May 25, 2023

Okay, that's bad.

Then the HAL CAN driver is doing something which it should not do.

Maybe check the RM again what's happening when HAL_FDCAN_Stop() is called, bit by bit.

LCE
Principal II
May 25, 2023

Although it would be a kind of workaround, maybe before calling HAL_FDCAN_Stop() you could reset the CAN GPIOs to take it off the bus.

Before that check the idle state of the CAN TX pin and set the GPIO accordingly, unless there's a pull resistor.