2024-04-16 09:50 PM - last edited on 2024-04-17 01:56 AM by Mike_ST
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 .
Solved! Go to Solution.
2024-04-23 01:39 AM
2024-04-23 01:39 AM
I have report my answer in the following Link
2024-04-23 02:50 AM
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.
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.
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.