9 years, 5 months ago.

Organization

Hi,

Lately we have been building some code for the nRF51822 (https://github.com/mrquincle/bluenet) and someone asked if we would be willing to switch to mbed. From what I see there are definitely some advantages, but I am also a bit confused, especially about structure.

Sorry for all the questions. I'm just a command-line guy using vim, so please, don't make it difficult with graphical user interface thingies. :-)

Question relating to:

Bluetooth Low Energy (a.k.a Bluetooth LE, BTLE, Bluetooth Smart)

2 Answers

9 years, 5 months ago.

Hey,

Since I don't have the NRF one and don't use GCC I can just answer the general ones.

You are linking the compiled mbed library, what you need to look at is the source library: http://developer.mbed.org/users/mbed_official/code/mbed-src/, which is also found on github: https://github.com/mbedmicro/mbed.

Each target is found in two locations in the targets folder: CMSIS and HAL. CMSIS contains mainly the standard files from the manufacturer, while hal contains the mbed code. Althouh there is a grey area where some files go. Then they go as [Manufacturer] / [Device] / [Board (optional)]. The CMSIS folder is here: http://developer.mbed.org/users/mbed_official/code/mbed-src/file/bfce16e86ea4/targets/cmsis/TARGET_NORDIC/TARGET_MCU_NRF51822. As you can imagine there is no need to have here specific files for different targets, since they are the manufacturers standard files. The mbed code is found here: http://developer.mbed.org/users/mbed_official/code/mbed-src/file/bfce16e86ea4/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822, with by far the most boards of any single MCU. For this target the only board specific files seem to be device. (doesn't actually need to be specific, but guess it is nice), and the pinnames (mainly for aliases of pins, such as Arduino pin names).

When compiling the compilation is based on the folder the files are in, and how they are set in targets.py (https://github.com/mbedmicro/mbed/blob/master/workspace_tools/targets.py).

I've seen the device.h and PinNames.h file, they're clear. I'm going through the code right now. I see minor differences within the Nordic files. I see at github that https://github.com/mbedmicro/BLE_API contains the abstraction for BLE, https://github.com/mbedmicro/nRF51822 is a copy of all the relevant Nordic files and would contain the new S130 in https://github.com/mbedmicro/nRF51822/tree/master/nordic/nrf-sdk, and https://github.com/mbedmicro/mbed contains the mbed core. That is, if I'm correct. :-)

posted by Anne van Rossum 10 Nov 2014

Since I am not using the NRF myself I don't know how all the BLE/nrf-sdk stuff is organised :). But others do, especially https://developer.mbed.org/users/rgrover1/ seems to be the mbed guy working on the NRF/BLE.

posted by Erik - 10 Nov 2014
9 years, 5 months ago.

May I ask what the motivation for moving to mbed is? If the Nordic SDK is working for you I see little time to rush. Particularly since you are using the S130. The mbed BLE_API is built on S110, and last time I checked there are still some missing functionality compared to what you get in the SDK.

The differences between the S110 and the S130 are minor. From what I see I have to implement a few functions on https://github.com/mbedmicro/BLE_API/ for scanning, etc. What I will get in return - I hope - is a larger community who uses our software. :-)

posted by Anne van Rossum 10 Nov 2014