2015-06-30 07:50 AM
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.2015-10-05 04:15 AM
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=false2015-10-07 07:17 AM
Hi Mike
Thank you I try This code , but i have some problem is this code worked for your project? Best Regards Nazerian Vanima2015-10-07 07:24 AM
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 Vanima2015-10-12 11:29 PM
Hi Erwan
I still wait for any solution about Standby Mode . Thanks Best Regards Nazerian Vanima2015-10-13 01:05 AM
Hello Vanima ,
I will send you an example on B54L5 Discovery Best regards Erwan2015-10-13 04:08 AM
Hi Erwan
Thanks For your Kind Attention I wait for Recive your Email . Best Regards Nazerian2015-10-13 08:37 AM
Hello Vanima ,
Did you boot from Flash or from RAM ? if FLASH, we recommend you to force a Resetif
(OSAL_FAILED == halSPCSetRunMode(0)) {
SPC5_CLOCK_FAILURE_HOOK();
}
or
/* software reset */
ME.MCTL.R = 0x00005AF0;
ME.MCTL.R = 0x0000A50F;
Best regards
Erwan
2015-10-14 12:02 AM
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 Nazerian2015-10-14 12:23 AM
Hello Vanima ,
i am packing this morning the test application. I will integrate it in the next application wizard. Best regards Erwan2015-10-14 12:50 AM
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=falseSPC560Bxx_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