Part Number: TMS320F28377D
Hello,
In our project, we want to put the CPU2 in stanby mode and check this state periodically thanks to LPMSTAT register (should by equal to 2).
At the beginning, this works, but after testing GS0 RAM, LPMSTAT goes to 0. Therefore, impossible to know if CPU2 is in stanby mode.
Hereafter, the code used to test the RAM :
#pragma DATA_SECTION(test_ram_GS0,"TestRAM_GS0_sec");
volatile Uint32 test_ram_GS0;
test_ram_GS0 = 0xA5A5A5A5;
EALLOW;
MemCfgRegs.GSxTEST.bit.TEST_GS0 = 0x02 ;
test_ram_GS0 ^= 0X01;
NOP;NOP;NOP;NOP;NOP;NOP;NOP;NOP;NOP;NOP;
MemCfgRegs.GSxTEST.bit.TEST_GS0 = 0x00 ;
NOP;NOP;NOP;NOP;NOP;NOP;NOP;NOP;NOP;NOP;
EDIS;
if (test_ram_GS0 != pattern) /* The LPMSTAT register goes to zero here */
test_ram_fail |= TEST_RAM_FAIL_GS0;
NOP;NOP;NOP;NOP;NOP;NOP;NOP;NOP;NOP;NOP;
if (MemoryErrorRegs.UCERRFLG.all != 0X0001 )
test_ram_fail |= TEST_RAM_FAIL_GS0;
EALLOW;
MemoryErrorRegs.UCERRCLR.all = 0X0001;
EDIS;
How to solve this issue.
Thanks for your help
Alain
The folowing code is used for putting the CPU2 in standby mode (nothing else):
__asm(" EALLOW");
WdRegs.SCSR.all = 0x2; /* WDRST enable, no WDOVERRIDE */ /* ????????? */
WdRegs.WDCR.all = 0x68; /* WDCLK = INTOSC1/512/1, WD disable */ /* ????????? */
CpuSysRegs.LPMCR.bit.LPM = 0b01; /* Configure CPU to go in standby when instruction IDLE is executed */
CpuSysRegs.CPUSYSLOCK1.bit.LPMCR = 1; /* Lock LPM register set above */
__asm(" EDIS");
__asm(" IDLE"); /* IDLE to go in standby mode */
