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

Buttonless ble dfu example not working in sdk v15.0.0

Hello,


I would like to use the bouttonless dfu feature in my application, but I have not been able to run the sdk example ble_app_buttonless_dfu.

The application does not work like the compiled example "ble_app_buttonless_dfu_without_bonds_s132_with_setting_page.hex" in the folder "examples \ dfu \ secure_dfu_test_images \ ble \ nrf52832", there is no advertising, the led does not flash. But if we press button 4 the bootloader starts.

Before trying the buttonless example, I tried with the bootloader compiled with my own dfu public key, then generated the setting page with my application and it works well.
So I think it's not a bootloader problem.

I use sdk v15.0.0 and compile with gcc (arm-none-eabi v7.2.1)

I use the NRF52-DK development platform.

As I have not managed to use the example ble_app_buttonless_dfu as it is, I find myself stuck in my project.

I also read the other topics related to the DFU BLE, but it is not the same version of sdk, or the same problem.

Can you help me find a solution?

Thank you very much,

Parents
  • Hello,

    I start by checking with the nRF52-DK then I try on a module SKB369 (without LF XTAL). Ido not have a debugger, only the one built into the NRF52-DK.

    I tried starting all over again from the beginning:

    1. unzip nRF5_SDK_15.0.0_a53641a.zip

    2. Edit components/toolchain/gcc/Makefile.posix with my configuration:

    GNU_INSTALL_ROOT ?= /home/julien/opt/gcc-arm-none-eabi-7-2017-q4-major/bin/
    GNU_VERSION ?= 7.2.1
    GNU_PREFIX ?= arm-none-eabi

    3. build ble_app_buttonless_dfu example

    4. download and build micro-ecc

    unzip micro-ecc (https://github.com/kmackay/micro-ecc) inside external/micro-ecc/ folder

    chmod a+x build_all.sh

    ./build_all.sh

    5. build secure_bootloader dfu example (debug version):

    cd examples/dfu/secure_bootloader/pca10040_ble_debug/armgcc/

    make

    6. Create bootloader settings for ble_app_buttonless_dfu example:

    nrfutil settings generate --family NRF52 --application ble_app_buttonless.hex --application-version 1 --bootloader-version 1 --bl-settings-version 1 bootloader_setting_page.hex

    7. merge application with settings page:

    mergehex --merge ble_app_buttonless.hex bootloader_setting_page.hex --output ble_app_buttonless_with_setting_page.hex

    8. flash NRF52-DK.

     

    I have Led1 blinking, so i think the application works with a debug bootloader.

    then I tried with the normal version, after re-generating the private and public keys and it worked.

    I compared the original "components" folder with that of my project and I saw that I made some modifications:

    components / toolchain / gcc / Makefile.posix differ (gcc configuration)
    components / boards / boards.h differ (add my custom board)
    components / boards / SKB369.h new (custom board definition file)
    components / libraries / bsp / bsp.cdiff (add BSP_BUTTON_ACTION_RELEASE event in switch-case structure)
    components / libraries / bsp / bsp.h differ (add BSP_EVENT_KEY_x_PUSH and BSP_EVENT_KEY_x_RELEASE in bsp_event_t structure)

    I added each change one by one in the original code and it still works with NRF52-DK board.

    I would not know where the problem came from but I think it is corrected, Thank you!

    New problem: I can not operate the buttonless application if I disable the LF quartz (cut SB1 and SB2 short).

    Bootloader works well but not the application. I configured well in sdk_config.h for both:

    For bootloader:

    // ================================================ ==========

    // <h> Clock - SoftDevice clock configuration

    // ================================================ ==========
    // <o> NRF_SDH_CLOCK_LF_SRC - SoftDevice clock source.
     
    // <0 => NRF_CLOCK_LF_SRC_RC
    // <1 => NRF_CLOCK_LF_SRC_XTAL
    // <2 => NRF_CLOCK_LF_SRC_SYNTH

    #ifndef NRF_SDH_CLOCK_LF_SRC
    #define NRF_SDH_CLOCK_LF_SRC 0
    #endif

    // <o> NRF_SDH_CLOCK_LF_RC_CTIV - SoftDevice calibration timer interval.
    #ifndef NRF_SDH_CLOCK_LF_RC_CTIV
    #define NRF_SDH_CLOCK_LF_RC_CTIV 16
    #endif

    // <o> NRF_SDH_CLOCK_LF_RC_TEMP_CTIV - SoftDevice Calibration timer interval under constant temperature.
    // <i> How often (in a number of calibration intervals) the RC oscillator shall be calibrated
    // <i> if the temperature has not changed.

    #ifndef NRF_SDH_CLOCK_LF_RC_TEMP_CTIV
    #define NRF_SDH_CLOCK_LF_RC_TEMP_CTIV 4
    #endif

    // <o> NRF_SDH_CLOCK_LF_ACCURACY - External clock accuracy used in the LL to compute timing.
     
    // <0 => NRF_CLOCK_LF_ACCURACY_250_PPM
    // <1 => NRF_CLOCK_LF_ACCURACY_500_PPM
    // <2 => NRF_CLOCK_LF_ACCURACY_150_PPM
    // <3 => NRF_CLOCK_LF_ACCURACY_100_PPM
    // <4 => NRF_CLOCK_LF_ACCURACY_75_PPM
    // <5 => NRF_CLOCK_LF_ACCURACY_50_PPM
    // <6 => NRF_CLOCK_LF_ACCURACY_30_PPM
    // <7 => NRF_CLOCK_LF_ACCURACY_20_PPM
    // <8 => NRF_CLOCK_LF_ACCURACY_10_PPM
    // <9 => NRF_CLOCK_LF_ACCURACY_5_PPM
    // <10 => NRF_CLOCK_LF_ACCURACY_2_PPM
    // <11 => NRF_CLOCK_LF_ACCURACY_1_PPM

    #ifndef NRF_SDH_CLOCK_LF_ACCURACY
    #define NRF_SDH_CLOCK_LF_ACCURACY 1
    #endif

    For buttonless_dfu application the same modification as above and also:

    #ifndef CLOCK_CONFIG_LF_SRC
    #define CLOCK_CONFIG_LF_SRC 0
    #endif

    #ifndef NRFX_CLOCK_CONFIG_LF_SRC
    #define NRFX_CLOCK_CONFIG_LF_SRC 0
    #endif

    But the buttonless_dfu application always runs only with the LF quartz (if I reconnect the shorts SB1 and SB2, it works).

    Can you help me for this problem too?

  • Hi,

    It should be enough to set CLOCK_CONFIG_LF_SRC to 0 (RC). Can you verify that you are modifying the correct sdk_config.h? Can you verify with a debugger or by printing/logging the value that NRFX_CLOCK_CONFIG_LF_SRC and CLOCK_CONFIG_LF_SRC really have the expected value (0)?

Reply Children
No Data
Related