Unable to build nrf51 example with mbed cli

27 Sep 2016

I have a RedBearLabs BLE Nano I'm trying to use with the new mbed cli. With the online compiler, I can import and build the SimpleChat example just fine. However, when I try to import it using the mbed cli, I'm not able to build it. I simply do

mbed import http://mbed.org/teams/RedBearLab/code/nRF51822_SimpleChat/
mbed compile -t gcc_arm -m rblab_blenano

The build fails because it's not including any of the softdevice headers from the nordic SDK, which is in the nRF51822 library. Is there any extra configuration I need to do on the cli to get this to build?

Here's an example of the build errors I get:

Compile: DFUService.cpp
[Error] ble_dfu.h@190,44: 'ble_evt_t' has not been declared
[Error] device_manager.h@509,25: variable or field 'dm_ble_evt_handler' declared void
[Error] device_manager.h@509,0: 'ble_evt_t' was not declared in this scope
[Error] device_manager.h@509,37: 'p_ble_evt' was not declared in this scope
[ERROR] In file included from ./nRF51822/source/nordic-sdk/components/libraries/bootloader_dfu/dfu_app_handler.h:57:0,
                 from ./BLE_API/ble/services/DFUService.h:26,
                 from ./BLE_API/source/services/DFUService.cpp:19:
./nRF51822/source/nordic-sdk/components/ble/ble_services/ble_dfu/ble_dfu.h:190:44: error: 'ble_evt_t' has not been declared
 void ble_dfu_on_ble_evt(ble_dfu_t * p_dfu, ble_evt_t * p_ble_evt);
23 Dec 2017

I am getting exactly the same problem. Did you solve this?