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

Hard fault when adding service UUID to softdevice S132

Hi, I get a hard fault when I try to add an own UUID to the softdevice S132. I'm using Eclipse with GCC compiler, Rigado BMD350 eval board with the nRF52832 chip on it. As project template I use the ble_peripherals_template from the SDK 14.2.0 and went through the beginners tutorial BLE services.

When I add the own_service_init function in the service_init in main.c (see the tutorial) the controller runs into hard fault. Without the own_service routine the device connects perfectly to a cell phone. I debugged it with the debugger on the eval board and I can run the programm to the point where the Service and the vendor specific UUID must be added to the softdevices UUID list. I searched the internet and found out that the memory allocated for the softdevice is to short in the linker script (I read this in the documentation of the softdevice v5.0). I changed the linker script,m but that didn't help also. The line of code is where the hard fault is caused is the following:

err_code = sd_ble_uuid_vs_add(&base_uuid, &service_uuid.type);

I'm guessing that my application can't call the function in the softdevice, but I'm not quite sure.

Can anybody help or give an advice where to look or what I've done wrong?

Thanks in advance everybody!!!

Parents
  • Hi,

    If you are adding a second VS UUID, make sure to increment NRF_SDH_BLE_VS_UUID_COUNT in sdk_config.h. I needs to match the number of VS UUIDs in your application.

    I'm a little puzzled that you get a hard fault though. If the issue was a wrong value in NRF_SDH_BLE_VS_UUID_COUNT I'm pretty sure that sd_ble_uuid_vs_add() should only return an error code that you would typically check with APP_ERROR_CHECK(err_code);

    If this is in order, do you mind uploading your project files?

  • Hi,

    I've incremented the value from 0 to 1 and tried again, but still got the hard fault. I've tried to upload my project, but it didn't work also. I thing it's too big (zipped 12MB). Can I upload in another way?

    Thanks for the support!!

Reply Children
Related