Skip to content

Linking issue with FDCAN on STM32G0B1CBTx #2474

Closed Answered by fpistm
0x0fe asked this question in Q&A
Discussion options

You must be logged in to vote

first, need to force #define HAL_FDCAN_MODULE_ENABLED in stm32yyxx_hal.conf, declaring it in the usercode prior to includes
doesnt work.

No you don't have to change the stm32yyxx_hal.conf, you can use the build_opt.h or hal_conf_extra.h. As the core does not provide (FD)CAN support it is disabled so up to end user to properly enable it.
See: https://github.com/stm32duino/Arduino_Core_STM32/wiki/HAL-configuration#customize-hal-or-variant-definition

Then need to declare these two pointers Into the usercode, to satisfy the external references of hardwaretimer.cpp

FDCAN_HandleTypeDef *phfdcan1;
FDCAN_HandleTypeDef *phfdcan2;

Then i can compile without linking error.

Right, it is to allow…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@fpistm
Comment options

Answer selected by fpistm
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #2473 on August 10, 2024 10:14.