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

Device name too short?

When trying out the ble_app_hrs_freertos example in nRF5 SDK 11.0.0-2.alpha_bc3f6a0, I seem to only get 14-character long device name announcements.

This happens when using components/softdevice/s132/hex/s132_nrf52_2.0.0-7.alpha_softdevice.hex.

I haven't had a chance yet to try it with s132_nrf52_1.0.0-3.alpha_softdevice.hex, which I had experience using from the nRF52 SDK 0.9.2.

Parents Reply Children
  • Also: The Makefile that I'm using is in: nRF5_SDK_11.0.0-2.alpha_bc3f6a0/examples/ble_peripheral/ble_app_hrs_freertos/pca10036/s132_with_dfu/armgcc, and it's the gcc 5.2.1 toolchain from Launchpad.

  • So you've modified this line in ./examples/ble_app_hrs_freertos/main.c file:

    #define DEVICE_NAME                          "Nordic_FreeRTOS_HRM"                      /**< Name of device. Will be included in the advertising data. */
    

    Right? Have you seen full "Nordic_FreeRTOS_HRM" name in the same Android menu when compiled as it goes with SDK? It doesn't look like length problem (because original string is longer then yours) but rather either parsing bug in nRF5 SDK (e.g. in srtlen() function) or in Android. Should be easy to see what is actually broadcasted over the air (with any BLE sniffer).

    Cheers

  • Yes, that's the line I modified.

    When I run the example app straight from the SDK, I only see "Nordic_FreeRTO".

    It's not an Android issue, I've used longer device names using the nRF52 0.9.2 SDK UART example app with the older s132_nrf52_1.0.0-3.alpha_softdevice.hex.

  • Oh then it's really either limitation in the SoftDevice (because device name get provisioned by sd_ble_gap_device_name_set() function call and it doesn't crash) or Android. If I understand behavior of SD correctly (and also suggested by Anders's comment above) it seems unlikely that Soft Device would shorten the string. However we cannot rule it out unless either Nordic guys look into their source code/tests or you take a sniffer and look into packet which is actually exchanged between your Peripheral and phone.

  • Hmm.

    Unfortunately, I only have access to an nRF52832 DK (PCA10036) and an nRF51422 development dongle (PCA10031), so I'm not sure I can run the Nordic Sniffer firmware here.

    Like I said, the previous version of the SoftDevice did not have this issue. And my Nexus 5 phone (stock 6.0.1, Marshmallow, with February 1, 2016 security patch level) did not have a problem with longer device names.

    My feeling is that the Nordic implementation is at issue here, as I have changed nothing else and if I do put an older SD onto the same nRF52832 chip, everything works fine with longer device names.

    If someone at Nordic could take a look at running the HRM app sample, it'd be greatly appreciated.

Related