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

ble_app_uart not building on GCC

Hi, I have downloaded the SDK 6.0 which contains the ble_app_uart and tried to compile it using GCC, but getting the following error which doesn't make any sense because it is having braces:

../ble_nus.c:197:2: error: (near initialization for 'nus_base_uuid.uuid128') [-Werror=missing-braces]

Since the hrs example compiles fine, I used the same makefile from the hrs example and just changed the source files within the makefile.

Parents
  • Hi, don't have a good explanation of why GCC complains about missing braces. However, adding extra braces seems to fix the problem:

    ble_uuid128_t nus_base_uuid = {{0x9E, 0xCA, 0xDC, 0x24, 0x0E, 0xE5, 0xA9, 0xE0,  0x93, 0xF3, 0xA3, 0xB5, 0x00, 0x00, 0x40, 0x6E}};

    EDIT: There's is also a ble uart example on github with GCC makefile included.

Reply
  • Hi, don't have a good explanation of why GCC complains about missing braces. However, adding extra braces seems to fix the problem:

    ble_uuid128_t nus_base_uuid = {{0x9E, 0xCA, 0xDC, 0x24, 0x0E, 0xE5, 0xA9, 0xE0,  0x93, 0xF3, 0xA3, 0xB5, 0x00, 0x00, 0x40, 0x6E}};

    EDIT: There's is also a ble uart example on github with GCC makefile included.

Children