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

nRF51 BLE examples on mbed.org will not compile

I'm trying to get going on an nRF51 project using the compiler on mbed.org, but if I create a new project using the nRF51 DK and use any of the example BLE apps as templates I get multiple compiler errors:

Error: Identifier "nrf_app_irq_priority_t" is undefined in "nRF51822/nrf51-sdk/source/nordic_sdk/components/ble/ble_radio_notification/ble_radio_notification.h", Line: 60, Col: 39
Error: Identifier "nrf_radio_notification_distance_t" is undefined in "nRF51822/nrf51-sdk/source/nordic_sdk/components/ble/ble_radio_notification/ble_radio_notification.h", Line: 61, Col: 39
Error: Identifier "nrf_app_irq_priority_t" is undefined in "nRF51822/nrf51-sdk/source/nordic_sdk/components/ble/ble_radio_notification/ble_radio_notification.c", Line: 51, Col: 39
Error: Identifier "nrf_radio_notification_distance_t" is undefined in "nRF51822/nrf51-sdk/source/nordic_sdk/components/ble/ble_radio_notification/ble_radio_notification.c", Line: 52, Col: 39
Warning: Function "sd_nvic_ClearPendingIRQ" declared implicitly in "nRF51822/nrf51-sdk/source/nordic_sdk/components/ble/ble_radio_notification/ble_radio_notification.c", Line: 60, Col: 17
Warning: Function "sd_nvic_SetPriority" declared implicitly in "nRF51822/nrf51-sdk/source/nordic_sdk/components/ble/ble_radio_notification/ble_radio_notification.c", Line: 66, Col: 17
Warning: Function "sd_nvic_EnableIRQ" declared implicitly in "nRF51822/nrf51-sdk/source/nordic_sdk/components/ble/ble_radio_notification/ble_radio_notification.c", Line: 72, Col: 17
Info: Unable to download. Fix the reported errors...

I've tried messing with older versions of the DK and libs and I get the same errors no matter what I do. Is there a way to fix this, or is there a howto somewhere to get set up developing for this chip using a different IDE?

  • You are using online mbed compiler? You have selected Nordic nRF51-DK as platform? And you do New->New Program->BLE UART Service to loopback anything on the TX characteristic? And you get these errors?

  • Yes, that's correct. There's also a checkbox saying "Update this program and libraries to latest revision" which I leave checked. Unchecking it allows the code to compile, but I'd really prefer to use the latest versions.

  • With "update program and libraries" unchecked the code will compile, but when I flash it to the board it doesn't work. My laptop can see the advertisements, but cannot connect:

    $ sudo hcitool lescan LE Scan ... DC:69:75:B4:AF:E2 BLE UART DC:69:75:B4:AF:E2 (unknown) ^C$ sudo gatttool -b DC:69:75:B4:AF:E2 -I [DC:69:75:B4:AF:E2][LE]> connect Attempting to connect to DC:69:75:B4:AF:E2 Error: connect error: Connection refused (111) [DC:69:75:B4:AF:E2][LE]> connect Attempting to connect to DC:69:75:B4:AF:E2 Error: connect error: Connection refused (111)

    I've tried erasing the chip completely and reflashing components/softdevice/s130/hex/s130_nrf51_2.0.0_softdevice.hex from the SDK but it doesn't help. I also see the same behaviour from the example binaries, as well as from a binary I generated with gcc - how do I find out if the SoftDevice is installed and configured correctly?

  • Strange. You seem to have the same issue as this guy. I'm not sure why you can't connect. If you use mbed you shouldn't flash the SoftDevice first, this should be included in the hex you download from the mbed compiler. You see the same behavior with the examples from the normal SDK? SDK 11.0.0? Do you have a nRF51 DK? PCA10028? Please try flashing the SoftDevice first, and then this hex. It still doesn't work? Could you try to connect with something else than a linux pc? Android or iOS smart phone?

  • Exactly the same build errors here when building at mbed.org... I followed evothings.com/.../ and got the identical errors to the OP. I've deleted and rebuilt the project twice with the same results.

    All the errors are happening in the nRF51822 lib v. 2.7.1 (11 Apr 2016).

    Any help from Nordic on this?

Related