Part Number: TMS570LS1224
Hello,
This question refers to safety diagnostic in correlation with low power mode.
During implementation Low Power Modes on TMS570LS1224 I found out (with QJ Wang help) that I can't switch into low power mode for some configurations (QJ Wang noticed that there could be an issue with PBIST in sys_startup source file. It looked like mcu switch to lower power mode and cannot wake up... When he commented out big part of safety checks code and than Low Power Mode works.
Now I investigate further and in the result I know that there are some safety functions which should be disabled if I would like to use low power mode functionality. In the picture below you can see my working configuration (with this config I can successfully wake up) . If I check e.g. MIBSPI1 or HET low power mode will crash (cannot wake up). What is the reason of that? Is it possible to add these safety checks and work with low power modes?
/* Wakeup Interrupt: RTI compare 0 */
vimREG->WAKEMASKCLR0 = 0xFFFFFFFF;
vimREG->WAKEMASKCLR1 = 0xFFFFFFFF;
vimREG->WAKEMASKCLR2 = 0xFFFFFFFF;
vimREG->WAKEMASKSET0 = (1U << 2U) /* RTI CAP0 */
| (1U << 23U) /* GPIO Low */
| (1U << 16U); /* CAN1 High */
/* Flash */
flashWREG->FPAC2 = 0x7;
flashWREG->FMAC = 0x6;
flashWREG->FBAC = 0x70F;
flashWREG->FMAC = 0x0;
flashWREG->FBAC = 0x70F;
/* Setup flash bank power modes */
flashWREG->FBFALLBACK = 0x00000000U
| (uint32)((uint32)SYS_SLEEP << 14U) /* BANK 7 */
| (uint32)((uint32)SYS_SLEEP << 0U); /* BANK 0 */
/* Flash Charge Pump Fallback Power Mode */
flashWREG->FPAC1 &= (1UL << 0);
/* Enter DOZE MODE */
/* Reset RTI Counter 0 */
rtiStopCounter(rtiCOUNTER_BLOCK0);
rtiResetCounter(rtiCOUNTER_BLOCK0);
/* Clock RTI using OSCIN */
systemREG1->RCLKSRC = 0x0;
/* Wake up time setup */
rtiREG1->CMP[0U].COMPx = 30000000U;
rtiREG1->CMP[0U].UDCPx = 30000000U;
rtiREG1->INTFLAG = 0x0007000FU;
rtiREG1->CLEARINTENA = 0x00070F0FU;
rtiREG1->SETINTENA = rtiNOTIFICATION_COMPARE0;
/* Start counter 0 */
rtiStartCounter(rtiCOUNTER_BLOCK0);
/** - Setup GCLK, HCLK and VCLK clock source for normal operation, power down mode and after wakeup */
systemREG1->GHVSRC = (uint32)((uint32)SYS_OSC << 24U)
| (uint32)((uint32)SYS_OSC << 16U)
| (uint32)((uint32)SYS_PLL1 << 0U);
systemREG1->CSDISSET = 0xFE;
systemREG1->CDDISSET = 0xFFBF;
asm(" NOP");
asm(" NOP");
asm(" NOP");
asm(" WFI");
asm(" NOP");
asm(" NOP");
asm(" NOP");
asm(" NOP");
Below my post wake up code:
systemREG1->CSDISCLR = 0x31;
/* Reconfigure flash bank/pump fallback modes to be "active" */
flashWREG->FBFALLBACK = 0x00000000U
| (uint32)((uint32)SYS_ACTIVE << 14U) /* BANK 7 */
| (uint32)((uint32)SYS_ACTIVE << 0U); /* BANK 0 */
mapClocks();
