Board:S32K144 EVB,IDE:S32 DS
I want to realize that , for example, the variable "Currentsession" is shared between Bootloader and Application, the Currentsession is a "ennum: 0, 1, 2", the init value is 0. When the Currentsession is changed to 2 in the App, then "reset" command, the program return to Bootloader and read the value of Currentsession (it is equal to 2). Only when the program restarts due to power on and power off, the Currentsession can be inited. Other "reset"(such as watchdog, reset command) can't make the variable Currentsession change.
Problem 1: How to set the value "Currentsession" is shared between Bootloader and Application, can you give me a demo?
Problem 2: How to realize the variable "Currentsession" to be persistent which meets the above requirements. In the past, I use resenus chip, othes use the "#pragma location ="CURRENTSESSION"" to meet the requirements, as far as I am concerned.