Allow configuration of FDCAN_CKDIV register on STM32G4xx Topic is solved

Report here problems in any of ChibiOS components. This forum is NOT for support.
preisi
Posts: 3
Joined: Mon Sep 27, 2021 2:48 pm
Has thanked: 2 times

Allow configuration of FDCAN_CKDIV register on STM32G4xx  Topic is solved

Postby preisi » Sun Apr 02, 2023 1:09 pm

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
Attachments
STM32G4_FDCAN_CKDIV.zip
(988 Bytes) Downloaded 130 times

User avatar
Giovanni
Site Admin
Posts: 14457
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: Allow configuration of FDCAN_CKDIV register on STM32G4xx

Postby Giovanni » Tue Jun 20, 2023 10:01 am

Hi,

Committed.

Giovanni


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 56 guests