2024-08-19 11:52 AM
Hello folks,
Anyone knows the default CAN clock frequency on STM32H753 MCU when powered on, assuming the CAN bit timing register (CAN_BTR) was not set by FW during the initialization?
If this value would be a random, could it be changed depending on reflow temperature?
Best,
2024-08-19 01:45 PM
Short answer: 500 kbit/sec
The default register values are shown in the reference manual. In this case.
The reference manual does this math for you:
Note that the FDCAN is disabled after reset and the firmware will need to enable it. Programs typically set the timing at this time.
Also note there is no CAN_BTR register on this chip. At least, I can't find it and it's not showing up in a search.
2024-08-19 01:50 PM - edited 2024-08-19 01:51 PM
Hi,
Afaik there is no default can frequency, it depends on what you set or what you want.
That's the result from the clock for the can module and the bit timing you set -> making the can bit rate.
What your version of Cuba is doing, if you set/change nothing...just try, to find out.
2024-08-19 03:05 PM
Thanks. Without setting this register, CAN communication was working mostly and sometimes it didn't work. I wonder where this difference is coming from. If the default value is 0A33 which makes 500kbps, it makes sense as I see it. However, sometimes it does not communicate whatever reason. Is this because FDCAN was not enabled after power cycle? Also, if we do soft reset (not hard power cycle), would the previous register value will be retained?
Will be great if you can share your experience. Trying to solve this puzzle. This behavior seems to be random to me.
2024-08-19 03:07 PM
Thanks AScha.3. Does this mean not setting up the value would never work?
2024-08-19 03:21 PM - edited 2024-08-19 03:21 PM
It's a software bug, you need to look at the code and debug and not guess at solutions. We're not going to be able to solve it here (at least not without seeing the code), it's specific to your code. When your code is "not communicating", debug, look at register values, see where cpu execution is at, etc, to determine the root cause.
Register values are not retained after a soft reset. They are reset to their reset values (except for some things like RTC).
2024-08-19 04:45 PM
Thanks TDK. Yes, it's a bug but want to see any risk associated with it.