cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F446RET6R TWO CAN PERIPHERALS

Davaol19
Associate III

Hello!!

I'm trying to use both CAN peripherals in an STM32F446RET6R on a custom PCB, but something is not going well enough.

I've done the basic configuration using the STMCubeIDE platform (I'll add the code later, but first I want to know if someone has had similar issues with this microcontroller).

The problem is that if I only configure one peripheral, CAN1 (the Master), everything works okay—no error bits in SFRs, no BUSOFFs or anything like that, everything is transmitted and received well.

But when I configure CAN2 (SLAVE), CAN1 continues working perfectly, but CAN2 starts sending frames with CRC errors and corrupted data (I'm using CANoe to read the messages). The TEC bit starts incrementing until the node gets stopped.

The flags raised when the transmission stops are TEC, EPVF, and EWGF.

I also want to add that if I configure everything without a reception interrupt in CAN2, the transmission and reception in CAN1 and transmission in CAN2 work fine without any flags raised.

If anyone can help me with this topic, I’d appreciate it a lot. I've done similar configurations with other microcontrollers, and they worked well.

 

THANKS!!

 

 

1 REPLY 1
SofLit
ST Employee

Hello,

The issue is not well understood from my side and this statement is ambiguous:


I also want to add that if I configure everything without a reception interrupt in CAN2, the transmission and reception in CAN1 and transmission in CAN2 work fine without any flags raised.

 

 Could you please provide a sketch how you did connect CAN1, CAN2 and "CANoe" ?

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.