Skip to main content
Visitor II
April 17, 2024
Solved

STM32C011 unable to configure PF2 nRST as GPIO and multiplex to PA0

  • April 17, 2024
  • 2 replies
  • 2304 views

Hi everyone,

Recently started working on STM32C011J4M3.

I'm trying to set PF2-NRST pin as a GPIO and I want Pin 4  to multiplexed  to PA0 USART TX pin.

At first i tried  multiplexed the Pin 4 to PA0  using the following API                        " LL_SYSCFG_ConfigPinMux(LL_PINMUX_SO8_PIN4_PA0);"  but this didn't work  and to mention that this API function worked  on Pin 1 and Pin 5.

I came across this post  to  set PF2-NRST pin as a GPIO  and change the Pin 4 to PA0 thinking that  multiplex is only done with GPIO Ports.

I tried above code to set the NOT_RESET_INPUT_ONLY bit and clear the NOT_GPIO_MODE_ONLY bit of the FLASH option bytes  this works in Registers but to my surprise  the Pin 4 still works as PF2-NRST pin  and not as GPIO.

Debugging works as always and when i remove the Pin4 connection  from debugger  I receive  console message as "Target is not responding, retrying..."

I conclude that this message show that still the Pin 4 is set as  PF2-NRST pin even though  the NOT_GPIO_MODE_ONLY bit is cleared .

I'm really confused plz check the attachment and  help me out . 

    This topic has been closed for replies.
    Best answer by Yuvaraj

    I have report my answer in the following Link 

     

    2 replies

    YuvarajAuthorAnswer
    Visitor II
    April 23, 2024

    I have report my answer in the following Link 

     

    ST Employee
    April 23, 2024

    Hello,

    if I understand to your problem right, you want to use Pin 4 on SO8N package as PA0. So you should configure pin PA0 in standard way and disable reset pin PF2-NRST which is enabled by default. The easiest way how to do it is to download STM32CubeProgrammer STM32CubeProg - STM32CubeProgrammer software for all STM32 - STMicroelectronics and disable reset pin there.

    Open STM32CubeProgrammer connect your MCU to computer through ST-LINK, UART or USB and press green Connect button. Than go to Option bytes and select User Configuration, there configure NRST_MODE as 2 which disables reset pin. At the end press Apply to download this update to MCU.

    CubeProgrammer.png

    If you configure PF2-NRST pin like this, reset will be enabled only immediately after MCU power is turned on and than reset will be disabled and you can use this pin as standard GPIO. Due to there shouldn´t be connected low logic level signal to Pin 4 when the power of MCU is turned on. If there will be connected low logic level MCU still in reset state.