cancel
Showing results for 
Search instead for 
Did you mean: 

STM32C092FCP6 FDCAN remapping issue.

JennyDigital
Associate II

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 13

I 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?

1 ACCEPTED SOLUTION

Accepted Solutions
mƎALLEm
ST Employee

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.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

View solution in original post

3 REPLIES 3
loveforcircuits
Associate III

Updating CubeMX packages may eventually resolve everything automatically.. 

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.

mƎALLEm
ST Employee

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.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.