cancel
Showing results for 
Search instead for 
Did you mean: 

Wakeup SPC570S40E1 from STOP mode by NMI pin.

Tran Hung
Associate II
Posted on May 31, 2018 at 09:31

Hello everyone;

I am working with SPC570S discovery board. I would like to implement the STOP mode to reduce the power consumption and then wake up by using NMI pin like PA[4] or PC[15].

I already entry the STOP mode however the board does not wake up from STOP mode. The program seems to be halted and then showed a warning like this picture.

0690X0000060L2KQAU.png

The mode is then unidentified.

0690X0000060L2PQAU.png

My code is attached in the file below.

Can someone help me to configure the wake up unit from STOP mode?

I am appreciate to your help. Thanks you so much.

#stop-mode-wake-source #wakeup-pin #spc570s-disp

Note: this post was migrated and contained many threaded conversations, some content may be missing.
This discussion has been locked for participation. If you have a question, please start a new topic in order to ask your question
11 REPLIES 11
Tran Hung
Associate II
Posted on June 01, 2018 at 07:03

LE_SAINT.Erwan

‌ Can you support me about this problem?

Posted on June 01, 2018 at 08:42

Yvin.Erwan

Can you support me about this problem?

Erwan YVIN
ST Employee
Posted on June 06, 2018 at 10:11

Hello ,

According to your code :

Flash is in Low power mode ..

MC_ME.STOP0_MC.B.FLAON = 3; /* Flash is in low-power mode */�?�?

you can not access to the Wakeup function

Maybe ,you should put your function in RAM.

(Standby or Stop Mode) there are nice example in SPC5Studio :

SPC560Dxx OS-Less STANDBY SRAM Test Application for Discovery

SPC560Dxx_RLA WKPU API Test Application for Discovery

You can not debug in Low Power mode.

Best regards

Erwan

Posted on June 15, 2018 at 05:28

Hello

Yvin.Erwan

‌!

I looked at some examples of SPC560 processor:

SPC560Dxx OS-Less STANDBY SRAM Test Application for Discovery

SPC560Dxx_RLA WKPU API Test Application for Discovery

I found that SPC560 has interrupt vectors for the wake up feature: [table 155: Interrupt vector table]

0690X0000060BVAQA2.png

However, I havent found any software interrupt vector in SPC5

Which interrupt should I use to wake up in SPC570 MCU?

Posted on June 15, 2018 at 16:03

Hello Tran ,

it is different from SPC56D.

you should see the chapter 3

you should set your pad in NMI and set correctly the NMI Configuration Register

Example for a machine Check Occurrence

void interruptRoutine_IVOR1(void){printf('
***** Interrupt IVOR1: Machine Check occurs *****
');NMI_MCR_ISR(); /* NMI wake up from Lpmode*/};�?�?�?�?�?�?�?

Best regards

Erwan

Posted on June 18, 2018 at 02:22

Hello

Yvin.Erwan

Your answer is as same as my expectations. I used NMI pins PC[15] as a wake-up source < Chapter 21 in reference manual>.

However, I cannot use vector interrupt IVOR1. Looking at the isor configuration file < ivor_cfg.h>

IVOR1_HANDLER is always set FALSE:

/**

* @brief IVOR1 Machine Check Interrupt Handler.

* @details It is set to @p TRUE, IVOR1 interrupt will be handled calling the

* relative callback (i.e. ivor1_callback), passing CSRR0 and CSRR1 registers

* as parameter (containing respectively, an instruction address, as closely as

* possible, set to the effective address of an instruction that was executing

* or about to be executed when the Machine Check exception occurred, and

* Machine State Register at the time of interrupt).

*/

#define IVOR1_HANDLER FALSE

=> 1. How to change this IVOR1 configuration in SPC5studio?

In <ivor.s> file IVOR1 is configured as

#if IVOR1_HANDLER

.align 4

.globl _IVOR1

.type _IVOR1, @function

_IVOR1:

SAVE_CONTEXT_CRITICAL

LOAD_CSSR0_CSSR1

e_bl _ivor1_callback /* Branch to the proper callback*/

RESTORE_CONTEXT_CRITICAL

se_rfci

#endif

=> 2.Howto configure

<ivor.s> to use IVOR1 interrupt?

Thank you so much!

Posted on June 18, 2018 at 11:59

Hi Tran,

currently the graphic interface to configure the IVOR has not been ported yet on the SPC570S family. So, if you need to use the IVOR1, the following workarond is needed:

1. Set IVOR1_HANDLER to TRUE in the file ivor_cfg.h (please, take into account that this file is generated. So, if you will re-generate, the modification will be lost and you will have to re-apply it).

2. Define in your main the function _ivor1_callback. This function is the IVOR0 callback and will be exectute each time an IVOR1 will occur.

Please, feel free to contact us for any other clarification.

Regards,

Luigi

Posted on June 19, 2018 at 11:29

Hello

Zambrano.Luigi

Thank you so much for your guidance.

I followed your steps to create the interrupt by IVOR1 but it hasnt yet worked.

My code can be briefly described as follow:

1) Configure PC[15], PA[4] as a NMI pin

0690X0000060BhQQAU.png

2) Add function gotoRunMode() and gotoStandbymode in RAM

[quote] [/quote]

Posted on June 19, 2018 at 11:44

2) Add function gotoRunMode() and gotoStandbymode in RAM

0690X0000060L0tQAE.png

3) Configure wakeup pin

4. interrupt handler ivor1

void _ivor1_callback (void)

{

   gotoRunMode();

}

=>

1. I see that register WKPU.NSR is not change status when NMI pin change its state (0->1).

2. interrupt hander ivor1 doesnt work.

The detail program is saved in the attached file in the link below

=> Can you look at my code one time? 

https://drive.google.com/open?id=1CboTw1KvDvnVSOaQwzxYvjLkSPWuKhE4