Hi Experts,
I want to read the SYSESR register to UART in main.
However SYSESR only shows the debugger flag in main when code if first uploaded, all other reset senarios i have tried (Power cycle - POR, and NRST button - EXRST) set the registers to all 0s.
I believe _memInit_(); resets any registers in RAM so SYSESR maybe overwitten in HL_sys_startup.c in the case statement. And copying the registers to a variable does not work as it gets overwritten to 0s.
I have tried copying the SYSESR reg before the "rstSrc = getResetSource();" call and passing it as a global variable to main. Copying the SYSESR to a variable gets overwritten in RAM.
I have also tried using GPREG1 which is a General Purpose Register, which works, does not get over written and outputs to main. However this seems to be a register for another purpose as seen in the Reference Manual. Would i be allowed to use this register to store the SYSESR values?
Regards,
Abdullah