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

My application board DFU example project in strange way

Hi There

 

I am debugging my application board by light-swtich server project of Mesh example and " pca10056_s140_ble_debug " project of SDK example dfu.

My application board can be programmed by P19 of DK(pca10056) and " Bluetooth Low Energy " desktop tools or SES. I also have a PDK(ca10056) which will be used for DFU_BLE.

My application board is same with the nrf52840 in PCA10056.

For match my application board, I modified the " pca10056_s140_ble_debug " project and made the "NRF_BL_DFU_ENTER_METHOD_BUTTON_PIN" to 26. The Mesh example light-switch server also be modified the LED and button in pca10056.h

Test 1: For test the light-switch server project works

After erasure the application board by "nrfjprog -e" command, the light-switch server be programmed in the board:

          LED blink together when it start                 --------------ok

          Send a device name on RF(be test by iphone connect or desktop's " Bluetooth Low Energy " )--------------ok

          Button control the LED turn on or off           ----------ok

          Be controlled by Mesh tools of IPhone         ---------ok

Test 2: For test the DFU project works

After erasure the application board by "nrfjprog -e" command, the pca10056_s140_ble_debug of secure_bootloader DFU be programmed in the board:

          LED1-2  turn on when it start                     --------------ok

          Send a device name "DfuTarg"on RF(be test by iphone connect or desk " Bluetooth Low Energy " )---------------ok

          Button 4 +power up can enter the dfu mode (the second dfu)        ----------ok

          Can complered the BLE dfu process by both of iphone's connect and desktop's " Bluetooth Low Energy "   -------ok

 

Test 3: For test the DFU project can dfu the light-switch server project and make it works

          After erasure the application board by "nrfjprog -e" command, the pca10056_s140_ble_debug of secure_bootloader DFU be programmed in the board(same with test2)

          By desktop's " Bluetooth Low Energy ", the DFU package of light-switch server which be generated by nrfuitl command can be programmed to the application board:

           The LED donot blink together when the dfu be completed ---------not right here

           The button can control the LED turn on or turn off   --------------ok

           There is no a device name be sent on RF --------------------------not right here

           When push button 4 and power up, the device can enter the dfu mode  -----------ok

 

Is there some one can help to find the reason? What is wrong I did?

Thanks,

 

B,Rs

 

Di-sheng

Parents
  • Hi Di-sheng, 

    To sum up what you described, everything worked for  you until you do DFU the mesh application using the BLE bootloader. You can successfully upload the image but the image doesn't run as expected, it doesn't advertise even though when you press a button it changed the LED. 

    Please check the log of the mesh application to see what's wrong. I assume if you run the application without the bootloader (app+softdevice) it works fine ? 
    Note that you can step into the application and debug it normally after you do DFU update, the same as you flash it using programmer. 

Reply
  • Hi Di-sheng, 

    To sum up what you described, everything worked for  you until you do DFU the mesh application using the BLE bootloader. You can successfully upload the image but the image doesn't run as expected, it doesn't advertise even though when you press a button it changed the LED. 

    Please check the log of the mesh application to see what's wrong. I assume if you run the application without the bootloader (app+softdevice) it works fine ? 
    Note that you can step into the application and debug it normally after you do DFU update, the same as you flash it using programmer. 

Children
  • Hi Hung Bui

     

    Thanks for your reply.

     

    The first one, The dfu and light-switch server project have been verified on DK, The light-switch server project can be upload the image of the light-switch server project with SD (S140)  and every thing is good.

    The second, the dfu work well on application board, which mean I can push the button 4 when power up make the device enter the dfu mode any time.

    The third, If program the light-switch server project to application board directly without dfu bootloader, it work very well.

    The last one, after the light-switch server project be uploade to application board by bootloader of the dfu, it works, I think, because I still can change the LED state by push the button. But the RF do not work and the action of 4 LEDs flashing together when power up is gone.

    Others, Althrough the RF of the light-switch server do not work, the device still can enter the dfu mode by power up with pushing the button 4.

    It is strange, that just a part of the light-switch server project run. What I do not understand is what reason can stop the RF,because all of them works when they run on DK or run on application board separately.

     

    I also debug the code by SES (Debugà). When the " __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "----- BLE Mesh Light Switch Server Demo -----\n"); " function start, The flash from 27000 to 27fff rang be erasured by SES. Then, If keep going on to debug the code, the code will stay at " SVCALL(SD_SOFTDEVICE_ENABLE, uint32_t, sd_softdevice_enable(nrf_clock_lf_cfg_t const * p_clock_lf_cfg, nrf_fault_handler_t fault_handler))" function fever. After that, the code in application board is damaged.

    Would you help me to find the reason.

     

    Thanks,

     

    B,Rs

     

    Di-sheng

  • Hi, 

    Could you please test to do DFU update : 

    1. A normal BLINK LED example 

    2. A normal BLE example from nRF5 SDK. (ble_app_hrs for example)

    3. The light switch server example, but you put a infinite loop before sd_softdevice_enable() call ( before you initialize the stack)

    Also please let us know which NRF5 SDK version you used, which softdevice you use and which nRF Mesh SDK version. 


    I suspect that the reason why RF doesn't work but the button works is that the button press action is an interrupt handler. So maybe the CPU is stuck in a dead loop but when you press the button it will jump to the button handler(). 

    Please check if you have the 32kHz crystal on the application board or not. 

  • Hi Hung Bui

    Thanks for your reply.

    It works. I think I did something wrong when I make the project separte from  Mesh protocol stack.

    I did them again and everything is ok now.

    Thanks,

    B,Rs

    Di-sheng

Related