This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Powering down RAM sections increases current

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;
}
Parents
  • 0x20002080 + 0x2EA8 = 0x20004F28. So, You are using RAM0-2 blocks. RAM begins at 0x20000000, not 0x20002080. It is 0x20002080 because 0x2080 is reserved for SoftDevice.

  • Hi Wojtek, Thank you for answering. I have modified my code to power down sections 3 to 7. But still my current consumption is in mA. Any ideas on that? I have attached the modified code below.

    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 = 3; 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;
    

    }

    Thanks, SUK

Reply
  • Hi Wojtek, Thank you for answering. I have modified my code to power down sections 3 to 7. But still my current consumption is in mA. Any ideas on that? I have attached the modified code below.

    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 = 3; 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;
    

    }

    Thanks, SUK

Children
No Data
Related