This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Custom 128 UUID and Service Data = unknown error

hi,

I have been reading some posts regarding similar issues, but I am not able to nail down this one. I am trying to create a custom 128 UUID and associate some Service Data to this service. I would like to broadcast only (connection less).

I am using the code recommended in this post .

Does not seems to be any issues during the assignment of the new 128 UUID, until I call ble_advdata_set(). Performing such call end up in my app_error_handler(), the error number seems mean less

error_code = 3735928559
line_num    = 1377
p_file_name	const uint8_t*	0x20001d4c "src\\rem.c"	
*p_file_name	const uint8_t	115 's'

The code:

#define BLE_CYC_SERVICE_UUID 0x5424 

uint32_t      err_code;
ble_advdata_t advdata;
uint8_t       flags = BLE_GAP_ADV_FLAG_BR_EDR_NOT_SUPPORTED;
ble_uuid_t    service_uuid; 

uint8_t battery_data = 0x24;
ble_advdata_service_data_t service_data;

service_uuid.type   = m_cy.uuid_type; 
service_uuid.uuid   = BLE_CY_SERVICE_UUID; 

service_data.service_uuid = BLE_CYC_SERVICE_UUID; 
service_data.data.size    = sizeof(battery_data);
service_data.data.p_data  = &battery_data;

memset(&advdata, 0, sizeof(advdata));

advdata.name_type            = BLE_ADVDATA_FULL_NAME;
advdata.include_appearance   = false;
advdata.flags.size           = sizeof(flags);
advdata.flags.p_data         = &flags;
advdata.service_data_count   = 1;
advdata.p_service_data_array = &service_data;
advdata.uuids_more_available.uuid_cnt = 1; // new
advdata.uuids_more_available.p_uuids  = &service_uuid; 

err_code = ble_advdata_set(&advdata, NULL);	

Second Try

Hi Petter,

First of all thank you for your help. Before going in to details let me list my full env.

  • Windows 8.1
  • SAGGER Jlink w/ SW version 4.92 and Jlink is using firmware v9 (This is the latest version)
  • Eclipse 4.4 (Luna) and CDT extensions for GNU ARM
  • GCC toolchain version 4.8 2014q2
  • S110 v7
  • SDK 6.1.0
  • Part # QFAAG00

Just for the record I have been running some test code like ble_app_beacon to test the S110 v7 and it works without any issues.

No lets go back to the main subject. I built ble_apps_bls, but fails when executes this part returning an error = 12289. I set advdata.name_type = BLE_ADVDATA_NO_NAME

gap_params_init:
   err_code = sd_ble_gap_device_name_set(&sec_mode,
                                          (const uint8_t *)DEVICE_NAME,
                                          strlen(DEVICE_NAME));

I tried your code as well, but it failed as well (I set advdata.name_type = BLE_ADVDATA_NO_NAME) :

gap_params_init:
   err_code = sd_ble_gap_ppcp_set(&gap_conn_params)

I am not sure what else to try. Do I need to use nRFgo or other tool to setup something else? Is there any known issues with the chip rev that I have?

Thanks for your support.

P.S I attached 2 zip (all the images and map files), 1x Sagger log, 1 x Makefile files.

ble_app_template_128UUID.zip

ble_app_lbs_s110.zip

ble_app_template_128UUID-Makefile

Cheers Dan

  • I suspect your advertisement packet is simply too big. You should be able to find a more meaningful error code if you turn off Optimization (set it to Level 0) under C/C++ tab in Options for target.

    Is the device advertising (no error) if you set the name type to it BLE_ADVDATA_NO_NAME? Obviously you can't identify your device with the name anymore, use the address or your UUID instead.

    I tested this quickly with an example; you can find my dirty code below. I used SDK 6.1.0 and S110 7.0.0.

    ble_app_template_128UUID.rar

    Edit: I have tested your hex files.

    ble_app_template_128UUID_s110_xxaa.hex works fine.

    ble_app_lbs_s110_xxaa.hex doesn't work.

    Are you sure err_code = sd_ble_gap_ppcp_set(&gap_conn_params); gives an error? I find that very strange.

    Could you just do the following in nRFgo Studio:

    • Erase all
    • Click the Program SoftDevice tab and select s110_nrf51822_7.0.0_softdevice.hex
    • Click the Program Application tab and select ble_app_template_128UUID_s110_xxaa.hex
  • Hi Petter,

    I am going to use Kepler 4.3 SR2 instead with the latest GNU toolchains.

    Could you please let me know the versions that you have in your system:

    • Segger jlink (PC and firmware version)
    • GNU ARM toolchain version
    • Eclipse version
    • OS version

    Are you using the GNU ARM Eclipse plugin if yes what version?

    Thanks again for your help.

    Cheers

  • I'm using Keil, Windows 7, J-Link V4.86. But that doesn't affect the hex file, try it.

  • Hi Petter,

    Well that narrows my search to: eclipse/jlink software/firmware.

    Thanks,

    I'll keep you posted with the latest news.

  • Peter,

    Seems like the root of my headaches was Luna. I switch to Kepler and the latest GNU ARM toolchanis + latest Jlink (firmware/software) and your code ble_app_template_128UUID.rar seems to work. I can see the 128 UUID, but something kind of strange is that as soon as I switch from:

    advdata.name_type               = BLE_ADVDATA_NO_NAME;
    

    To:

    advdata.name_type               = BLE_ADVDATA_SHORT_NAME;
    

    OR

    advdata.name_type               = BLE_ADVDATA_FULL_NAME;
    

    The system does not broadcast anymore. I am using a 1 character string under device name

    #define DEVICE_NAME                     "N"                          
    

    Any idea why?

    P.S I have not debug this issue yet.

    Thanks for your help.

    Cheers Dan

Related