Sorry for being "very educational"
(why not? No need to read if "you" do not like and do not have time).
The Arduino sketch Arduino hard reset you have mentioned - my comments on it:
-
Yes: you could use a GPIO, connected from MCU to reset signal on board: it will reset all, entire board, when SW sets this GPIO to 0 (Reset is usually low active).
-
But make sure, there is a need for a pull-up: when GPIO out is 0 and it forces a reset: the GPIO itself becomes floating (due to reset). But if no active pull-up - this external reset signal may stay at low level. And you never come out of reset again (or very flaky behavior).
-
The length of this reset low pulse depends on the (internal) reset timing of the MCU generating this GPIO reset signal. Problem is: some external chips on board might need a minimal reset pulse (where signals stays 0 for period of time). Chips differ a lot on this required Reset Pulse generation: some need a longer period, some a shorter.
Worst case is: the MCU setting this signal to 0 (for a System Reset) is so fast that the GPIO pin out of MCU becomes floating after the reset seen so fast. So, the pulse might be very short (the MCU resets itself very fast, also this GPIO output). Even possible that reset becomes floating and pull-up-ed to high so fast that even this period violates the MCU spec.
Especially other chips want to see much longer reset 0 period. Potentially, external chips are not properly reset (period too short, the "MCU reset timing" violates other chip requirements).
Also to think about how everybody would write the code for a ResetHandler:
Usually they assume: this ResetHandler code is called after and only a real HW reset, on power up (which is the same HW reset condition). So, all is reset, all internal stuff, e.g. devices, are in "reset default state", e.g. disabled, all cleared.
Some registers in devices (peripherals) are only possible to write when the device is in disabled (or reset default) state. So, you would not code to disable a device - you would assume after a reset the device is disabled: no need to "soft" reset or disable something.
So, your ResetHandler tries to initialize the device (again) and deviice has to be disabled (like after reset). But you do not care: you assume after a real reset it is disabled and all fine.
Your code tries to write to a register which becomes write-able just in disabled mode (after a real reset).
But when you call the same code, the ResetHandler, as a sub-function: this device was not reset. It is still enabled and active, even acting on data, interrupts coming in etc. So, the same code will fail: it cannot change a register because the device is still in use. Calling again ResetHandler as a function will will fail when there was not a real reset done.
You could assume the opposite: assume there was not a reset but I want to reconfigure all stuff again. Therefore, before I can do (in my code) - I had to "soft" reset, at least to disable a device I am touching. And you had to do on all "resources" you want to re-enable: you had to assume it was not reset, therefore disable, "soft reset" before re-configuring it again.
But imagine what an effort!: reset all manually before to configure again. A big difference because after a real reset it is not needed: you save a lot of steps and code. And just for the case that somebody calls the ResetHandler again? (who would do? would you test your code for this very rare condition?) I had to add so much code, to disable, to do a "soft" reset on the devices before I try to reconfigure those (again). Nobody would write such "reentrant" ResetHandler code when we assume: this code is just and always running after a real (core) reset, and only once.
So, potentially, I would state: "a ResetHandler is not reentrant. A ResetHandler cannot be called again just as a regular function. A ResetHandler has to be activated just and after a real RESET happened. Only a real Reset signal should activate the ResetHandler."
So, calling the ResetHandler again from FW, never mind where it is - does not make sense. The condition for what the code in reset handler was written - esp. assuming all is properly reset and disabled - makes it impossible to execute the same code again, from a running system. It would "violate" some "assumptions", e.g. that the devices are in "reset state" and "disabled". Potentially, on all systems, it will fail to call again ResetHandler (as a sub-function).
Doing a "core reset" means really to generate a HW reset signal (and this triggers to call the ResetHandler again, nothing else).
Just calling code does not do anything with HW signals, neither generating a reset signal "needed".
I would never try to call ResetHandler again: just look for the hooks if you can force a real HW reset. Most of the MCUs should have a mean to do so. If not: you need an external reset logic, driven by the MCU.
And even you would do just a "soft" FW reset (restart it) - bear in mind some actions needed, e.g.: "when and how is my SP register set?" If it is coded, an instruction there to set SP - fine. But if you rely on reset logic and you "assume" the SP is set by/after doing a reset - it is not "thread-safe", not "reentrant" when calling such code (not setting again the SP via instructions and you "eat up" on every "soft" reset the stack until it crashes).