Skip to main content
Visitor II
Oct 13, 2026 2:12 PM UTC
Question

STM32C542RCT6 CANFD is not working with internal clock

Hi,

I am working on CAN FD communication using the STM32C542RCT6. CAN FD is working properly when I use an external clock source. However, when I switch to the internal clock, the controller starts reporting errors such as Error Passive, followed by Bus-Off.

My suspicion is that the internal clock may have a slight frequency deviation, which could be affecting CAN FD communication. Since this is a new controller, I would like to understand whether the internal clock can reliably support CAN FD communication or whether an external clock is required.

My current CAN FD configuration is:

  • Arbitration bit rate: 500 kbps

  • Data bit rate: 2 Mbps

  • Bit Rate Switching (BRS): Enabled

Could you please clarify whether the internal clock can support this configuration and what could cause the controller to enter Error Passive and Bus-Off states when using it?

6 replies

Andrew Neil
Super User
Oct 13, 2026 2:16 PM UTC

when I switch to the internal clock, the controller starts reporting errors

That is to be expected:

 

My suspicion is that the internal clock may have a slight frequency deviation

So look at the datasheet - the accuracy will be specified there.

Then you can check if it meets CAN’s accuracy requirements ...

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
LCE
Principal III
Oct 13, 2026 4:00 PM UTC

The internal clock / HSI is only usable for basic operation and some “slow” or clocked interfaces.

For CAN, audio, ethernet and some other peripherals: never ever use HSI.

Ozone
Principal
Oct 14, 2026 9:09 AM UTC

First, I need to second that. HSI doesn’t work for CAN, amongst others.
 

> However, when I switch to the internal clock, the controller starts reporting errors such as Error Passive, followed by Bus-Off.

Which means the CAN peripheral receives all messages, but discards them as erraneous or corrupted.
Consequently it disconnects itself from the bus.

mƎALLEm
ST Technical Moderator
Oct 14, 2026 9:59 AM UTC

Hello ​@harishDST and welcome to the ST community,

From this interesting application note: AN6363 “Introduction to clock requirements and calibration for STM32 MCUs” / Table 3, the recommended accuracy for FDCAN needs to be  =< 0.65%:

So what clock are you using: HSI or PSI? So according to that application note, you must use either a crystal in direct or via PSI i.e:

Knowing that the HSI drift according to the datasheet is +/-1% (TJ = -20 to 130 °C):

You can also refer to the section 2.2 FDCAN from the same application note for more clock accuracy calculation details. (especially the section 2.2.2 Oscillator tolerance).

Hope that helps.

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.
LCE
Principal III
Oct 14, 2026 10:47 AM UTC

​@mƎALLEm  I don’t know the C5, as far as I understand the PSI can only be as good as its source (why called “reference”), so it should be made clearer that for a stable PSI a stable HSE is needed - or am I wrong ?

mƎALLEm
ST Technical Moderator
Oct 14, 2026 11:02 AM UTC

From the table 3, it was said “in direct or via PSI” :

That means need to use a crystal: either directly or over PSI. Crystal = stable and accurate clock source.

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