Announcements

Robots are revolutionizing our lives in many ways. Join our webinar to learn about Infineon’s broad portfolio of robot building blocks.
Click here to register.

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

AURIX™ Forum Discussions

User16898
Level 4
Level 4
User manual says to switch code execution from Flash to RAM during entering the standby mode page 506).

[HTML]CPU code execution is switched from Flash to PSPR RAM. Flash modules are
deactivated via FCON register.[/HTML]

There are no information about PSPR RAM register or how to switch this execution.
How can i do it ?

I work on Tc222L
0 Likes
5 Replies
cwunder
Employee
Employee
50 solutions authored 250 sign-ins 25 likes received
There are no information about PSPR RAM register or how to switch this execution.
How can i do it ?


The Program Scratch-Pad RAM (PSPR) is tightly coupled RAM located in the PMI with its own memory space. To execute from PSPR you would do like any other microcontroller to exectue from RAM. Generally you create an entery or section that has a storage address in (Flash) and execute address (RSM) and the copy table initialization moves it from Flash to RAM on startup. In your program you would call it like any other function.

For the Hightec toolchain you could do something like this:
__attribute__((asection(".cpu0_psram", "a=4", "f=xwc0")))
void TurnOffFlashEnterStandbyMode(void) {
unlock_wdtcon(0);
FLASH0_FCON.B.SLEEP = true;
lock_wdtcon(0);


while(false == FLASH0_FSR.B.SLM) {
; /*wait for flash to turn off */
/*TODO: add timeout if this fails */
}
...
0 Likes
User16898
Level 4
Level 4
thanks for Quick response.
unfortunetly
__attribute__((asection(".cpu0_psram", "a=4", "f=xwc0")))
is not recugnized by TASKING toolchain.
0 Likes
cwunder
Employee
Employee
50 solutions authored 250 sign-ins 25 likes received
For the Tasking toolchain you could do something like:

Where you need to add a section to the lsl file:

        
section_layout :vtc:linear
{
group pspr0 ( run_addr = mem:pspr0, copy )
{
select "*.myRamCode";
}
}


Then in your code


volatile int cnt;

__noinline void myRamCode( void )
{
cnt++;
}
0 Likes
User16898
Level 4
Level 4
after i placed suggested code I got following compiler error from .sls file :

syntax error: Could not find memory pspr0 for memory reference for a run-time or load-time address range of a group
0 Likes
User16898
Level 4
Level 4
Ok I found solution:

section_layout :tc0:linear
{
group STANDBY_MODE_RAM_FUNCTIONS(ordered, run_addr=mem : mpe : pspr0,copy)
{
select".text.ifx_standby_mode_psram.ifx_enter_standby_mode_psram_sequence";

select".text.IfxScuWdt.IfxScuWdt_clearSafetyEndinit";
select".text.IfxScuWdt.IfxScuWdt_setSafetyEndinit";

select".text.IfxScuWdt.IfxScuWdt_setCpuEndinit";
select".text.IfxScuWdt.IfxScuWdt_clearCpuEndinit";

}
}
0 Likes
This widget could not be displayed.