cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 MCU CAN clock register default value

fourhes
Associate II

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,

6 REPLIES 6
TDK
Guru

Short answer: 500 kbit/sec

The default register values are shown in the reference manual. In this case.

TDK_1-1724100247423.png

The reference manual does this math for you:

TDK_0-1724100187352.png

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.

If you feel a post has answered your question, please click "Accept as Solution".
AScha.3
Chief II

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.

If you feel a post has answered your question, please click "Accept as Solution".

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.

Thanks AScha.3. Does this mean not setting up the value would never work?

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).

If you feel a post has answered your question, please click "Accept as Solution".

Thanks TDK. Yes, it's a bug but want to see any risk associated with it.