2 years, 2 months ago.

Reset target fail while CAN Bus connected


I am currently using CAN Bus with STM32 F446 RE

There is an other device on the bus broadcast CAN messages at 100 Hz600 Hz

The issue occur if I reset STM32 with BUS connected, a message on UART:

can ESR 0x0000.0000 + timeout status 0

appear and LED keep on blinking with specific pattern.

This will not occur if i reset the target with BUS unconnected.

I assume this as a problem with current mbed CAN Bus library, this issue occur back to Ver. 145

For earlier version although the UART message & LED keep silence, the acknowledge function will fail.

I'm looking for solution for this problem, the only method I use now is manually disconnect BUS to STM32 before power up.

The code I use is show as following:


#include "mbed.h" // Revision 166

CAN can2(D4, D10);

int main(){

1 Answer

2 years, 1 month ago.

I try to remove the frequency change command from main() and try to set it at the declare stage.

This method work fine.


#include "mbed.h" // Revision 166
CAN can2(D4, D10, 1000000); //Set frequency at declaration
int main(){
    //can2.frequency(1000000); //Avoid changing frequency when working

Accepted Answer

Assigned to SHENG-HEN HSIEH 2 years, 1 month ago.

This means that the question has been accepted and is being worked on.