FDCAN with STM32H735

Report here problems in any of ChibiOS components. This forum is NOT for support.
hybridA
Posts: 37
Joined: Wed Jan 12, 2022 7:15 am
Has thanked: 10 times
Been thanked: 5 times

FDCAN with STM32H735

Postby hybridA » Tue Jul 18, 2023 3:52 am

Started porting our F4 application to H7 and found that CAN wasn't happy:

stable_21.11.x, as of today.
RT-STM32H735IG-DISCOVERY demo

halconf.h:

Code: Select all

#define HAL_USE_CAN                         TRUE


mcuconf.h:

Code: Select all

#define STM32_CAN_USE_FDCAN1                TRUE
#define STM32_CAN_USE_FDCAN2                TRUE

Code: Select all

../../../os/hal/ports/STM32/LLD/FDCANv1/hal_can_lld.c: In function 'can_lld_start':
../../../os/hal/ports/STM32/LLD/FDCANv1/hal_can_lld.c:309:16: error: 'FDCAN_GlobalTypeDef' has no member named 'RXGFC'; did you mean 'GFC'?
  309 |   canp->fdcan->RXGFC  = canp->config->RXGFC;
      |                ^~~~~
      |                GFC
make: *** [../../../os/common/startup/ARMCMx/compilers/GCC/mk/rules.mk:193: build/obj/hal_can_lld.o] Error 1
make: *** Waiting for unfinished jobs....

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

Re: FDCAN with STM32H735

Postby Giovanni » Tue Jul 18, 2023 7:53 am

Hi,

H7 has a different FDCAN apparently, that would require creation of a FDCANv2 driver.

Giovanni

hybridA
Posts: 37
Joined: Wed Jan 12, 2022 7:15 am
Has thanked: 10 times
Been thanked: 5 times

Re: FDCAN with STM32H735

Postby hybridA » Wed Jul 19, 2023 4:11 am

Is this planned already or would this be a new implementation? Since this is pretty critical for us I don't mind paying for it. Also, the H735 has 3x CAN. Thank you

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

Re: FDCAN with STM32H735

Postby Giovanni » Wed Jul 19, 2023 7:32 am

Hi,

It is not planned yet, just on the "to-do" list. Probably it is not very different from the G4 implementation.

Giovanni

User avatar
alex31
Posts: 394
Joined: Fri May 25, 2012 10:23 am
Location: toulouse, france
Has thanked: 41 times
Been thanked: 68 times
Contact:

Re: FDCAN with STM32H735

Postby alex31 » Fri Apr 26, 2024 2:02 pm

Hello, any news on this front ?

FDCANv1 is the G4 FDCAN ?

Will take a look of the respective register maps of FDCAN G4 and FDCAN H7

Alexandre

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

Re: FDCAN with STM32H735

Postby Giovanni » Fri Apr 26, 2024 3:46 pm

Hi,

An implementation will be added soon, some testing will be appreciated.

Giovanni

User avatar
alex31
Posts: 394
Joined: Fri May 25, 2012 10:23 am
Location: toulouse, france
Has thanked: 41 times
Been thanked: 68 times
Contact:

Re: FDCAN with STM32H735

Postby alex31 » Mon Apr 29, 2024 6:48 am

No problem for the testing, thanks.

Saw that the compile problem is just for one line that copy user provided value in a register, for the H7, the register name and fields are different, will try a a stupid fix with some conditionnal compilation directive to see if the actual driver work on H7 and will report here my finding.

Alexandre

User avatar
Edoardo1982
Posts: 13
Joined: Thu Aug 03, 2017 8:39 am
Has thanked: 4 times
Been thanked: 8 times

Re: FDCAN with STM32H735

Postby Edoardo1982 » Mon Apr 29, 2024 8:59 am

alex31 wrote:No problem for the testing, thanks.

Saw that the compile problem is just for one line that copy user provided value in a register, for the H7, the register name and fields are different, will try a a stupid fix with some conditionnal compilation directive to see if the actual driver work on H7 and will report here my finding.

Alexandre


I am testing the fix for H7 CAN. I will release it in the coming days.

User avatar
alex31
Posts: 394
Joined: Fri May 25, 2012 10:23 am
Location: toulouse, france
Has thanked: 41 times
Been thanked: 68 times
Contact:

Re: FDCAN with STM32H735

Postby alex31 » Mon Apr 29, 2024 9:36 am

I am testing the fix for H7 CAN. I will release it in the coming days.


Nice !
If you have some example code for FDCAN, that would also be handy since there is no testhal example right now

Alexandre

User avatar
Edoardo1982
Posts: 13
Joined: Thu Aug 03, 2017 8:39 am
Has thanked: 4 times
Been thanked: 8 times

Re: FDCAN with STM32H735

Postby Edoardo1982 » Mon May 13, 2024 12:31 pm

alex31 wrote:
I am testing the fix for H7 CAN. I will release it in the coming days.


Nice !
If you have some example code for FDCAN, that would also be handy since there is no testhal example right now

Alexandre


I committed the FDCANv2 driver for STM32H7 to both trunk and branch 21.11.x. Additionally, I added a sample demo using events. It's also possible to receive directly using the canReceive function with TIME_INFINITE.

For any further information, please contact me.

Edoardo


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 43 guests