cancel
Showing results for 
Search instead for 
Did you mean: 

FDCAN->CKDIV vs FDCAN_CONFIG->CKDIV

Uwe Bonnes
Principal III

rm0456 describes CKDIV belonging to the FDCAN register structure, However the actual header in the cmsis_device_u5 repo make it a member of the FDCAN_Config_TypeDef. This is missleading!

 

Probably FDCAN_Config_TypeDef. is some structure found in the MCAN IP. There is no description of FDCAN_Config in the reference manual. A description is welcome,

3 REPLIES 3
Andrew Neil
Super User

@Uwe Bonnes wrote:

rm0456 describes CKDIV belonging to the FDCAN register structure, However the actual header in the cmsis_device_u5 repo make it a member of the FDCAN_Config_TypeDef. This is missleading!,


Is it?

The RM calls it "FDCAN CFG Clock Divider" - so FDCAN_Config_TypeDef doesn't seem an unreasonable name?

AndrewNeil_0-1762438490346.png

https://www.st.com/resource/en/reference_manual/rm0456-stm32u5-series-armbased-32bit-mcus-stmicroelectronics.pdf#page=3082

 


@Uwe Bonnes wrote:

Probably FDCAN_Config_TypeDef. is some structure found in the MCAN IP. ,


Use your IDE's 'Go To Definition' feature to find it.

 


@Uwe Bonnes wrote:

There is no description of FDCAN_Config in the reference manual. 


Well, the RM describes the hardware - not the software.

 

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.

From 70.4.37, it could be expected that FDCAN1 -> CKDIV resolves against the device header. But it does not resolve:

...

#include <stm32u355xx.h>

...

FDCAN1 -> CKDIV = 0xa;

> arm-none_eabi_gcc ...

/devel/stm32u5_fdcan/lv2_splitter_u535/../fdcan.c:378:12: error: 'FDCAN_GlobalTypeDef' has no member named 'CKDIV'
378 | FDCAN1 -> CKDIV = 0xa; //divide by 20
       |                ^~

 

mƎALLEm
ST Employee

Hello,

I didn't find any definition called FDCAN_Config_TypeDef in the HAL.

Referring to the HAL implementation (HAL_FDCAN_Init()/stm32u5xx_hal_fdcan.c), this is what I can see:

  /* Configure Clock divider */
  FDCAN_CONFIG->CKDIV = hfdcan->Init.ClockDivider;

 

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.