*******************************************************************************
The purpose of this demo application is to use pad keeping for PINS and enter the standby mode & before entering the standby mode update variables in Standby RAM memory with pin state. Once wake up from the standby mode update the pins values from the STANDBY RAM variables. S32K3xx MCU.
------------------------------------------------------------------------------
* Test HW: S32K3X4EVB-Q172
* MCU: S32K312
* Compiler: S32DS3.5
* SDK release: RTD 3.0.0
* Debugger: PE Micro
* Target: internal_FLASH
********************************************************************************
=============== How this DEMO works ==========
Before entring standby :--
Before entering standby mode, i make BLUE LED high
SW6 on board pressed to enter the standby mode.
Wakeup from Standby :--
SW5 on board pressed to wakeup from standby
After wakeup from Stand by:--
I glow Green LED
Unglow the BLUE LED
Wait for SW6 on board to be pressed to enter the standby mode.
=============== Stand by RAM location ===============
As noted, the Standby SRAM is allocated at the first 32 KB of the SRAM Memory.
https://www.mouser.com/pdfDocs/S32K3MemoriesGuide.pdf
=============== Pins used for PAD keeping ===============
PTA30, PTA31, PTD14
=============== Switches used ===============
Enter Standby mode, by pressing SW6 on Board
EXIT Standby mode, by pressing SW5 on Board
=============== Wakeup source, SW5 PTB26 ===============
=============== WKPU[41] ---> WKPU_CH_45===============
Because First 4 WKPU are timers, so 41 + 4 = 45
=============== Linker file changed ===============
Added Standby RAM memory & sections for standby RAM memory.
Changes can be seen by comparing the original linker file
=============== Startup file changed , startup_cm7.s ===============
Added call to Initialise the Standby RAM
Changes can be seen by comparing the original startup_cm7.s file
======================= How to verify if Standby RAM is working ===============
1> Declare two variables in file Wkup.c :--
__attribute__ ((section (".standby_ram_data"))) volatile int test_0_value ;
__attribute__ ((section (".standby_ram_data"))) volatile int test_1_value ;
2> function set_pin_value() will be called before entering the standby mode.
Initialise the values to these two variables inside function set_pin_value() in file Wkup.c.
3> Now burn the code inside the MCU using the PE micro debugger.
Once code is burned do not run the code & disconnect the debugger.
4> Power OFF and power ON the S32K312 board.
Now code is waiting to enter standby mode.
Press switch SW6 MCU will enter standby mode & Blue LED glowing.
Press switch SW5 MCU will wakeup from the standby mode.
Code will Now code is waiting to enter standby mode
5> Now open your debugger configuration, and attach to running target.
6> Once connected click on the ELF file & press pause button.
7> In Debug window you can see the value of variables test_0_value & test_1_value same as initialised before entering the standby mode.
Hi,
Thank you for all but I have a big problem when I try to debug my projects. The problem is that when I debug the project, it should start uin the memory flash but the project starts in the sram and I don´t know what is the problem. Could you help me because I am very worried.
Thank you for all