cancel
Showing results for 
Search instead for 
Did you mean: 

Using both CAN1 & CAN2 both in STM32F446RC

MG.5
Associate II

Hi, I want to use both CAN1 and CAN2 for my application with 500kbps and 125kbps speeds respectively. I have initialized both of them as per my requirements using HAL. Where in Tx is implemented in polling and Rx in interrupts. CAN1 Tx and Rx working perfect. Coming to CAN2 Tx is working and Rx is not working. Interrupt itself is not firing up for CAN2 Rx (HAL_CAN_RxFifo0MsgPendingCallback is not being called). I've read in datasheet that some SRAM sharing process is happening between 2 CANs. I'm unable to comprehend that. Is that an issue?

I'm attaching the code also. Please check and help!

10 REPLIES 10

@Parvez Akhtar

If you want to use CAN2, you have to enable CAN1 clock even if it will be not used. CAN1 APB clock should be enabled since CAN1 instance is a master from peripheral integration point of view and it manages the filtering part. 

Regarding the filtering management between CAN1 and CAN2, I invite you to have a look at this thread:

https://community.st.com/s/question/0D73W000000bHEESA2/detail?fromEmail=1&s1oid=00Db0000000YtG6&s1nid=0DB0X000000DYbd&s1uid=0050X000007vx9R&s1ext=0&emkind=chatterCommentNotification&emtm=1685418050174

Hope it helps.

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.