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

The Buttonless DFU Template Application is not working on a custom board

Hi,

I am currently working on a custom product that uses module BMD-300 from u-blox, which has nrf52382 chip in it. My application works fine and now I want to integrate the Secure DFU function into it. I programmed the board with the DFU test image sd_s132_bootloader_buttonless_with_setting_page_dfu_secure_ble_debug_without_bonds.hex but I could not see it advertising when I scan for devices on nrf Connect. Does anyone know what problem could cause it to not advertising? I am using sdk v15.0.0.

Thank you in advance.

Parents
  • The BMD-300 lacks the 32768 Hz RTC (LFXO) quarz crystal that most Nordic examples require. You need to change the LF clock configuration in the source code and recompile - or populate the quarz circuit on XTAL1/XTAL2.

  • I tried your suggestion but the problem still exists. I followed the instruction on this link Add Nordic DFU to SDK Example from u-blox, and then changed the clock configuration afterward, but I still could not see it on the nRF Connect Scanner.

    Now I think the custom board may behave different than the eval board, so I go straight into modify my firmware, which I know is working, and the scanner can see the device. After following the instruction on the link above, I can connect to it through nRF Connect and see the DFU service, but the device is frozen after a few seconds. Same thing happened when I use nRF Connect on Android. The nRF Connect on iOS, on the other hand, can connect to the device without any problem, but it doesn't see the DFU service.

    I know these maybe 2 different problems, but I just want to put it here in case you (or anybody) know the answer for the problems.

  • The fact that the device freezes after you try to enable the DFU service and that the bootloader example is not advertising sounds like the same issue.

    Your bootloader project compiles without warnings or errors? Try to rebuild the solution to see if there are any warnings.

    I don't know how you ported this project to your board. What did you do with the pca10040.h file? I assume you replaced it with a separate file? What did you do with LEDS_NUMBER and BUTTONS_NUMBER?

    Can you try the project found in SDK15.0.0\examples\dfu\secure_bootloader\pca10040_ble_debug?

    Try to monitor the RTT log. What does it say? It requires you to have the debugger connected, and use either Segger's RTT Viewer, or use the Segger Embedded Studio(SES)'s debug session.

    The reason you need to use the pca10040_ble_debug project is because there is not enough flash set aside for the non-_debug example to enable logging.

    Best regards,

    Edvin

  • Can I test the bootloader without my application hex file? If yes, how can I do it? Without the application, nRF Connect cannot find the board with scanner.

    Thanks,

    Vu

  • Yes, If you program the softdevice and the bootloader, but no application, it should advertise as "DfuTarg". If it doesn't, try to program the _debug project from the same folder (dfu\secure_bootloader\pca10040_uart_debug).

    Look at the log from the bootloader's _debug project and see what it says. It is also possible to disable optimization and debug the bootloader's _debug project.

Reply
  • Yes, If you program the softdevice and the bootloader, but no application, it should advertise as "DfuTarg". If it doesn't, try to program the _debug project from the same folder (dfu\secure_bootloader\pca10040_uart_debug).

    Look at the log from the bootloader's _debug project and see what it says. It is also possible to disable optimization and debug the bootloader's _debug project.

Children
  • Here is the log when I run the _debug project. I still can't see the Dfu Targ device when scanning on nRF Connect

  • Now when I rerun it I got an error

    Tracing in the code, line 61 is in the function __WEAK void app_error_fault_handler(uint32_t id, uint32_t pc, uint32_t info), which is called in sd_softdevice_enable(&clock_lf_cfg, app_error_fault_handler) or __WEAK void assert_nrf_callback(uint16_t line_num, const uint8_t * file_name). The clock is set as follow:

    nrf_clock_lf_cfg_t const clock_lf_cfg =
    {
    .source = NRF_CLOCK_LF_SRC_RC ,
    .rc_ctiv = 0,
    .rc_temp_ctiv = 0,
    .accuracy = NRF_CLOCK_LF_ACCURACY_500_PPM
    };

  • Try setting:

    NRF_SDH_CLOCK_LF_RC_CTIV = 16 and

    NRF_SDH_CLOCK_LF_RC_TEMP_CTIV = 2 in sdk_config.h of your bootloader project.

    You should set these equal to what you set them to in your application's sdk_config.h file.

  • Thank you, my bootloader works now. But my application still freeze after connect on nRF Connect on PC (I haven't even tried to connect to DFU yet). On iOS, I can connect to nRF Connect without freezing, but cannot get into DFU mode. What do you think could cause the problem?