2026-05-24 7:15 AM
I designed a board with a layout that I was very happy with, but this meant remapping FDCAN1_TX to PC14, which CubeMX dutifully created code for...
However, the code wouldn't compile. I needed to get my board order in that day so I simply adjusted the pin arrangement and modified the layout, but it looks for all the world as though there are some missing defines. I say this because the datasheet quite clearly states this as a valid remapping.
Just thought I'd put this out there.
Maybe the fix is as simple as:-
#define GPIO_AF13_FDCAN1 13I may revisit this in the near future and I am aware there are some other remapping issues others have tripped up on. I guess it's because this is a relatively new part. It only came out in Feb 2025.
Does anybody else know anything about this issue?
Solved! Go to Solution.
2026-05-25 2:24 AM - edited 2026-05-25 3:31 AM
Hello @JennyDigital and thank you for raising that issue.
That doesn't seem to be an issue in CubeMx but rather a missing definition in the HAL.
CubeMx is just using HAL as is.
The current definitions on AF13 in stm32c0xx_hal_gpio_ex.h are as following:
/**
* @brief AF 13 selection
*/
#define GPIO_AF13_TIM14 ((uint8_t)0x0D) /*!< TIM14 Alternate Function mapping */
#define GPIO_AF13_TIM3 ((uint8_t)0x0D) /*!< TIM3 Alternate Function mapping */
Indeed GPIO_AF13_FDCAN1 is missing in the definition list.
I'll escalate the issue internally for check and fix.
Edit: after checking:
In the GitHub link, FDCAN1 AF13 is defined in line 259:
/**
* @brief AF 13 selection
*/
#define GPIO_AF13_TIM14 ((uint8_t)0x0D) /*!< TIM14 Alternate Function mapping */
#define GPIO_AF13_TIM3 ((uint8_t)0x0D) /*!< TIM3 Alternate Function mapping */
#if defined(FDCAN1)
#define GPIO_AF13_FDCAN1 ((uint8_t)0x0D) /*!< FDCAN1 Alternate Function mapping */
#endif /* FDCAN1 */
And I think there is a mismatch between Github and the C0 Cube (V1.4.0) zip file here.
Internal ticket: CDM0062895 to check the propagation of the fix in the zip file.
2026-05-24 12:19 PM
Updating CubeMX packages may eventually resolve everything automatically..
2026-05-24 12:46 PM
I agree, though there are literally thousands of STM32 parts, so I'll give them extra time before just fixing it myself. That's totally fair.
2026-05-25 2:24 AM - edited 2026-05-25 3:31 AM
Hello @JennyDigital and thank you for raising that issue.
That doesn't seem to be an issue in CubeMx but rather a missing definition in the HAL.
CubeMx is just using HAL as is.
The current definitions on AF13 in stm32c0xx_hal_gpio_ex.h are as following:
/**
* @brief AF 13 selection
*/
#define GPIO_AF13_TIM14 ((uint8_t)0x0D) /*!< TIM14 Alternate Function mapping */
#define GPIO_AF13_TIM3 ((uint8_t)0x0D) /*!< TIM3 Alternate Function mapping */
Indeed GPIO_AF13_FDCAN1 is missing in the definition list.
I'll escalate the issue internally for check and fix.
Edit: after checking:
In the GitHub link, FDCAN1 AF13 is defined in line 259:
/**
* @brief AF 13 selection
*/
#define GPIO_AF13_TIM14 ((uint8_t)0x0D) /*!< TIM14 Alternate Function mapping */
#define GPIO_AF13_TIM3 ((uint8_t)0x0D) /*!< TIM3 Alternate Function mapping */
#if defined(FDCAN1)
#define GPIO_AF13_FDCAN1 ((uint8_t)0x0D) /*!< FDCAN1 Alternate Function mapping */
#endif /* FDCAN1 */
And I think there is a mismatch between Github and the C0 Cube (V1.4.0) zip file here.
Internal ticket: CDM0062895 to check the propagation of the fix in the zip file.