PBL mbed final

Fork of nRF51822 by Shuta Nakamae

Committer:
kataokashunpei
Date:
Tue Jan 24 23:44:29 2017 +0000
Revision:
640:819c58e5bd42
Parent:
638:c90ae1400bf2
update final

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Vincent Coubard 638:c90ae1400bf2 1 # nrf51-sdk
Vincent Coubard 638:c90ae1400bf2 2 Module to contain files provided by the nordic nRF51 SDK. The latest version of this module uses files from Nordic SDK 10.0.0. The files are extracted from [here](https://developer.nordicsemi.com/nRF5_SDK/nRF51_SDK_v10.x.x/nRF51_SDK_10.0.0_dc26b5e.zip).
Vincent Coubard 638:c90ae1400bf2 3
Vincent Coubard 638:c90ae1400bf2 4 ## Changes made to Nordic files
Vincent Coubard 638:c90ae1400bf2 5 The files are kept the same as much as possible to the Nordic SDK. Modifications are made in order to integrate with mbed.
Vincent Coubard 638:c90ae1400bf2 6 - ble/common/ble_conn_state.c: Preprocessor tests regarding S110, S120 or S130 macro should be replace by TARGET_MCU_NRF51_XXK_SXXX tests
Vincent Coubard 638:c90ae1400bf2 7 - `ble.h` in `source/nordic_sdk/components/softdevice/s130/headers/ble.h` has to be renamed `nrf_ble.h`. All files which include this file should be updated accordingly.
Vincent Coubard 638:c90ae1400bf2 8
Vincent Coubard 638:c90ae1400bf2 9
Vincent Coubard 638:c90ae1400bf2 10 ## Porting new versions of Nordic SDK
Vincent Coubard 638:c90ae1400bf2 11 A list of files currently requierd by mbed is maintained in [script/required_files.txt](https://github.com/ARMmbed/nrf51-sdk/blob/master/script/required_files.txt). [A python script](https://github.com/ARMmbed/nrf51-sdk/blob/master/script/pick_nrf51_files.py) is written to help porting from nordic sdk releases. **required_files.txt** is parsed to find a list of filenames. The script searches for these filenames in the sdk folder, and copy then into the yotta module mirroring the folder structure in the sdk. **extraIncludes** is automatically added to module.json to allow direct inclusion of noridc headers with just the filename.
Vincent Coubard 638:c90ae1400bf2 12
Vincent Coubard 638:c90ae1400bf2 13 ### Script usage
Vincent Coubard 638:c90ae1400bf2 14 ```
Vincent Coubard 638:c90ae1400bf2 15 python pick_nrf51_files.py [options] <full-noridc-sdk-path> <nrf51-sdk-yotta-module-path>
Vincent Coubard 638:c90ae1400bf2 16 options: --purge : to delete all existing files and start again
Vincent Coubard 638:c90ae1400bf2 17 --dry-run : to list the files to be copied but not actually copy them
Vincent Coubard 638:c90ae1400bf2 18 ```
Vincent Coubard 638:c90ae1400bf2 19
Vincent Coubard 638:c90ae1400bf2 20 There are files in the sdk with the same filename but in different folder. This is dealt with by excluding certain directories. The excluded directories are listed in [pick_nrf51_files.py](https://github.com/ARMmbed/nrf51-sdk/blob/master/script/pick_nrf51_files.py).
Vincent Coubard 638:c90ae1400bf2 21
Vincent Coubard 638:c90ae1400bf2 22 After running the script, the changes in [the previous section](#changes-made-to-nordic-files) will have to be applied manually again.
Vincent Coubard 638:c90ae1400bf2 23
Vincent Coubard 638:c90ae1400bf2 24 Folder structure or even file name can change between releases of the nordic sdk, hence a degree of manual adjustment is needed when porting.
Vincent Coubard 638:c90ae1400bf2 25
Vincent Coubard 638:c90ae1400bf2 26 ## Using Noridc Headers
Vincent Coubard 638:c90ae1400bf2 27 The nordic sdk is written in C and yotta modules support C++. If you are trying to include Nordic files in a cpp program, you need to use the `extern "C"` keyword around the includes.
Vincent Coubard 638:c90ae1400bf2 28 ```c
Vincent Coubard 638:c90ae1400bf2 29 extern "C" {
Vincent Coubard 638:c90ae1400bf2 30 #include "softdevice_handler.h"
Vincent Coubard 638:c90ae1400bf2 31 }
Vincent Coubard 638:c90ae1400bf2 32 ```