2026-04-16 6:06 AM
I am using STM32C071FBP6N MCU TSSOP 20 pin package for one of our project.
I am observing Pin_20 is muxed with lot of other pins like PB3/PB4/PB5/PB6. if i select PB3 as GPIO_Output using STM32CubeMx and generated a code. If i try to toggle the pin but its not working at all, none of the peripheral on that pin for PB3 is working. But if i select PB6 as GPIO_Output i can able to toggle or modify.
This issue is not only with Pin_20, same with Pin_1 also which shares with PB7/PB8, only PB7 is working.
I have tried with multiple chips what could be wrong in this scenario??
Solved! Go to Solution.
2026-04-16 7:17 AM - edited 2026-04-16 7:23 AM
Hello @Sumanth_Veeyes
By checking the Firmware , you need to call the following HAL function
* @brief Set Pin Binding
* @param pin_binding specifies which pin will bind a specific GPIO
* for each die package
* This parameter can be a value of @ref HAL_BIND_CFG
* @retval None
*/
void HAL_SYSCFG_SetPinBinding(uint32_t pin_binding)
{
/* Check the parameter */
assert_param(IS_HAL_SYSCFG_PINBINDING(pin_binding));
LL_SYSCFG_ConfigPinMux(pin_binding);
}
in your case : the parameter will be
#define HAL_BIND_TSSOP20_PIN20_PB3 LL_PINMUX_TSSOP20_PIN20_PB3 /*!< STM32C071 TSSOP20 package, Pin20 assigned to GPIO PB3 */
So add this call in your code
uint32_t pin_binding = HAL_BIND_TSSOP20_PIN20_PB3;
HAL_SYSCFG_SetPinBinding(pin_binding );
I will be waiting for your feedback.
THX
Ghofrane
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.
2026-04-16 6:10 AM
Hello @Sumanth_Veeyes
Could you please provide your IOC in order to check your configuration and code .
I will be waiting for your feedback.
THX
Ghofrane
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.
2026-04-16 6:18 AM
CubeMX assumes SECURE_MUXING_EN = 0 when it generates code, which is not the default.
Solved: STM32C092FCP6 SPI, SCK Pin remapping by CubeMX - STMicroelectronics Community
You can only use one muxed pin at a time if SECURE_MUXING_EN is enabled. Probably the settings in SYSCFG_CFGR3 are not being set up correctly by CubeMX. PB3 and PB7 are enabled by default which explains why they are working.
2026-04-16 6:22 AM
2026-04-16 6:59 AM
Without using CubeMX how can i hardcode SYS_CFG3 to use PB3??
2026-04-16 7:17 AM - edited 2026-04-16 7:23 AM
Hello @Sumanth_Veeyes
By checking the Firmware , you need to call the following HAL function
* @brief Set Pin Binding
* @param pin_binding specifies which pin will bind a specific GPIO
* for each die package
* This parameter can be a value of @ref HAL_BIND_CFG
* @retval None
*/
void HAL_SYSCFG_SetPinBinding(uint32_t pin_binding)
{
/* Check the parameter */
assert_param(IS_HAL_SYSCFG_PINBINDING(pin_binding));
LL_SYSCFG_ConfigPinMux(pin_binding);
}
in your case : the parameter will be
#define HAL_BIND_TSSOP20_PIN20_PB3 LL_PINMUX_TSSOP20_PIN20_PB3 /*!< STM32C071 TSSOP20 package, Pin20 assigned to GPIO PB3 */
So add this call in your code
uint32_t pin_binding = HAL_BIND_TSSOP20_PIN20_PB3;
HAL_SYSCFG_SetPinBinding(pin_binding );
I will be waiting for your feedback.
THX
Ghofrane
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.
2026-04-16 10:30 PM
Thank you Ghofrane,
for quick reply and helping in resolving the issue!!.
2026-04-17 6:23 AM
Hello @Sumanth_Veeyes @TDK
I have created ticket #0061882 to address the missing pin binding configuration generation in CubeMX.
Thank you all for your cooperation.
THX
Ghofrane
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.