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

DOUBT IN OTA -DFU WITH BUTTON AND BUTTONLESS

HI

  •  We are developing a 2d-3d  mouse .
  •  We are trying to implement OTA-DFU into our  custom board .
  •  We first tried it on development kit and its working fine too . I can able to update the "ble_app_hids_mouse" into our DK using nRF Toolbox mobile app.
  •  We are using    "nRF5_SDK_14.2.0_17b948a".

I WILL EXPLAIN THE PROCEDURES I DID FOR IMPLEMENTING THE OTA -DFU

  • First i flashed the softdevice hex file to the DK.(s132_nrf52_5.0.0_softdevice.hex).
  • Then i flashed the bootloader hex with needed modification into the DK. (secure_dfu_ble_s132_pca10040_debug.hex).
  • Then LED1 and LED3  in DK will light up the device will enter into DFU mode by advertising as "DfuTrag".
  • Then using my android phone i uploaded the zip package containing the  application (ble_app_hids_mouse) hex file ,during  upload the LED2 and LED3 in the DK will turn on.
  • After successful upload the DK can use as a mouse by pressing the buttons.

MY DOUBTS

  1. When DK in DFU mode LED1 and LED3  will turn on, I checked the bootloader code but i didn't saw any function  to turn on the LED1 can you help to find in which c file or function LED1 was turning on . I saw the function to turn on the LED3 (inside leds_init())but i didn't findout the function to turn on LED1.
  2. Similarly during the upload is takeing place LED2 AND LED3 will turn on ,but i didn't saw any function  to turn on the LED2 please help to find in which c file or function LED2 was turning on .

 THIS IS BOOTLOADER CODE WE ARE USEING

nRF5_SDK_14.2.0_17b948a->nRF5_SDK_14.2.0_17b948a->examples->dfu->bootloader_secure_ble->pca10040_debug->ses.

PLEASE ANSWER TO MY 1 AND 2. IF YOU CAN POSSIBLE MAKE SCREENSHOT WHERE ITS TURNING ON  LED1 AND LED2 AND SEND TO ME. 

Parents
  • Hi, 

    Please take a look at <nRF5_SDK_14.2.0_17b948a>\components\libraries\bootloader\ble_dfu\nrf_ble_dfu.c: 

    #define ADVERTISING_LED_PIN_NO              BSP_LED_0                                               /**< Is on when device is advertising. */
    #define CONNECTED_LED_PIN_NO                BSP_LED_1                                               /**< Is on when device has connected. */

    and trace ADVERTISING_LED_PIN_NO and CONNECTED_LED_PIN_NO variables.

    -Amanda H.

  • Hi Amanda ,

           Thanks for the reply.

    NEXT DOUBT 

    • After OTA-DFU there is bootloader hex application hex  and softdevice hex in our nRF52832 soc.If we turn OFF the DK and turn ON what will the order of execution of  those hex file
    • i.e which hex file will execute first which one second .
  • Amanda ,

          In "ble_app_hids_mouse"  i didn't find the functions calling for configure to use the power management module.

    1. "power_management_init()" is not used  in "ble_app_hids_mouse"
    2. And also not used  this"nrf_pwr_mgmt_run();" in "ble_app_hids_mouse".Then how you conform that all the power management module is configured in "ble_app_hids_mouse".
  • Hi, 

    Yes, you are right. Please let me correct that:

    According to the sdk_config.h of "ble_app_hids_mouse", the POWER_ENABLED is 0. 

    To use nrf_pwr_mgmt_init() in the power_management_init, you have to enable the module as 

    // <e> NRF_PWR_MGMT_ENABLED - nrf_pwr_mgmt - Power management module
    //==========================================================
    #ifndef NRF_PWR_MGMT_ENABLED
    #define NRF_PWR_MGMT_ENABLED 1
    #endif

    You also need to check nrf_pwr_mgmt.c is in the Libaries. 

    <nRF5_SDK_14.2.0>\components\libraries\pwr_mgmt\nrf_pwr_mgmt.c

    -Amanda H. 

  • hi Amanda,

     I added all requested changes to add the buttonless dfu service to "ble_app_hids_mouse".

    But my code was execution was breaking ,when entering to the below function in services_init()

    • nrf_dfu_set_adv_name_init();  inside ble_dfu_buttonless_async_svci_init(void).

    please help me to solve these issue,

    Actually what is these "nrf_dfu_set_adv_name_init();" function doing

  • Hi, 

    NANDHU said:
    But my code was execution was breaking ,when entering to the below function in services_init()

    What error message does nrf_dfu_set_adv_name_init() returen? 

    This post and this post might help you. 

    NANDHU said:
    what is these "nrf_dfu_set_adv_name_init();" function doing

     It is answered in this post

     

    -Amanda H.

  • Actually there is no error is showing  .I just flashed the modified "ble_app_hids_mouse" which support buttonless dfu to the our board but its not advertising . so i debugged it using JLink then i noticed that when code execution is entering to " "nrf_dfu_set_adv_name_init();" but its not leaving from these function . 

    i don't known why .

    note:- i didn't flashed the bootloader hex to our board.

Reply
  • Actually there is no error is showing  .I just flashed the modified "ble_app_hids_mouse" which support buttonless dfu to the our board but its not advertising . so i debugged it using JLink then i noticed that when code execution is entering to " "nrf_dfu_set_adv_name_init();" but its not leaving from these function . 

    i don't known why .

    note:- i didn't flashed the bootloader hex to our board.

Children
  • Amanda ,

     I downloaded a new SDK and trying to implement buttonless dfu service to the "ble_app_hids_mouse"  .

    • The hardware we are using for test is only the development kit.(not our custom board).
    • we decided implement  the buttonless dfu service first on DK.
    • ble example using  to add buttonless secure dfu service is "ble_app_hids_mouse"  

    (C:\nordic_semi\nRF5_SDK_14.2.0_17b948a\nRF5_SDK_14.2.0_17b948a\examples\ble_peripheral\ble_app_hids_mouse\pca10040\s132\ses).

    PROBLEMS

    1. First i tryed to implement the power management module and i included to but its showing some warning .I will give its screen short below . please help me to overcome that warning.

    changes i made in code screen short are below

    I following the step by step procedures in the document given by you .if there is any error or warning getting during procedures i will inform you like these .Is it fine for you?

  • Hi NANDHU, 

    Add #include "nrf_pwr_mgmt.h"  at the top of main.c

    (Updated)

    To initial services, you can start by copying the code from services_init() in the ble_app_buttonless_dfu to the services_init() function in ble_app_hids_mouse. Make sure you add the files in the nRF_DFU folder, i.e. ble_dfu.c, ble_dfu_bonded.c and ble_dfu_unbonded.c to the ble_app_hids_mouse example. Make sure that you change NRF_SDH_BLE_VS_UUID_COUNT to 2 in sdk_config.h as well as increase the RAM allocated to the SoftDevice. 

    -Amanda H.

  • Thanks a lot . If there is any issue ,i will text you.

  • as well as increase the RAM allocated to the SoftDevice. 

    How can i increase the RAM allocated to the SoftDevice?

  • That is stated in the p_app_ram_start variable, or more correctly in the variable that p_app_ram_start points to, i.e. *p_app_ram_start . If you add p_app_ram_start to watch and then set a breakpoint after sd_ble_enable() you should be able to see which value points top_app_ram_start.

    Take a look at this video, it explains how to modify the build settings, including the memory settings.

    Also, see this post

    -Amanda H.

Related