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
  • I'm not familiar with DAP debugger, but as far as I know you should be able to set a breakpoint and step using GDB. As in this link .

    What you need to do is to add a breakpoint inside app_error_handler() and check what error and which line cause the issue. 

    I'm not sure how you build your application without debugging ability ? 

    It's strongly recommended to get hold of a nRF52 DK. You can use the DK as a Jlink debugger. 

    One question, why do you use SDK v11  ? The latest SDK is v15.3

Children
  • Yes I Know that SDK15.3 is the latest version, but for my project needs i use SDK11 version.

    So, I have devlopped a Python application that integrate a dfu process and fit the dfu exmple project that you have provide in sdk11.

    The problem with this example is that they use Button to enter in DFU mode and for my project needs , the dfu should bye placed in Bootloader not in the Application that's why i look for an example of bootloader thats not need tu use button to enter in dfu mode.

  • Hi, 

    Please first make sure you have tested the buttonless example and you can do a DFU update without a button. 

    Then you can start integrate it into your application. Please make sure you have configured the memory properly. Increase the vs_uuid_count in the softdevice enable configuration, before calling softdevice_enable()

  • 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 ?

Related