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.

  • I also want to clarify that I don't use bonding in my application.

  • So now it isn't working anymore? I must say I am a bit confused about what's going on here. Did you try to monitor the log?

  • Okay sorry the confusion. Here is the summary of the problem so far:

    - The whole DFU process is working okay with nRF Connect on iPhone. I can connect to the app, and download the new firmware through DFU service.

    - With the same firmware, my application cannot connect to nRF Connect on both PC and Android phone. The application has a HardFault a few seconds after connected.

    + I did monitor the log, and it stops after the "BLE_GAP_EVT_DATA_LENGTH_UPDATE" event. There is no error message. I can show you the whole log if you need.

    + When I used nRF Connect on Android to connect to my application, I received "Error 133 (0x85): GATT ERROR" message on the Android app.

    + When I ran debugger with IAR, I got the message "The processor has escalated a configurable-priority exception to HardFault. Exception occured at PC = 0x2dd22, LR = 0x2dd71". The memory locations are shown in the comment above.

    + This problem is not related to the DFU bootloader I believe, because I took out the bootloader and the problem still exists.

  • Since it's not related to the original question, do you want me to open a new thread for it?

  • Does this mean that sd_ble_gap_conn_param_update() returns something other than 0? If so, what does it return?

    Did you do any changes to the bootloader project other than the pin configurations to match your custom PCB?

    Have you tried to do a sniffer trace? I suspect that the nRF just stops responding if it is in fact a hardfault.

    Have you possibly done any changes to the files that are common in the SDK? Can you try to unzip a new SDK, and copy paste the bootloader project into this SDK? Does the issue still occur?

    What was the connection parameters that the phone or PC wants in the connection parameter update? A sniffer trace will show this, or you can try to debug, and look at the p_new_conn_params.

    So:

    1: Can you try with an unmodified SDK?

    2: What is the p_new_conn_params in the send_update_request()? (and what is it when you connect with the iPhone?)

    3: What does sd_ble_gap_conn_param_update() return?

Reply
  • Does this mean that sd_ble_gap_conn_param_update() returns something other than 0? If so, what does it return?

    Did you do any changes to the bootloader project other than the pin configurations to match your custom PCB?

    Have you tried to do a sniffer trace? I suspect that the nRF just stops responding if it is in fact a hardfault.

    Have you possibly done any changes to the files that are common in the SDK? Can you try to unzip a new SDK, and copy paste the bootloader project into this SDK? Does the issue still occur?

    What was the connection parameters that the phone or PC wants in the connection parameter update? A sniffer trace will show this, or you can try to debug, and look at the p_new_conn_params.

    So:

    1: Can you try with an unmodified SDK?

    2: What is the p_new_conn_params in the send_update_request()? (and what is it when you connect with the iPhone?)

    3: What does sd_ble_gap_conn_param_update() return?

Children
  • The p_new_conn_params is:

    When I connect with iPhone the send_update_request() is never called as it never reached my breakpoint there.

    sd_ble_gap_conn_param_update() does not return as the hardfault is at 0x2dd76:

  • I want to clarify again that this has nothing with the bootloader project, the custom board only contains my own application and the soft device. The only file I change in SDK for my application project is the bsp.c in sdk\component subfolder.

  • Oh, I am sorry. I thought the HardFault was in when the bootloader was running, but I see, it is in the application. I didn't see the comment that you took out the bootloader.

    Can you try to turn off optimization and check what function call that is the last one that is called? Are you sure sd_ble_gap_conn_param_update() is called? Because the address that it refers to looks like it is outside the softdevice. You are using s132v6.0.0, right? Can you confirm that sd_ble_gap_conn_param() is called? If not, what is the last call that is called before the hardfault?

    I can't say that I have seen this message before:

    "The processor has escalated a configurable-priority exception to HardFault. Exception occured at ..." Where does this message come from?

    Are there any functions that returns something other than NRF_SUCCESS? Have you removed  any of the APP_ERROR_CHECK(); calls that are softdevice related? Does the log say anything other that suggests that something is wrong? Can you send a copy of the log?

    Is there any way for me to reproduce this?

    Best regards,

    Edvin

  • Can I send you my project? I will take out everything except the BLE part. It's for module BMD-300 from u-blox, but I guess you can try it with any Nordic nrf52382 kit.

  • Sure. Make sure that it compiles in an unmodified SDK. Just zip the project folder (pca_10040_ble_debug).

Related