2025-11-06 6:03 AM - last edited on 2025-11-06 6:32 AM by mƎALLEm
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,
2025-11-06 6:19 AM
@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?
@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.
2025-11-06 7:01 AM
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
| ^~
2025-11-06 8:40 AM - edited 2025-11-06 8:46 AM
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;