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

device could not be found due to changes in m_adv_uuids[]

Hi expert,

I'm working for my project that make a controller for drone, and that i need nus for as my service so i can exchange the data (send order via rx from smartphone) so i'm using ble_app_templat as my basis for esthablishing a connection, and it works and then i want to implement my NUS, theoritically I just should  change uuid and the service so the nus could be implemented

but as i change m_adv_uuids[] my device could not be found anymore.

I change it from

static ble_uuid_t m_adv_uuids[] =                                               /**< Universally unique service identifiers. */
{
    {BLE_UUID_DEVICE_INFORMATION_SERVICE, BLE_UUID_TYPE_BLE}
};

to

static ble_uuid_t m_adv_uuids[] =                                               /**< Universally unique service identifiers. */
{
		{BLE_UUID_NUS_SERVICE, NUS_SERVICE_UUID_TYPE }
};

I also try these

static ble_uuid_t m_adv_uuids[] =                                               /**< Universally unique service identifiers. */
{
		{BLE_UUID_NUS_SERVICE, BLE_UUID_TYPE_BLE}
};

it works, my device could be found but i got another problem it shows an error "the handle is invalid" in nrf toolbox app as i want to check the uart.

could anyone help me?

thanks in advance

Andhika

  • Hi,

    How have you defined BLE_UUID_NUS_SERVICE? Did you include ble_nus.h in your project? Please take a look at the ble_app_uart example. This example runs the Nordic UART Service (NUS) and can be found under 'examples/ble_peripheral/ble_app_uart' folder.

    The Nordic UART service is a custom service, so we use a 128-bit vendor specific UUID and you need to use UUID type BLE_UUID_TYPE_VENDOR_BEGIN.

    You can change the base of the 128-bit vendor-specific UUID by changing NUS_BASE_UUID in ble_nus.c if you want (for example if you want to create a custom UART service for your application), please take a look a this tutorial for more information about custom services and UUIDs.

    Best regards,

    Marjeris

  • Hi,

    How have you defined BLE_UUID_NUS_SERVICE? Did you include ble_nus.h in your project? Please take a look at the ble_app_uart example. This example runs the Nordic UART Service (NUS) and can be found under 'examples/ble_peripheral/ble_app_uart' folder.

    yes I defined it through ble_nus.h i already included it in makefile and yes i took the example for my project from ble_app_uart.

    The Nordic UART service is a custom service, so we use a 128-bit vendor specific UUID and you need to use UUID type BLE_UUID_TYPE_VENDOR_BEGIN.

    yeah i also aready defined BLE_UUID_TYPE_VENDOR_BEGIN in nus_service_uuid_type this one that cause the problem i think.

    best regard,

    Andhika

  • Hi,

    What error message are you getting now? Have you tried to compare your application to ble_app_uart?

    In ble_app_template the function advertising_init is called before service_init(). If you want to advertise the NUS UUID you need to change the order and call advertising_init() after services_init().

    Best regards,

    Marjeris

  • Hi majeris,

    thanks for getting back, sorry for late reply I had exam yesterday

    it has no error it just the bluetooth device could not be found anymore (the deivce name and it's service doesn't appear)

    thanks for your link to the tutorial custom service i'll able to keep a track, I already compare it and follow it step by step. but still my device could not be found

    previously I hv similar issue when i tried modify the ram, my device could not be found but when I reset to the orginal ram it appear again, and yeterday i tried to change the ram like the tutorial suggest but didn't work. Is it possible that the root of these issues lies on ram?

    here is the original ram it's bigger then the ram that suggested

    MEMORY
    {
      FLASH (rx) : ORIGIN = 0x26000, LENGTH = 0x5a000
      RAM (rwx) :  ORIGIN = 0x20002b88, LENGTH = 0x3d478
    }
    

    best regards,

    Andhika

  • Hi,

    Sorry for the late reply. Do you get any error messages in nrf_log when this happens? Remember to set NRF_LOG_ENABLED to 1 in sdk_config.h

    Best regards,

    Marjeris

Related