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

Company Identifier

hello support ,

when I add the following code to ble_app_hrs example  under the function advertising_init()   there is no Advertising from the DK

What could be problem ?

 


ble_advdata_manuf_data_t manuf_data; //Variable to hold manufacturer specific data
uint8_t data[] = "SomeData!"; 
manuf_data.company_identifier = 0x0059; //Nordics company ID
 manuf_data.data.p_data = data;
manuf_data.data.size = sizeof(data);
init.advdata.p_manuf_specific_data = &manuf_data; //Our data to advertise

Parents
  • Hi,

    To debug your code using Segger Embeded Studio you can enable NRF_LOG_ENABLE 1 and NRF_LOG_BACKEND_RTT_ENABLED 1 in sdk_config.h to view some log files, and change the Build Configuration to "Debug".

    Then go to the Debug menu and click "Go". And then "Continue Execution".

     ->

    Then take a look at the output in the Debug Terminal.

    <error> app: ERROR 12 [NRF_ERROR_DATA_SIZE] at C:\nordicsemi\SDK_repo\nRF5_SDK_15.2.0_9412b96\examples\ble_peripheral\ble_app_hrs\main.c:893
    PC at: 0x000322C3
    <error> app: End of error report
    

    When running your code I got an error NRF_ERROR_DATA_SIZE when advertising_init() calls the function ble_advertising_init with the init parameters. The size of the advertisement packet is probably too long, since the maximum advertising data size is set to 31 bytes of data. If you are advertising a couple of services, a name and the manufacturer data, you're likely to run out of space.

    If you try to advertise a shorter manufacturer data or to shorten the device name you will not encounter this error. Another solution is to enable the extended advertising feature in Bluetooth 5. This can be done by including the following line in advertising_init()

        init.config.ble_adv_extended_enabled = true;

    Just keep in mind that not many phones support the extended advertisement feature yet, if you are using nRFConnect moble app you will not be able to see the nRF52DK advertising.

    Regards,

    Marjeris

Reply
  • Hi,

    To debug your code using Segger Embeded Studio you can enable NRF_LOG_ENABLE 1 and NRF_LOG_BACKEND_RTT_ENABLED 1 in sdk_config.h to view some log files, and change the Build Configuration to "Debug".

    Then go to the Debug menu and click "Go". And then "Continue Execution".

     ->

    Then take a look at the output in the Debug Terminal.

    <error> app: ERROR 12 [NRF_ERROR_DATA_SIZE] at C:\nordicsemi\SDK_repo\nRF5_SDK_15.2.0_9412b96\examples\ble_peripheral\ble_app_hrs\main.c:893
    PC at: 0x000322C3
    <error> app: End of error report
    

    When running your code I got an error NRF_ERROR_DATA_SIZE when advertising_init() calls the function ble_advertising_init with the init parameters. The size of the advertisement packet is probably too long, since the maximum advertising data size is set to 31 bytes of data. If you are advertising a couple of services, a name and the manufacturer data, you're likely to run out of space.

    If you try to advertise a shorter manufacturer data or to shorten the device name you will not encounter this error. Another solution is to enable the extended advertising feature in Bluetooth 5. This can be done by including the following line in advertising_init()

        init.config.ble_adv_extended_enabled = true;

    Just keep in mind that not many phones support the extended advertisement feature yet, if you are using nRFConnect moble app you will not be able to see the nRF52DK advertising.

    Regards,

    Marjeris

Children
Related