Hi, I am trying to measure (and reduce) the current consumption of my board. I am using nrf52832 (64K RAM) for my development. The RAM layout is as follows: RAM (rwx) : ORIGIN = 0x20002080, LENGTH = 0x2EA8. Stack is 2048 and heap is 1024 bytes. Total comes out to be 0x3AA8. Looking at this configuration, I understand that I am using 2 sections of the RAM (section 0 & 1). Hence I am powering down sections 2 to 7. My assumption is that powering down the RAM will reduce my current consumption by some value. But instead of that my current consumption is going into mA. I don't understand what I am doing wrong. I have pasted my code below. Please let me know my mistake.
int main(void)
{
nrf_clock_lf_cfg_t clock_lf_cfg = {
.source = NRF_CLOCK_LF_SRC_RC,
.rc_ctiv = 16,
.rc_temp_ctiv = 2,
.xtal_accuracy = NRF_CLOCK_LF_XTAL_ACCURACY_20_PPM};
// Initialize the SoftDevice handler module.
SOFTDEVICE_HANDLER_INIT(&clock_lf_cfg, NULL);
for (uint8_t i = 2; i < 8; i++)
{
NRF_POWER->RAM[i].POWER = 0;
NRF_POWER->RAM[i].POWERCLR = 0x00030003;
}
sd_power_mode_set(NRF_POWER_MODE_LOWPWR);
while (true)
{
sd_app_evt_wait();
}
return 0;
}