cancel
Showing results for 
Search instead for 
Did you mean: 

SPC560D - power control modes

ssk
Associate II
Posted on June 30, 2015 at 16:50

Hello,

I am using standby mode for SPC560D MCU. The datasheet mentions about using DRUN or software reset for exiting this mode. Can you please explain on,

1. How to configure the DRUN mode? I tried using API 'halSPCSetRunMode' for switching between modes. But when used for DRUN mode, it does not exit the standby mode correctly and a power reset is required. Is any thing missing for this?

2. Which are the ways to use software reset for SPC560D? Can I use watchdog reset as a software reset? Is there any other means for software reset?

Thanks in advance for any help.

Mike.
61 REPLIES 61
ssk
Associate II
Posted on October 05, 2015 at 13:15

Hello Vanima,

I am attaching herewith the sample application which I used for understanding the stanby mode behavior. Thanks.

Mike.

________________

Attachments :

SPC560Dxx_OS-Less_WKPU_STANDBY_LPM_Test_Application_for_Discovery.7z : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0Tt&d=%2Fa%2F0X0000000bZT%2Fe8jJVJhltjLqHzyQedxHTAYaA9XiyfMWVPkuebxhyNc&asPdf=false
nooshin_1382
Associate II
Posted on October 07, 2015 at 16:17

Hi Mike

Thank you

I try This code , but i have some problem is this code worked for your project?

Best Regards

Nazerian Vanima

nooshin_1382
Associate II
Posted on October 07, 2015 at 16:24

Hello Erwan

I Wait For your Answer yet.

I try any model of codes but until yet i have not any response .

In my project i use 2 can ,1 Lin , 2 Usart , ADC ,SPI in normal mode i have no Problem but when the remote control send a comand my board should go to sleep and one LED should Blink in sleep mode .

All the Project is ok but i can not finish those section :

1.Go to sleep with less than 5mA .

2.Blink a LED in sleep mode .

3.when i wake up from the sleep mode the program go to some where i do not know about that.

Best Regards

Nazerian Vanima

nooshin_1382
Associate II
Posted on October 13, 2015 at 08:29

Hi Erwan

I still wait for any solution about Standby Mode .

Thanks

Best Regards

Nazerian Vanima

Erwan YVIN
ST Employee
Posted on October 13, 2015 at 10:05

Hello Vanima ,

I will send you an example on B54L5 Discovery

 Best regards

        Erwan

nooshin_1382
Associate II
Posted on October 13, 2015 at 13:08

Hi Erwan

Thanks For your Kind Attention

I wait for Recive your Email .

Best Regards

Nazerian

Erwan YVIN
ST Employee
Posted on October 13, 2015 at 17:37

Hello Vanima ,

Did you boot from Flash or from RAM ? if FLASH, we recommend you to force a Reset

if
(OSAL_FAILED == halSPCSetRunMode(0)) {
SPC5_CLOCK_FAILURE_HOOK();
}

or

/* software reset */
ME.MCTL.R = 0x00005AF0;
ME.MCTL.R = 0x0000A50F;

Best regards Erwan
nooshin_1382
Associate II
Posted on October 14, 2015 at 09:02

Hi Erwan

First i did not recive any example yet.

My Application Boot From Flash But i Try The force reset  but for first time go to standby mode is completly ok but for seconde time it is not ok .

i think boot from ram is faster if you have any example for this issue please let me know about this .

I don't know why this issue is so complecated!!!

Best Regards

Nazerian

Erwan YVIN
ST Employee
Posted on October 14, 2015 at 09:23

Hello Vanima ,

i am packing this morning the test application.

I will integrate it in the next application wizard.

 

        Best regards

                       Erwan

Erwan YVIN
ST Employee
Posted on October 14, 2015 at 09:50

Hello Vanima ,

you can find in the attachment the STANDBY Test application for B Discovery

STOP0 is easier to implement because you have not to perform a full reset , you can go back directly by RUN0

STANDBY is more difficult , you have to go back in DRUN mode

Some recommandations :

1) DEBUGGER options : if you use PLS and Function in Ram , Disable Use Hardware Reset Mode otherwise using Function in RAM can generate some Reset Exceptions

2) at the main init,

I have put,

RGM.STDBY.B.BOOT=1;

Boot from the Backup RAM on STANDBY Exit Otherwise i had an assert (Clock Issue)

3) On RUN mode the Led is blinking

i am using EIRQ plugged on PUSH BUTTON to enter in the mode STANDBY

In PLS, the core should become inactive and the Led is STOPPED.

4) Generate a Pulse WKPU to reenter in DRUN Mode (Reset) the led is blinking again.

These 2 functions have been put in RAM but i do not think that it is mandatory.

__attribute__ ((section (
''.codeinram''
))) 
void
gotoStandbyMode(
void
) {
WKUP.WISR.R = 0x00000008; 
//Clear interrupt flag
if
((ME.GS.B.CURRENTMODE < SPC5_RUNMODE_RUN3)
|| (ME.GS.B.CURRENTMODE > SPC5_RUNMODE_RUN0)) {
if
(OSAL_FAILED == halSPCSetRunMode(SPC5_RUNMODE_STANDBY)) {
SPC5_CLOCK_FAILURE_HOOK();
}
}
}
__attribute__ ((section (
''.codeinram''
))) 
void
gotoRunMode(
void
)
{
if
(OSAL_FAILED == halSPCSetRunMode(SPC5_RUNMODE_DRUN)) {
SPC5_CLOCK_FAILURE_HOOK();
}
}

(Cf Attachment)

Test applis and Screenshot of the example.

Best Regards

Erwan

________________

Attachments :

SPC560Bxx_OS-Less_STANDBY_Test_Application_for_Discovery.7z : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0To&d=%2Fa%2F0X0000000bZQ%2Fk46lrr1WSC1YnaWVkZy1yRo5Oaweqgzv.QoGmnJDybE&asPdf=false

SPC560Bxx_OS-Less_STANDBY_Test_Application_for_Discovery_bb.png : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0AK&d=%2Fa%2F0X0000000bZO%2F5Y3K6SwgGIUAmGJkJ2o3SDpr0ceM6JQ7rEV9qY0C4gg&asPdf=false