2024-06-23 10:38 PM - last edited on 2024-06-24 01:46 AM by SofLit
Greetings to all,
I want to send and receive the data via CAN between STM32F4 and STM32f0. But when I send the data from STM32F4 to STM32F0 I cannot get the interrupt at F0 end. I have tried to communicate between F0 and F0 that works fine I can receive the interrupt and send the data. Also when communicating between F4 and F4 that also works. But when communicating between F4 and F0 I cannnot get the receive interrupt at F0 end. Below are the configurations of F0.
I am unable to understand why do I cannot get the interrupt.
2024-06-24 01:52 AM
Hello @schou ,
You need to provide more than that as information.
Need to share the two projects of F4 and F0 including their ioc files.
Are you sure about the bitrate i.e. the two MCUs having the same CAN bitrate?
What is the system clock source of F4 and F0?
2024-06-24 06:18 AM
2024-06-24 06:38 AM - edited 2024-06-24 06:39 AM
Hello,
Cheking your ioc files, I noticed that from F0 side you selected HSI48 as a clock source for the system clock which is not recommended for CAN communication. You need to use HSE with an external precise clock source such as a crystal (like you did for F4).
Which board you are using for STM32F042? NUCLEO-F042K6?
2024-06-24 04:07 PM
The STM32F042/STM32F072 were designed to work with the HSI 48MHz oscillator. Looking at an old CAN analyzer project of mine for the CANable device using an STM32F042, change your clock settings to 48MHz instead of 42MHz.
2024-06-25 02:00 AM - edited 2024-06-25 02:00 AM
The STM32F042/STM32F072 were designed to work with the HSI 48MHz oscillator. Looking at an old CAN analyzer project of mine for the CANable device using an STM32F042
Yes they are designed to work with HSI but it doesn't imply it's the correct source of the CAN peripheral. If it's working for some reasons this doesn't imply we can generalize it. ST doesn't recommend this configuration as the frequency of the RC sources maybe impacted by temperature/voltage/reflow effects/ mechanical effects etc.. therefore impacts the performance of the communication.
2024-06-25 04:34 AM
2024-06-25 04:40 AM
Now I don't seen any issue in the ioc file.
Could you please hare your schematics of both F4 and F0? and how you did connect both nodes on the bus?
2024-06-25 04:42 AM
Remains one point to check, from F0 side could you please set PA11 (CAN_RX) in No pull-up/pull-down?
2024-06-25 05:09 AM
Have changed the clock settings to 48 MHz. But still the same.