Hello.
I'm using µVision 5.27.1.0 with the default compiler (I assume MDK-ARM) on an LPC4078 project.
I would use one of the RTC GPREGs if only the VBAT pin was connected in the hardware. (Used to do it that way but the hardware changed. Variable name stayed.)
I'm afraid updating µVision is not an option I can choose.
I have modified my scatter file to contain:
RW_RAM1 0x20007FF0 UNINIT 0x00000010 { ; noinit data *(.bss.noinit)}
RW_RAM1 0x20007FF0 UNINIT 0x00000010 { ; noinit data
*(.bss.noinit)
}
And I place it in code with:
__attribute__ ((section (".bss.noinit"))) U_INT lpcRestartModeRegister;
According to the map file the variable is placed just where I want it:
lpcRestartModeRegister 0x20007ff0 Data 2 main.o(.bss.noinit)
So everything seems fine. But the variable is zero after a watchdog reset.
I have found https://community.arm.com/support-forums/f/keil-forum/54408/uninit-section-gets-zero-filled and tried to set an access areakpoint on the variable in the watch window as suggested but in the Command Window I get:
BS \\ic2Fe1p\main.c\lpcRestartModeRegister, 1*** error 129: target does not support conditional breakpoints
BS \\ic2Fe1p\main.c\lpcRestartModeRegister, 1
*** error 129: target does not support conditional breakpoints
What else can I try?
Thank you.
Garry