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

  • I wish you peeps would fix this web page issue where I cannot see edit!!!!

    Oh and the same problem arises with the none debug version.

  • Also how do you find where the debug messages are being generated?

    <debug> nrf_dfu_ble: No advertising name found

    Yeah and where the heck is this generated from - using SES. I had to use a utility to search through the files on my hard drive!!!! Surely at the very least you could have put the name of the files where the message was generated within the message!!! Or am I missing something?

  • Ahhh found it: Top menu Search and option find in files. Well at least that's something. (Next version of SES have a right click option (or double click) onthe actual debug line and go search...Slight smile )

  • In nrf_dfu_ble.c I found some code

    #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

    So as far as I can tell by setting a break point m_flags is zero and DFU_BLE_FLAG_USE_ADV_NAME is decimal 2 binary 10

    So, and I admit my bitwise boolean algebra might be rusty but doesn't that give us 0000000000 = false?

    Probably irrelevant as m_adv_name.name is 0 anyway.

    However, it does point to the variable (struct)  m_adv_name, so where is that set?

    It is defined in this file, but I can't see where it's value is set? Has it been set? (if it's a static struct does that mean it's scope exists throughout the solution?)

  • And just as a matter of interest has anyone ever considered that it might be rather helpful to have some code comments that actually EXPLAIN what each c file is doing and it's purpose. This code is hopeless. How many variables and definitions and names do you actually need to just get an advertisement name... ? Honestly, it's a security minefield, anyone could put backdoors and whatever in this code and no-one would ever know.

Related