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

Bootloader taking higher current consumption upon power on

Misc info:

1.  SDK Version: v15.3

2.  SD: 6.1.1

3.  Toolchain: IAR v7

I'm trying to use secure_bootloader from the examples but it's taking higher current upon power on. 

Our intention is to integrate the bootloader with the soft device+application but higher current consumption is an issue.

Please check the attached images which we got from PPK.

Can you please help me out on this?

Parents Reply
  • We flashed bootloader+softdevice (*.hex) image using the J-link commander. Then we flashed the application (*.zip) image using the "nrf Toolbox" by using the DFU option. I flashed above images on the Nordic nrf52832 DK board and connected the PPK and captured the above screens. I see both the bulk transactions all the time whenever I do powercycle. In the dfu example we just disabled  integrity check ( system OFF reset ) that all. No more changes.

    With above reply I can conclude that I can't minimize or avoid both the burst transactions(300ms & 89ms) right?

    Regards,

    asr.

Children
  • I assume you may reduce the time by using the internal 32kHz RC oscillator instead of the external 32kHz. But do you expect your product to be power cycled frequently?

    300ms @ 7mA equal about 200-300 advertising events, unless you power cycle your product many times a day I doubt it will have any impact on the battery life time.

  • Hi Kenneth,

    why is it the case that I don't see the crystal stabilization time in my application? The pattern in the attached image is the only thing I see when my application runs on the board. 

    Why is the initialization behavior different for bootloader and the application? 

    P.S.: The attached image is the capture of Softdevice + Application, no bootloader is present in it. 

  • I think we can conclude that it is the way it is in this case. A power cycle it not something we expect happen often, it should really only occur when replacing batteries, in which case doing a integrity check of the firmware make sense.

    It could be interesting to know if you have enabled the softdevice in the bootloader and application with the same LFCLK (32kHz clock source).

  • Hi Kenneth,

    Yes, we enabled same clock source in both the BootLoader and Application.

    we got some progress on this issue. we noticed one Preprocessor (define symbols) difference between the two projects (bootloader & Application) i.e CONFIG_NFCT_PINS_AS_GPIOS. 

    a) After flashing this newly built bootloader image( softdevice + bootloader) 300ms @ 7mA current issue got resolved. Below is the screenshot ( Application not flashed yet)

    nrfjprog -f nrf52 –eraseall

    mergehex -m secure_bootloader_ble_s132.hex s132_nrf52_6.1.1_softdevice.hex -o BLSD.hex

    nrfjprog --family nrf52 --program BLSD.hex --verify --reset

    b) Now we flashed application image using nrf Toolbox -> DFU ( file selected *.zip). Command we used for generating application *.zip file

    nrfutil pkg generate --application BTM_BT_uC_Firmware.hex --application-version 1 --hw-version 52 --sd-req 0xB7 --key-file my_secret_private_key.pem BTM_BT_uC_Firmware.zip

    After powercycle the nrf52 DK and capture the current consumption using PPK, issue is noticed again.

     

    c) Now we erased entire flash chip and flashed softdevice & Application using following commands

    nrfjprog -f nrf52 --eraseall
    nrfjprog -f nrf52 --program s132_nrf52_6.1.1_softdevice.hex --sectorerase

    nrfjprog -f nrf52 --program BTM_BT_uC_Firmware.hex --sectorerase --verify --reset
    nrfjprog -f nrf52 --reset

    after flashing softdevice I downloaded application alone to verify that 300ms @7.6mA current drawing is triggering or not.

    I am trying to fix the issue with above steps a & b. Please guide me how i can resolve this issue. Is there any parameters are getting overwritten while flashing the application on top of softdevice + bootloder. 

    Here are the contents of the icf files.

    a) Bootloader icf file contents

    /*###ICF### Section handled by ICF editor, don't touch! ****/
    /*-Editor annotation file-*/
    /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
    /*-Specials-*/
    define symbol __ICFEDIT_intvec_start__ = 0x78000;
    /*-Memory Regions-*/
    define symbol __ICFEDIT_region_ROM_start__ = 0x78000;
    define symbol __ICFEDIT_region_ROM_end__ = 0x7dfff;
    define symbol __ICFEDIT_region_RAM_start__ = 0x200057b8;
    define symbol __ICFEDIT_region_RAM_end__ = 0x2000ffff;
    export symbol __ICFEDIT_region_RAM_start__;
    export symbol __ICFEDIT_region_RAM_end__;
    /*-Sizes-*/
    define symbol __ICFEDIT_size_cstack__ = 2048;
    define symbol __ICFEDIT_size_heap__ = 0;
    /**** End of ICF editor section. ###ICF###*/

    define memory mem with size = 4G;
    define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
    define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];

    define symbol __region_uicr_bootloader_start_address_start = 0x00000FF8;
    define symbol __region_uicr_bootloader_start_address_length = 0x4;
    define symbol __start_uicr_bootloader_start_address = __region_uicr_bootloader_start_address_start;
    define symbol __stop_uicr_bootloader_start_address = __region_uicr_bootloader_start_address_start + __region_uicr_bootloader_start_address_length;
    export symbol __start_uicr_bootloader_start_address;
    export symbol __stop_uicr_bootloader_start_address;
    define symbol __region_uicr_mbr_params_page_start = 0x00000FFC;
    define symbol __region_uicr_mbr_params_page_length = 0x4;
    define symbol __start_uicr_mbr_params_page = __region_uicr_mbr_params_page_start;
    define symbol __stop_uicr_mbr_params_page = __region_uicr_mbr_params_page_start + __region_uicr_mbr_params_page_length;
    export symbol __start_uicr_mbr_params_page;
    export symbol __stop_uicr_mbr_params_page;
    define symbol __region_mbr_params_page_start = 0x0007E000;
    define symbol __region_mbr_params_page_length = 0x1000;
    define symbol __start_mbr_params_page = __region_mbr_params_page_start;
    define symbol __stop_mbr_params_page = __region_mbr_params_page_start + __region_mbr_params_page_length;
    export symbol __start_mbr_params_page;
    export symbol __stop_mbr_params_page;
    define symbol __region_bootloader_settings_page_start = 0x0007F000;
    define symbol __region_bootloader_settings_page_length = 0x1000;
    define symbol __start_bootloader_settings_page = __region_bootloader_settings_page_start;
    define symbol __stop_bootloader_settings_page = __region_bootloader_settings_page_start + __region_bootloader_settings_page_length;
    export symbol __start_bootloader_settings_page;
    export symbol __stop_bootloader_settings_page;

    define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
    define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
    define block RO_END with alignment = 8, size = 0 { };

    initialize by copy { readwrite };
    do not initialize { section .noinit };

    keep { section .intvec };
    place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
    place in ROM_region { readonly,
    block RO_END };
    place in RAM_region { readwrite,
    block CSTACK,
    block HEAP };

    b) Application icf file contents

    /*###ICF### Section handled by ICF editor, don't touch! ****/
    /*-Editor annotation file-*/
    /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */
    /*-Specials-*/
    define symbol __ICFEDIT_intvec_start__ = 0x26000;
    /*-Memory Regions-*/
    define symbol __ICFEDIT_region_ROM_start__ = 0x26000;
    define symbol __ICFEDIT_region_ROM_end__ = 0x7ffff;
    define symbol __ICFEDIT_region_RAM_start__ = 0x20005618;
    define symbol __ICFEDIT_region_RAM_end__ = 0x2000ffff;
    export symbol __ICFEDIT_region_RAM_start__;
    export symbol __ICFEDIT_region_RAM_end__;
    /*-Sizes-*/
    define symbol __ICFEDIT_size_cstack__ = 2048;
    define symbol __ICFEDIT_size_heap__ = 0;
    /**** End of ICF editor section. ###ICF###*/

    define memory mem with size = 4G;
    define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__];
    define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__];


    define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { };
    define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { };
    define block RO_END with alignment = 8, size = 0 { };

    initialize by copy { readwrite };
    do not initialize { section .noinit };

    keep { section .intvec };
    place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec };
    place in ROM_region { readonly,
    block RO_END };
    place in RAM_region { readwrite,
    block CSTACK,
    block HEAP };

  • I notice above that you sometimes do a software reset, and in other cases do a power on reset. If you try a power on reset for all cases, do you measure a difference then?

Related