Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
10 years, 1 month 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.
- Currently, if I want to add a certain target, say the RFduino, I see I can create a target at http://developer.mbed.org/users/mbed_official/code/mbed/file/031413cf7a89/TARGET_NRF51_DK or at http://developer.mbed.org/users/mbed_official/code/mbed/file/031413cf7a89/TARGET_NRF51_DK/TARGET_NORDIC/TARGET_MCU_NRF51822/TARGET_NRF51_DK. What is the right level?
- The files that are copied from the Nordic SDK, have there been changes to them?
- Do you have some script to copy the right files?
- I'm on the moment using SoftDevice S130 for example. How do you prefer me to add this to the codebase?
- We have our own CMake build system where we switch softdevices, upload them, etc. The friendly developer that recommended mbed to me created some CMake files at https://github.com/sandys/mbed-nrf51-gcc-test. However, does this really mean there is no build system maintained for `gcc` with all the proper flags to set the targets etc?
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:
2 Answers
10 years, 1 month 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 10 Nov 2014Since 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 10 Nov 201410 years, 1 month 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 10 Nov 2014