2018-05-31 12:31 AM
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.
The mode is then unidentified.
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.2018-05-31 10:03 PM
LE_SAINT.Erwan
Can you support me about this problem?2018-06-01 01:42 AM
Yvin.Erwan
Can you support me about this problem?
2018-06-06 01:11 AM
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 DiscoveryYou can not debug in Low Power mode.
Best regards
Erwan
2018-06-14 10:28 PM
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]
However, I havent found any software interrupt vector in SPC5
Which interrupt should I use to wake up in SPC570 MCU?
2018-06-15 09:03 AM
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
2018-06-17 07:22 PM
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_CRITICALLOAD_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!
2018-06-18 04:59 AM
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
2018-06-19 04:29 AM
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
2) Add function gotoRunMode() and gotoStandbymode in RAM
[quote] [/quote]
2018-06-19 04:44 AM
2) Add function gotoRunMode() and gotoStandbymode in RAM
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