CPUx put CPUx in IDLE

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

cross mob
User17079
Level 1
Level 1
Hi

I use TC277 DC-Step where I have two cores running and want to put Core1 in idle state by itself.
After calling Mcu_SetMode(MCU_IDLE) from Core1, the core doesn't gets into idle state. I confirmed this by looking at REQSLP flag.

What could be that I'm missing here to put the core in IDLE state?

Thanks!
Sivakumar M.
0 Likes
4 Replies
cwunder
Employee
Employee
5 likes given 50 likes received 50 solutions authored
Here is a code snippet where CPU1 places itself in IDLE mode

/** \brief Idle Mode and Sleep Mode Request * In Idle Mode or Sleep Mode, these bits are cleared in response to an
* interrupt for the CPU, or when bit 15 of the corresponding CPU Watchdog
* Timer register (bit WDTCPUxSR.TIM[15]) changes from 0 to 1. In Standby
* Mode, these bits are cleared on wake-up. REQSLP maybe written only when
* either CPU or Safety ENDINIT bits are set to 0. CPU ENDINIT bit has to
* be set back after REQSLP is written for the mode transition to take place.
* In case of Safety ENDINIT, the mode transition will be issued immediately
* and does not wait till Safety ENDINIT is set back to 1 again.
*/
typedef enum
{
pmcsrx_reqslp_RequestRunMode = 0, /**< \brief Request CPU Run Mode */
pmcsrx_reqslp_RequestIdleMode = 1, /**< \brief Request CPU Idle Mode */
pmcsrx_reqslp_RequestSleepMode = 2, /**< \brief Request System Sleep Mode */
pmcsrx_reqslp_RequestStandbyMode = 3, /**< \brief Request System Standby Mode */
} PMCSRx_REQSLP_enum;


int core1_main (void)
{
IfxCpu_enableInterrupts();
/*
* !!WATCHDOG1 IS DISABLED HERE!!
* Enable the watchdog in the demo if it is required and also service the watchdog periodically
* */
IfxScuWdt_disableCpuWatchdog (IfxScuWdt_getCpuWatchdogPassword ());
uint16 cpu1Password = IfxScuWdt_getCpuWatchdogPassword();


/* Cpu sync event wait*/
IfxCpu_emitEvent(&cpuSyncEvent);
IfxCpu_waitEvent(&cpuSyncEvent, 1);
while (1)
{
IfxScuWdt_clearCpuEndinit(cpu1Password);
SCU_PMCSR1.B.REQSLP = pmcsrx_reqslp_RequestIdleMode;
IfxScuWdt_setCpuEndinit(cpu1Password);
}
return (1);
}


4159.attach
0 Likes
User17079
Level 1
Level 1
Hi cwunder,

Currently the driver what I have is based on AUTOSAR. So I couldn't find some functions from your code snippet..
If you tell me where the following functions are located (filename), that would be helpful.
function names: IfxCpu_enableInterrupts, IfxCpu_emitEvent, IfxCpu_waitEvent, IfxScuWdt_clearCpuEndinit.

Could you also tell me the driver name and version, that you have used in your code snippet?

Thanks!
Siva.
0 Likes
NeMa_4793301
Level 6
Level 6
10 likes received 10 solutions authored 5 solutions authored
Those functions are from the iLLD (Infineon Low Level Device Drivers), available on MyICP.
0 Likes
User17079
Level 1
Level 1
0 Likes