Hi.
I have a problem HW-resetting an external HW-circuit on my PCB (my MCU is STM32F107):
Because the POWER to my HW-circuits arrives later that to my MCU, I need to (re-) generate a delayed RESET-signal from my MCU towards the RESET-pin of the external HW-circuits.
Q-1: Is there a ”RESET-instruction” (assembly code) that I could use to generate this (common) RESET signal?
Q-2: Is there a way (assembly code) to detect the “reset cause” to avoid repeating (indefinitely) this reset-sequence (the RESET must be done only once)?
Q-3: Or is there an alternative way of achieving this (without modifying the HW by using a GPIO)?
Best Regards
Terje Bøhler
Thanks Vanhealsing.
Yes, I can use GPIO, but then we must modify our HW which we try to avoid. So:
In short:
Other MCUs I have been working with included an assembly instructions named "RESET" (or similar).
By executing this instruction, the MCU turn its NRST pin to an output-pin, and generates a low NRST/RESET signal (to reset all devices connected to this common RESET/NRST bus). I think It also would reset the MCU itself.
Next, when the MCU is (re-) started, the MCU could execute another assembly instruction which detects the "cause of reset". In that way we could distinguish a "power-on-reset" from a "MCU-forced-reset" (caused by this assembly instruction).
Are there two similar assembly instruction for ARM Cortex-M3 as described in 1 and 2 above?
Terje Bohler
Hi there,
The Cortex-M3 processor itself does not have any instruction to trigger nRST pin directly. Since different chips have different reset circuits, different reset sources (e.g. different types of watchdog, brown out detector), these type of reset control and reset reporting mechanism has to be defined by chip designer (i.e. ST in your case).
The architectural feature to allow software to generate reset is SYSRESETREQ (System Reset Request). In C programming you can use CMSIS-CORE function NVIC_SystemReset(). This reset the microcontroller system, but does not trigger nRST unless ST add additional feature at chip level to support this.
regards,
Joseph
Thank you Joseph.
So, a smal HW-mod is required (I must use a GPIO pin for the job) ...
Best RegardsTerje Bohler