Closed 0x0fe closed 3 months ago
so, it seems the problem boils down to what i mentioned, however when trying to make a quick and dirty fix I ended up with another linking issue:
So what i did was to add
#define HAL_FDCAN_MODULE_ENABLED
in
stm32yyxx_hal_conf.h
and now i can see the object file for hal_fdcan.c
"C:\\Users\\xxxxxxx\\AppData\\Local\\Arduino15\\packages\\STMicroelectronics\\hardware\\stm32\\2.8.1\\libraries\\SrcWrapper\\src\\HAL\\stm32yyxx_hal_fdcan.c" -o "C:\\Users\\xxxxxxx\\AppData\\Local\\Temp\\arduino\\sketches\\7D345039B4813D6501D07371AD0DC887\\libraries\\SrcWrapper\\HAL\\stm32yyxx_hal_fdcan.c.o"
However i get a new linking issue related to the IRQ handler
C:/Users/xxxxxxx/AppData/Local/Arduino15/packages/STMicroelectronics/tools/xpack-arm-none-eabi-gcc/13.2.1-1.1/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\xxxxxxx\AppData\Local\Temp\arduino\sketches\7D345039B4813D6501D07371AD0DC887\libraries\SrcWrapper\HardwareTimer.cpp.o: in function `TIM16_FDCAN_IT0_IRQHandler':
HardwareTimer.cpp:(.text.TIM16_FDCAN_IT0_IRQHandler+0x40): undefined reference to `phfdcan1'
C:/Users/xxxxxxx/AppData/Local/Arduino15/packages/STMicroelectronics/tools/xpack-arm-none-eabi-gcc/13.2.1-1.1/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld.exe: HardwareTimer.cpp:(.text.TIM16_FDCAN_IT0_IRQHandler+0x48): undefined reference to `phfdcan2'
C:/Users/xxxxxxx/AppData/Local/Arduino15/packages/STMicroelectronics/tools/xpack-arm-none-eabi-gcc/13.2.1-1.1/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\xxxxxxx\AppData\Local\Temp\arduino\sketches\7D345039B4813D6501D07371AD0DC887\libraries\SrcWrapper\HardwareTimer.cpp.o: in function `TIM17_FDCAN_IT1_IRQHandler':
HardwareTimer.cpp:(.text.TIM17_FDCAN_IT1_IRQHandler+0x40): undefined reference to `phfdcan1'
C:/Users/xxxxxxx/AppData/Local/Arduino15/packages/STMicroelectronics/tools/xpack-arm-none-eabi-gcc/13.2.1-1.1/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld.exe: HardwareTimer.cpp:(.text.TIM17_FDCAN_IT1_IRQHandler+0x48): undefined reference to `phfdcan2'
collect2.exe: error: ld returned 1 exit status
Using library SrcWrapper at version 1.0.1 in folder: C:\Users\xxxxxxx\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.8.1\libraries\SrcWrapper
exit status 1
Compilation error: exit status 1
So, i need to use FDCAN on STM32G0B1CBTx target, since there is no wrapper i will directly access via the HAL APIs, however there seems to be some issue with scrwrapper, while i can see the HEL FDCAN sources are compiled, it cannot link with the functions from FDCAN, here is the error:
and here is a sketch to reproduce the issue :
I tried to set the HAL includes as extern C but it did not help. How to fix this issue?
I suspect there is some issue with srcwrapper since i can see:
And below, i can see an object file for hal_can but none for hal_fdcan
Using previously compiled file: C:\Users\xxxxxxx\AppData\Local\Temp\arduino\sketches\FA0B4FB95CC62D998AFD8E0B0B49444E\libraries\SrcWrapper\HAL\stm32yyxx_hal_can.c.o
I do not understand, provided that STM32G0B1 does not have any hal_can.c file, it only has hal_fdcan.c
https://github.com/stm32duino/Arduino_Core_STM32/tree/main/system/Drivers/STM32G0xx_HAL_Driver/Src