cancel
Showing results for 
Search instead for 
Did you mean: 

Using SRAM

ssk
Associate II
Posted on October 30, 2015 at 12:43

I am using SPC560D with SPC5Studio. I want to save the device configuration/status before putting the device to standby mode and use/retrieve this status when the device exits standby mode. Can this be achieved by using SRAM? How to access SRAM for variable storage?

Any example for using SRAM will be helpful. Thanks.

Mike.
6 REPLIES 6
nooshin_1382
Associate II
Posted on November 14, 2015 at 07:38

Hi Mike

I have the same problem but now i use the data flash for save my states before go to standby mode .

I think u should do this .

Best Regards

Nazerian Vanima

Posted on November 16, 2015 at 09:36

Hi,

I have also this problem, but using the data flash is not an acceptable solution for me. The reason why is that the data flash must be written per page and it has a life cycle of 100.000 write and erase cycles. For my application the flash memory will corrupt very fast (best case 100.000 wake ups) depending on the wake up cycles.

Therefore using SRAM is a better solution for this problem, but I can’t find any information about this. 

Is there a solution for this problem out there? (Any demo application or application note)

I’m looking forward to a solution for this problem.

kind regards 

 Philipp

nooshin_1382
Associate II
Posted on November 25, 2015 at 08:19

Hi Friends

Dear Erwan This problem seems to be important .

why ST have no any response to this issue or send any example for solve this problem.

Best Regards

Nazerian Vanima

Erwan YVIN
ST Employee
Posted on November 25, 2015 at 10:09

Hello Philip,

the information is not easy to find in the Reference Manual.

According to the RM, (D Bolero)

the first 8K SRAM could be still ON.

You have to take care to put your data in the first 8K.

''The only parts of the device that are still powered during this mode are pads

mapped on wakeup lines and power domain #0 which contains the MC_RGM, MC_PCU,

WKPU, 8K RAM, RTC_API, SIRC, FIRC, and device and user option bits.''

Warning , after STANDBY entry, the debugger loses connection to the target due to

power gating.

there is no application note about that.

In our application team, we have submit a change request to create a SRAM Example Application.

    Best regards

                        Erwan

Posted on November 25, 2015 at 13:03

Hi Erwan

,

Thank you for the reply.

I found another solution for this issue. In my opinion the reference manual says that the SRAM is connected to the power domain #0 and is persistent after wake up. The SPC560D have one 16k ram, which is always on. My solution for this problem was that, I reduced the ram length in the linker file and added a new memory like “backup ram� and a new section .backup in the backup ram.

The reason why it works is, that the boot.s file initialize the SRAM from ram_start to ram_end. With the new linker file the ram end_address is changed and the backup ram section will not be overwritten during boot/wakeup.

Erwan can you please refer to the chapter, which includes the information about the sram?

PS: Meanwhile I feel that I read all application notes from STM :D

kind regards

Philipp

Erwan YVIN
ST Employee
Posted on November 25, 2015 at 16:56

Hello Philipp ,

Sorry , Philip, the standby mode is not well documented and not easy to implement.

cf chapter 8.4.2 :

''The only parts of the device that are still powered during this mode are pads

mapped on wakeup lines and power domain #0 which contains the MC_RGM, MC_PCU,

WKPU,

8K RAM, RTC_API, SIRC, FIRC, and device and user option bits.''

Yes , In reducing the Ram length like below ...It is working well.

(cf application.ld)

MEMORY
{
flash : org = 0x00000000, len = 256k
dataflash : org = 0x00800000, len = 64k
ram : org = 0x40000000, len = 10k
backupram : org = 0x40002800, len = 2k
}
ENTRY(_reset_address)
/*
* Derived constants.
*/
__flash_size__ = LENGTH(flash);
__flash_start__ = ORIGIN(flash);
__flash_end__ = ORIGIN(flash) + LENGTH(flash);
__ram_size__ = LENGTH(ram);
__ram_start__ = ORIGIN(ram);
__ram_end__ = ORIGIN(ram) + LENGTH(ram);
__backupram_size__ = LENGTH(backupram);
__backupram_start__ = ORIGIN(backupram);
__backupram_end__ = ORIGIN(backupram) + LENGTH(backupram);

the SRAM is still ON and i can recover the context after switching STANDBY ==> DRUN

(Cf Screenshot / SPC5Studio test application / Schematics in attachment)

The test application uses the serial port :

1) Cf PNG Schematics (2 wires to plug)

2)

Normal Reset

, enter your string to be stored in the BACKUP Ram (serial Port)

3)

Push on the BUTTON1 (SW2)

==> you enter in STANDBY MODE

The core should be inactive.

4)

Unplug the 2nd wire to generate a WKPU Interrupt

..you switch again in DRUN Mode

and you can recover the data stored in the BackupRam.

WARNING : you are losing the Debugger synchro after entered in STANDBY Mode

Best Regards

Erwan

________________

Attachments :

2015-11-25_165607.png : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0RY&d=%2Fa%2F0X0000000bZ2%2Fobqun_BCpKvhUe11xRrCX_bEeFnVEHL4nZZ2ces8N.4&asPdf=false

SPC560Dxx_OS-Less_STANDBY_SRAM_Test_Application_for_Discovery.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0FB&d=%2Fa%2F0X0000000bZ3%2FFLg9yfLILsrJ8HCayXhduMvXVAzk6dTMljbhkoRrswM&asPdf=false

SPC560Dxx_OS-Less_STANDBY_Test_Application_for_Discovery_bb.png : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hzjh&d=%2Fa%2F0X0000000bZ1%2FBRtlcfGM1.y54vW0BsV20Hwb6skwZJ427qJdCLIDwM8&asPdf=false