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

Bootloader DFU stop advertising after updating new firmware

Hello,

I'm using this example of code (nRF5_SDK_11.0.0_89a8197\examples\dfu\bootloader\pca10040\dual_bank_ble_s132\arm5_no_packs) with my custom board  to perform a dfu. So in this it"s seems to support use of button but in my case there is no button on board so i disabled the below code:

//dfu_start |= ((nrf_gpio_pin_read(BOOTLOADER_BUTTON) == 0) ? true: false);

and all  related function thats use BOOTLOADER_BUTTON.

1. is the desactivation of the button code can run the app as if there was no button on board or there is another trick to enter the DFUmode without using the button. ? 

2. I have another issue ; i have downloaded an hex file over the air, the DFU work well , and bootloader give control to the application but stop advertinsing.as "DfuTrgt" si i can't perform another dfu . Do you have any idea where and how to change code  in order to perform dfu again even if application ?

Best regards

Parents Reply Children
  • Hi Hung Bui,

    I Have not test the Buttonless example, I have creat  a Custom Service in My Application that trigger Bootloader to enter in DFU Mode . So I have added somme line in Bootloader main code to creat shared area where i place flag that  my app change when i wont to enter DFU Boot mode.

    		if (flag == 1) 
    		{			
    			dfu_start= true;
    			flag = 0;
    		}

    So, the problem is i can't get the flag change after soft rest . Can you please tell me the correct way to set the flag after boot to valid application.

    Kindly regards

  • Please tell exactly how you share the flag variable ? How do you switch from application to bootloader ?

    Note that RAM get reset when you trigger a soft reset . 

    You would need to either use retention register (GPREGRET) or use flash to store the data of the flag. 

  • Hi Hung Bui,

    I have added  share memory  flash adrress between bootloader and application.So its a simple way to force bootloader to  enter bootloader mode by  writing  "true" value in to this memory adress from the application and make a prompt test to the above "flag" variable.

    Now Im facing another issue, it's about power consumption. The software that's im use to send app image ,transmitt about 200 Byte every 1s and my app image is about 33KByte, So i spend more 3 min to download all the image. 

    During the download, Bootloader DFU draw 5mA every 1s, so for 3min I consume 900 mA. 

    My question is, there is any way to reduce power consumption ?

  • Usually we use a retention register instead of a shared RAM area but I think it would be fine. 

    200 byte per second is very low. I would assume that it's the limitation on the peer device, not because of the nRF52 ? 

    I'm not sure I understand what you meant by 5mA every 1s. Do you mean 5mAh  ? Current can't be measured over time.

    Or it's the constant 5mA current you are seeing ? 

    Are you using our unmodified bootloader ? 

  • Hi,

    thank you for replay. I have attached some screenshot to show current drawing in different phase bootloader runing.

    In this picture, bootloader continue to consume current even if is waiting for image packets (Here Peer device doesn't start sending image file).

     

    Here, peer device start sending packet

    and after finshed image downloding there is a current peak  consumption due to the transition from bootloader to the application

    i hope it a bit clear now. 

    "Are you using our unmodified bootloader ? "

    yes, i m using unmodified bootloader.

Related