Example S32K312 Standby mode & Standby RAM and PAD keeping DS3.5 RTD300

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Example S32K312 Standby mode & Standby RAM and PAD keeping DS3.5 RTD300

Example S32K312 Standby mode & Standby RAM and PAD keeping DS3.5 RTD300

*******************************************************************************

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

Dinesh_Guleria_1-1706609081807.png

 

Dinesh_Guleria_2-1706609164083.png

 



=============== Switches used ===============

Dinesh_Guleria_0-1706609013348.png

 
Enter Standby mode, by pressing SW6 on Board
EXIT Standby mode, by pressing SW5 on Board

=============== Wakeup source, SW5 PTB26 ===============

Dinesh_Guleria_3-1706609222511.png


=============== WKPU[41]  ---> WKPU_CH_45===============
Because First 4 WKPU are timers, so 41 + 4 = 45

Dinesh_Guleria_0-1706610068634.png

 




=============== Linker file changed ===============
Added Standby RAM memory & sections for standby RAM memory.
Changes can be seen by comparing the original linker file 

Dinesh_Guleria_4-1706609365318.png

 

Dinesh_Guleria_5-1706609374981.pngDinesh_Guleria_6-1706609386872.png

 

Dinesh_Guleria_7-1706609395948.png



=============== 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

Dinesh_Guleria_8-1706609506315.png

 

 

======================= 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 ;

Dinesh_Guleria_0-1706795824611.png

 

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.

Dinesh_Guleria_1-1706795851364.png

 

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.

Dinesh_Guleria_2-1706795891040.png

 

6> Once connected click on the ELF file & press pause button.

Dinesh_Guleria_3-1706795905290.png

 

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.

Dinesh_Guleria_4-1706795934951.png

 

Dinesh_Guleria_0-1706799345237.png

 

Dinesh_Guleria_1-1706799364449.png

 

附件
评论

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.

JonAnder_Amante_0-1710922815232.png

 

 

Thank you for all

无评分
版本历史
最后更新:
‎02-01-2024 07:56 AM
更新人: