Skip to main content
ssk
Associate III
June 30, 2015
Question

SPC560D - power control modes

  • June 30, 2015
  • 61 replies
  • 8057 views
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.
    This topic has been closed for replies.

    61 replies

    Erwan YVIN
    ST Employee
    November 27, 2015
    Posted on November 27, 2015 at 16:34

    Hello Philipp ,

    the next release 4.0 will not contain the SRAM STANDBY Application. (in progress)

    First, we need to implement for a small change request to permit to the developer to create his own linker file. (*.ld)

    maybe for 4.1.

    because after each generation application.ld is overwritten.

    anyway , in my application, i can see the ''core inactive'' when i push the button SW2

    i will check the Watchdog Reset Flag (RGM.DES.B.F_SWT).

       Best Regards

                               Erwan

    philipp239955_stm1_stmicro
    Associate II
    November 30, 2015
    Posted on November 30, 2015 at 09:04

    Hi Erwan,

    Thank you for your reply. I did a mistake by disabling the Watchdog. Now I  disabled the watchdog correctly and I had another behavior.

    If the Watchdog is disabled, the microcontroller, will not wake up correctly. I figured out that the blocking part is the

    SPC5_CLOCK_FAILURE_HOOK

    () Macro in the hal_lld_init() function. It look like, that the transition from DRUN to RUN0 failes.

    I think that’s the reason for the watchdog reset.

    Have you any idea, why this transition fails. 

    Preclock initialization Code:

    if

    (ME.GS.B.S_CURRENTMODE == SPC5_RUNMODE_DRUN) {

    And Post code

    }

    kind regards

    Philipp

    Erwan YVIN
    ST Employee
    November 30, 2015
    Posted on November 30, 2015 at 10:35

    Hello Philipp ,

    In my example, i have no problem and F_SWT is not set. (still 0)

    after STANDBY ==> DRUN ==> RUN0

    Could you send me your application ?

    After updating the PreClock Init code ,

    i am in DRUN state.

                    Best regards

                                         Erwan

    philipp239955_stm1_stmicro
    Associate II
    November 30, 2015
    Posted on November 30, 2015 at 11:30

    Hi Erwan

    It is not easy for me to send you the application, but I will build a demo application to reproduce this issue.

    Have you removed the reset flag initialization from spc_clock_init?

    //  RGM.FES.R         = 0xFFFF;

    //  RGM.DES.R         = 0xFFFF;

    Otherwise the Watchdog reset flag is always zero.

    Thank you for your reply.

    kind regards

    Philipp

    philipp239955_stm1_stmicro
    Associate II
    November 30, 2015
    Posted on November 30, 2015 at 14:31

    Hi Erwan

    You find can the demo application for the watchdog issue in the attachment.

    Please connect PA11 with PA2. The SW2 button generates the Wakeup event.

    kind regards

    Philipp

    ________________

    Attachments :

    Watchdog_issue.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0FT&d=%2Fa%2F0X0000000bZN%2FvkcR1mriEXxSwQOyULUjxb3UbwX3NOyxvOgo6ZLaeqY&asPdf=false
    Erwan YVIN
    ST Employee
    November 30, 2015
    Posted on November 30, 2015 at 16:05 Hello Phillip , when the system boots from flash on STANDBY Exit , the issue can happen. Maybe , the flash is not ready after the standby exit i recommend you to boot from BAckup RAM on STANDBY Exit. 2 Advantages : 1) Lower Power Consumption 2) Faster startup time Reason.

    /* Configure WKPU in order to enter in RUN Mode */
    configureWKPU();
    RGM.STDBY.B.BOOT_FROM_BKP_RAM=1;

    Best Regards Erwan
    philipp239955_stm1_stmicro
    Associate II
    November 30, 2015
    Posted on November 30, 2015 at 16:27

    Hi Erwan

    Thank you for your fast fix. It works very well in my application.

    The microcontroller still generates an external reset during wakeup. This behavior occurs only if the JTAG Debugger is closed and the discovery board run as standalone, You can also see that the reset pin is set to low and the red led lights up very shortly. This occurs only without the debugger. 

    Have you also solution for this behavior?

    kind regards

    Philipp

    Erwan YVIN
    ST Employee
    November 30, 2015
    Posted on November 30, 2015 at 17:41

    Hello Philipp ,

    for the red led D2. It seems to be linked to the reset mode.

    I have checked the documentation. I do not know how to disable it.

                   Best Regards

                                Erwan

    philipp239955_stm1_stmicro
    Associate II
    December 1, 2015
    Posted on December 01, 2015 at 08:05

    Hi Erwan

    Thank you for your reply.

    In my opinion it is a strange behavior, because when I am running the application with the debugger the external reset event doesn't occur and also the LED is not blinking. 

    I searched in the errata sheet, but found nothing about this behavior. 

    Please let me know, if you have any idea to fix this issue.

    kind regards

    Philipp

    philipp239955_stm1_stmicro
    Associate II
    December 11, 2015
    Posted on December 11, 2015 at 10:17

    Hi Erwan,

    After some days pause, I found a solution for this reset issue. It seem s like that the CheckStop Reset is linked to the RESET Pin. And nobody will believe it, there is register for it. If the Register

    RGM.

    FBRE

    .

    B

    .

    BE_CHKSTOP

    is set to 1 I have the same behavior with the debugger and without the debugger. Therefore all reset flags will be set correctly.

    Thank you for your support.

    kind regards

    Philipp