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

nRF5_SDK_17.0.2_d674dde\examples\dfu\secure_bootloader\pca10056_s140_ble_debug\ses won't advertise DfuTarg name

So I now have nRF 52840 dk and I'm working through the secure bootloader example. I am using SES. (Windows).

So I built and flashed the the app and it looks fine, it has Leds 1 and 2 lit and the software layout looks fine (in nRF Connect)

In trying to use the Connect J-Link, I see the output (in part)

<debug> nrf_dfu_ble: Enabling the BLE stack.
<debug> nrf_dfu_ble: No advertising name found
<debug> nrf_dfu_ble: Using default advertising name
<debug> nrf_dfu_ble: Advertising...

As far as I know the advertising name is defined in the sdk_config.h?

// <s> NRF_DFU_BLE_ADV_NAME - Default advertising name.
#ifndef NRF_DFU_BLE_ADV_NAME
#define NRF_DFU_BLE_ADV_NAME "DfuTarg"
#endif

I've tried following the code and stepping into, but it's a rabbit warren and I got lost.

Can you help please.

Gordon

  • The code seems to be failing at this point in the nrf_dfu_ble.c file line ~940

    #if (!NRF_DFU_BLE_REQUIRES_BONDS)
    
        err_code = gap_address_change();
        VERIFY_SUCCESS(err_code);
    
        if ((m_flags & DFU_BLE_FLAG_USE_ADV_NAME) != 0)
        {
            NRF_LOG_DEBUG("Setting adv name: %s, length: %d", m_adv_name.name, m_adv_name.len);
            device_name = m_adv_name.name;
            name_len    = m_adv_name.len;
        }
        else
    #endif
        {
            NRF_LOG_DEBUG("Using default advertising name");
            device_name = (uint8_t const *)(NRF_DFU_BLE_ADV_NAME);
            name_len    = strlen(NRF_DFU_BLE_ADV_NAME);
        }
    
     

    It jumps to the 

    NRF_LOG_DEBUG("Using default advertising name");
    device_name = (uint8_t const *)(NRF_DFU_BLE_ADV_NAME);

    but the device name symbol is not found according to the debugger quick watch.

    It is apparently set in gap_params_init()

    This I have discovered is often called in main.c. I tried it in main.c in this app but it didn't like it. 

    I couldn't see where in this project this is called? 

    Am I on the wrong lines here?

  • Hi,

    There is a lot of information in this thread but I feel a overview is lacking. Just to be clear, the example bootloader in the SDK will advertise with the DfuTarg name by default when it is in DFU mode. If it does not, then the question is which modifications you have done and what you wanted to achieve by those?

    In your last post you refer to nrf_dfu_ble.c, which is the implementation for the buttonless DFU service that is used to put the device in DFU mode. This also sets a different name if not bonded to work around a limitation in iOS. So if you start buttonless DFU unbonded, the name is changed to a unique name so that the phone/DFU master can filter on that name in order to connect to the correct device again. This is needed as iOS does not have APIs operating on the BLE address. As I am not sure of the real issue or what you really want to do I cannot say if this is relevant, but if you want to se an example of this in use you can refer to the Buttonless DFU Template Application.

  • Quote "

    Hi,

    "There is a lot of information in this thread but I feel a overview is lacking"

    How rude.

    Did you read the first post?  The rest of the thread is to show what I have attempted to solve the problem whilst awaiting some reponse from Nordic!

    I'll repeat it. 

    In SES I opened the C:\nRF52840\nRF5_SDK_17.0.2_d674dde\examples\dfu\secure_bootloader\pca10056_s140_ble_debug\ses\secure_bootloader_ble_s140_pca10056_debug.emProject

    I created my public key and replaced the dfu_public_key.c with mine (renamed of course)

    I cleaned the solution

    I built the solution

    I target>erase all the nRF52840 dk

    I target>download secure bootloader_ble_s140_pca10056_debug

    I verify it, no error

    On the board are two leds lit, LED1 and LED2

    The green (power/flashing) led to the left of the chip is on.

    I open up nRFConnect on my android phone,

    I refresh, I scan for devices. No device with an advertisement of DfuTarg seen. I expect this,

    I debug the 

    It says: No advertising name found

    !!!

    I haven't changed anything, this is purely Nordic code.

    Hopefully that is now clear enough?

  • btw why did you mention ios, I'm not using an iPhone?

Related