missing CAN3 defines when using can on F413 Topic is solved

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

missing CAN3 defines when using can on F413  Topic is solved

Postby hybridA » Mon Aug 08, 2022 5:00 am

Noticed what I believe to be a bug/missing implementation when trying to build for F413, using CAN.
Tested on github master (8/7/2022)
demos/STM32/RT-STM32F413ZH-NUCLEO144

Changed halconf.h to use CAN:

Code: Select all

#define HAL_USE_CAN                         TRUE

and mcuconf.h to enable all 3 CAN devices:

Code: Select all

#define STM32_CAN_USE_CAN1                  TRUE
#define STM32_CAN_USE_CAN2                  TRUE
#define STM32_CAN_USE_CAN3                  TRUE


compile fails with multiple defines needed for CAN3:

This error appears, even if STM32_CAN_USE_CAN3 is set to FALSE:

Code: Select all

 #error "STM32_CAN3_MAX_FILTERS not defined in registry"


These missing defines/declarations appear when STM32_CAN_USE_CAN3 is set to TRUE:

Code: Select all

../../../os/hal/ports/STM32/LLD/CANv1/hal_can_lld.c:104:5: warning: implicit declaration of function 'rccEnableCAN3'; did you mean 'rccEnableCAN2'? [-Wimplicit-function-declaration]
  104 |     rccEnableCAN3(true);

../../../os/hal/ports/STM32/LLD/CANv1/hal_can_lld.c:185:5: warning: implicit declaration of function 'rccDisableCAN3'; did you mean 'rccDisableCAN1'? [-Wimplicit-function-declaration]
  185 |     rccDisableCAN3();

../../../os/hal/ports/STM32/LLD/CANv1/hal_can_lld.c:536:2: error: #error "STM32_CAN3_TX_HANDLER not defined"
  536 | #error "STM32_CAN3_TX_HANDLER not defined"
      |  ^~~~~
../../../os/hal/ports/STM32/LLD/CANv1/hal_can_lld.c:539:2: error: #error "STM32_CAN3_RX0_HANDLER not defined"
  539 | #error "STM32_CAN3_RX0_HANDLER not defined"
      |  ^~~~~
../../../os/hal/ports/STM32/LLD/CANv1/hal_can_lld.c:542:2: error: #error "STM32_CAN3_RX1_HANDLER not defined"
  542 | #error "STM32_CAN3_RX1_HANDLER not defined"
      |  ^~~~~
../../../os/hal/ports/STM32/LLD/CANv1/hal_can_lld.c:545:2: error: #error "STM32_CAN3_SCE_HANDLER not defined"
  545 | #error "STM32_CAN3_SCE_HANDLER not defined"

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

Re: missing CAN3 defines when using can on F413

Postby hybridA » Sun Sep 04, 2022 5:41 pm

Is there a work-around/fix for this?
Happy to pay for it.

Thanks

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

Re: missing CAN3 defines when using can on F413

Postby Giovanni » Sun Sep 04, 2022 6:18 pm

Hi,

No need to pay, it will be fixed in next release. I'll do a fixes pass on next week, there several other reports waiting too.

Giovanni

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

Re: missing CAN3 defines when using can on F413

Postby Giovanni » Thu Sep 08, 2022 7:33 am

Hi,

Fixed as bug #1233.

The fix is in trunk repository currently, CAN compiles but not tested, there just were few missing definitions.

Giovanni

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

Re: missing CAN3 defines when using can on F413

Postby hybridA » Sat Sep 24, 2022 5:38 am

Thank you Giovanni. Much appreciated! I will be able to test it very soon and report back.


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 14 guests