Hello,
I am using KE04 on a custom board, specifically MKE04Z64VLD4.
The board is currently populated with nothing except the KE04, decoupling capacitors and pull-up for RST.
No I/O pins are connected - only 7:VDD, 8:VDDA, 9:VREFL, 10:VSS/VSSA, 40:VSS, 41:VDD and 63:PTA5/RST.
The processor is powered with 4.1V.
I would like to know what must be done to achieve the very low deep sleep current of 2-40 µA, as per the datasheet. Currently, the processor is drawing ~123µA after entering deep-sleep.
The code I am using is as follows:
void SystemInitHook() {
SIM->SOPT0 = 0b1100;
GPIOA->PDDR |= 1 << 25;
for(uint8_t n = 0; n < 10; n++) {
GPIO->PSOR = 1 << 25;
for(volatile uint64_t x = 0; x < 500000; x++);
GPIO->PCOR = 1 << 25;
for(volatile uint64_t x = 0; x < 500000; x++);
}
SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
__WFI();
}
The call chain is <POR> => ResetISR => SystemInit => SystemInitHook, and these functions have not been modified from the default SDK.
ResetISR does __asm("cpsid i"); and SystemInit disables the watchdog.
No other code is being run before the call to SystemInitHook.
Best regards,
Davey Taylor