Page 1 of 1

Allow configuration of FDCAN_CKDIV register on STM32G4xx

Posted: Sun Apr 02, 2023 1:09 pm
by preisi
Hey,

as of now, FDCANv1 already allows basic functionality on STM32G4xx. However, it is not yet possible to configure the global CKDIV register which is required to change the clock divider for the FDCAN-peripheral. Said CKDIV register can only be written as part of the FDCAN1 interface configuration.
After previous consultation with you, I've written a small patch, allowing for static configuration of aforementioned CKDIV register inside can_lld_init() and added appropriate checks as part of the configuration options, etc.

The patch itself already runs on my system, but there are a few points that could be improved upon depending on your liking:

  • Add defines for all possible values of the CKDIV's PDIV field (32 defines in total)
  • Autoenable FDCAN1 instead of only checking whether it's enabled

If you want me to, I'll gladly change anything.

Best regards,
preisi

Re: Allow configuration of FDCAN_CKDIV register on STM32G4xx

Posted: Tue Jun 20, 2023 10:01 am
by Giovanni
Hi,

Committed.

Giovanni