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

Bootloader for nRF51422 ?

Hello Everybody,

I need to write a boot loader for nRF51422. Any suggestion for it, reference site ,sample code for quick reference ?

thanks and regards Robin Singh

  • Hi Robin,

    have you looked at the bootloader example from the nRF51822 SDK? It cannot be used directly on the nRF51422 yet, but it might serve as a reference for you. It includes two ways of transferring the updated image, serial transfer (UART) and over-the-air (BLE).

    The nRF51422 SoftDevice is being updated to offer the same bootloader functionality as the nRF51822 one. Once that happens, the nRF51822 bootloader example will be directly applicable. When this update is released you might have to get a updated silicon revision of the nRF51422 though..

    Audun

  • Hi Audun/All,

    I am referring the device firmware update example from nrf51822 and trying it for nrf51422. but i face on problem about IROM and IRAM setting and jump to final application.

    First it seems to be if i flash any sample program other then 0xA000 , it does not work. Do i need to modify any setting for it. or soft device always jump to 0xa000 ?

    1. i am trying to flash the bootloader @0x1A000 and APP at 0xA000 . it is not working for me. any suggestion ? what setting i need to modify on nRF51422

    2. i tried another approach, boot loader at 0xa000 and size = 0x26000 then app at 0x30000 size = 0x2800. i am writing a .hex file as app on 0x30000. but when i jump to app via function pointer at 0x30000 , it does not boot this app. ========================================================= my sample code snippet:

        start_packet_handle(); //just setup and erase the flash 
        data_packet_handle();//here i write the .hex file to 0x30000
      

      //uint32_t n_err_code = sd_softdevice_disable(); //this i tried to comment out and with out comment out. // APP_ERROR_CHECK(n_err_code); //(void)sd_softdevice_forward_to_application(); // i do not have this call on softdevice.

      my_application_main_t application_main = *(my_application_main_t *)(0x30000+4); if (application_main != (my_application_main_t) 0xFFFFFFFF) {

       application_main();
      

    }

    1. My application image is a sample uart program from ANT sample code , with IROM start = 0x30000 and size = 0x2800.

    can you please suggest me what i am missing ?

    1. why i am not able to find out this api sd_softdevice_forward_to_application(); does it only for BLE chipset?

    on nrf51422 sdk. compiler says its not defined ?

    thanks Robin Singh

  • "The nRF51422 SoftDevice is being updated to offer the same bootloader functionality as the nRF51822 one. Once that happens, the nRF51822 bootloader example will be directly applicable. When this update is released you might have to get a updated silicon revision of the nRF51422 though"

    So does it mean i can not write a uart based boot loader for nrf51422? until you guys update the soft device ?

  • You are free to write any bootloader you'd like. But without softdevice support there is a weak point when upgrading the first flash page of the application space (where the interrupt vectors are). If this flash page write fails (power loss for example) you risk getting in an unrecoverable error. When supported, the softdevice can be configured to forward interrupts to a bootloader residing anywhere in flash.

Related