2024-01-09 11:15 AM - edited 2024-01-09 11:16 AM
Hi,
I started working on STM32C011J4.
Systick, PWM, ADC, GPIO works just fine. Set pin4 to NRST_MODE 2 via STM32CubeProgrammer (v2.15.0) as GPIO.
MCU gets stuck at reset if pin4 is low at power on reset. After applying 1.4V or higher to it momentarily (even leaving it floating), MCU starts running and pin4 acts as GPIO, no reset functionality until next power cycle.
Any thoughts?
Thanks,
Tim
Solved! Go to Solution.
2024-01-10 12:24 AM
Unfortunately, you have fallen into a trap, RM0490, section 5.1.2 mentions the reason under Fig 8:
Caution:Upon power reset or wakeup from shutdown mode, the NRST pin is configured as Reset input/output and driven low by the system until it is reconfigured to the expected mode when the option bytes are loaded, in the fourth clock cycle after the end of tRSTTEMPO time (see datasheet).
Regards
/Peter
2024-01-10 12:24 AM
Unfortunately, you have fallen into a trap, RM0490, section 5.1.2 mentions the reason under Fig 8:
Caution:Upon power reset or wakeup from shutdown mode, the NRST pin is configured as Reset input/output and driven low by the system until it is reconfigured to the expected mode when the option bytes are loaded, in the fourth clock cycle after the end of tRSTTEMPO time (see datasheet).
Regards
/Peter
2024-01-10 01:09 AM
Hello,
You must ensure that, upon power-on, the level on the NRST pin can exceed the minimum VIH(NRST)
level specified in datasheet. Otherwise, the device does not exit the power-on
reset. This applies to any NRST configuration set through the NRST_MODE[1:0] bitfield, the GPIO mode
inclusive.
Best regards,
Simon
2024-01-10 01:35 AM
Thank you Simon,
Explains a lot more than the reference manual
Kind regards,
Tim
2024-01-10 02:19 AM
This text will be added on the next Reference Manual and Datasheet document revision.
2024-01-10 02:53 AM
Will help a lot. Would be a disaster for me to find it out after mass production for example
2024-04-11 01:03 AM
Hi
Given that the maximum internal pullup resistance for the NRST is 55k, and if you want to use it as a dedicated input, than you need a minimum series resistance of 124k (to meet 0.7VCC) - is this correct?
Kind regards
Pedro
2024-04-11 11:21 AM
No, that is not correct. For the function of the pin on which NRST is also available, you should read RM0490, section 5.1.2. According to this, you have one of three functions on the STM32C011 pin:
You will only find the internal NRST pull-up on the pin if it is also configured as NRST, i.e. either Reset Input/Output or Reset Input. If the pin is configured as a GPIO, it has the usual individually configurable and optional pull resistors for GPIOs.
Regards
/Peter
2024-04-11 05:06 PM
Thank you for your reply.
RM0490 says that the NRST pin is a RESET I/O pin for the first 4 clock cycles...
Tests here have concluded that the clock cycles DON'T advance while the NRST is held low, even with the Option Bytes set the NRST as a GPIO...
I have to allow the NRST to go high before the device will operate.
STM32CubeProgrammer complains that the device is held in a Reset state.
I put a 120k resistor in series - all good... Luckily, in my case, this resistor won't affect the application.
Kind regards
Pedro