This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

WFI set up

Other Parts Discussed in Thread: RM48L952, HALCOGEN

Hello,

I am trying to test a power down mode. What I currently do is set up the RTI to trigger every 3 seconds and print something out. However, I don't see much of a dip (I see some, about a 0.3 W difference, but I'd expect a little bit more putting it into snooze mode). I put the flash banks and pump into sleep mode, disabled the clocks, and call the WFI instruction. 

However I instead just seem to hang. Putting it into Doze mode I can get the terminal back - but the output is all screwed up. Am I following the right procedure?

/* USER CODE BEGIN (26) */
flashWREG->FPAC1 &= ~(0x1);
flashWREG->FPAC2 &= ~(0xFFFF);
flashWREG->FPAC2 |= (0x10);
flashWREG->FBFALLBACK = 0x00000000U;
/* USER CODE END */

/* Disable clock sources */
systemREG1->CSDISSET = SYS_SNOOZE_MODE & 0x000000FFU;

/* Disable clock domains */
systemREG1->CDDIS = (SYS_SNOOZE_MODE >> 8U) & 0x00000FFFU;

/* Idle CPU */
/*SAFETYMCUSW 88 S MR:2.1 <APPROVED> "Assembly in C needed" */
asm(" wfi");

Upon waking up, I execute the following:

flashWREG->FBFALLBACK = 0x00000000U
| (SYS_ACTIVE << 14U)
| (SYS_ACTIVE << 2U)
| SYS_ACTIVE;
flashWREG->FPAC1 |= (0x1);
/* USER CODE END */

/* Enable clock sources */
systemREG1->CSDISCLR = 0x000000FFU;

/* Enable clock domains */
systemREG1->CDDIS = 0;

Thanks for any help