For some time I've been using this to correctly reset device to "boardloader" (first execution stage, we have two additional, bootloader and firmware, each in separate ELF file):
Display All
It worked quite well, though for some reason it doesn't anymore (currently Ozone 3.20c). The code jumps at the right address, but it gets stuck on TRNG initialization (STM32F427VI).
However when resetting from JLinkExe via SYSRESETREQ & VECTRESET bit (or GDB connected to JLink GDB server), it always works.
Any way how to put this kind of reset into Ozone script?
Source Code
- void AfterTargetReset (void) {
- unsigned int SP;
- unsigned int PC;
- unsigned int VectorTableAddr;
- VectorTableAddr = 0x8000000; //boardloader vector address
- if (VectorTableAddr != 0xFFFFFFFF) {
- SP = Target.ReadU32(VectorTableAddr);
- Target.SetReg("SP", SP);
- } else {
- Util.Log("Project file error: failed to get program base");
- }
- PC = Target.ReadU32(VectorTableAddr + 4);
- Target.SetReg("PC", PC);
- }
It worked quite well, though for some reason it doesn't anymore (currently Ozone 3.20c). The code jumps at the right address, but it gets stuck on TRNG initialization (STM32F427VI).
However when resetting from JLinkExe via SYSRESETREQ & VECTRESET bit (or GDB connected to JLink GDB server), it always works.
Any way how to put this kind of reset into Ozone script?