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

m_adv_uuids contents getting optimized out

Developing with S112 + Emulated NRF52810 I've run into a road block. 

I've set `m_adv_uuids` to the following:


static ble_uuid_t m_adv_uuids[] = {
{BLE_UUID_DEVICE_INFORMATION_SERVICE, BLE_UUID_TYPE_BLE},
{BLE_UUID_BATTERY_SERVICE, BLE_UUID_TYPE_BLE},
};

When I have optimizations turned off (`-O0`) my application initializes as expected. When it's set to the default of `-O3` the constants BLE_UUID_DEVICE_INFORMATION_SERVICE, BLE_UUID_TYPE_BLE become zeros. 

I changed to the supported arm gcc for SDK15 (gcc-arm-none-eabi-6-2017-q2-update)

Any help is appreciated. I'm at a loss.

  • I got everything working. I went ahead and replaced the makefile and linker file for the project (for GCC) and seems ok. I followed the instruction story convert to an emulated NRF52810 project. Minimal changes necessary. There was probably some cruft in there that was not necessary that was causing the issues I was seeing at runtime. 

    One thing that I've noticed with the S112+NRF52810 (emulated) is that I need to disconnect before issuing an OTA update via the app. Let's just say that lead to a very frustrating afternoon!

Related