Fix for Struct "<unnamed>" has no field "NRFFW"

Fork of nrf51-sdk by Nordic Semiconductor

Committer:
vcoubard
Date:
Thu Apr 07 17:37:20 2016 +0100
Revision:
5:ce89fa3dfbaf
Parent:
4:7019f1d6317d
Child:
6:ac5a8f5c2d96
Synchronized with git rev d8f72252
Author: LIYOU ZHOU
Update README.md

Who changed what in which revision?

UserRevisionLine numberNew contents of line
vcoubard 4:7019f1d6317d 1 # nrf51-sdk
vcoubard 4:7019f1d6317d 2 Module to contain files provided by the nordic nRF51 SDK
vcoubard 4:7019f1d6317d 3
vcoubard 4:7019f1d6317d 4 The latest version of this module uses files from Nordic SDK 8.1.0. The files are extracted from: https://developer.nordicsemi.com/nRF51_SDK/nRF51_SDK_v8.x.x/nRF51_SDK_8.1.0_b6ed55f.zip
vcoubard 4:7019f1d6317d 5
vcoubard 4:7019f1d6317d 6 ## Changes made to Nordic files
vcoubard 4:7019f1d6317d 7 The files are kept the same as much as possible to the Nordic SDK. These minor modifications are made in order to integrate with mbed:
vcoubard 4:7019f1d6317d 8
vcoubard 4:7019f1d6317d 9 1. Add `#define asm __ASM` to the top of [nrf_delay.h](https://github.com/ARMmbed/nrf51-sdk/blob/master/source/nordic_sdk/components/drivers_nrf/hal/nrf_delay.h). Because all yotta mobules compile with -std=c99 which does not include "asm" keyword.
vcoubard 4:7019f1d6317d 10 1. Add `#define BLE_STACK_SUPPORT_REQD` to the top of [ble_stack_handler_types.h](https://github.com/ARMmbed/nrf51-sdk/blob/master/source/nordic_sdk/components/softdevice/common/softdevice_handler/ble_stack_handler_types.h).
vcoubard 4:7019f1d6317d 11 1. Add this patch to [nrf_svc.h](https://github.com/ARMmbed/nrf51-sdk/blob/master/source/nordic_sdk/components/softdevice/s130/headers/nrf_svc.h)
vcoubard 4:7019f1d6317d 12
vcoubard 4:7019f1d6317d 13 ```diff
vcoubard 4:7019f1d6317d 14 index 3e907ea..fcb05a1 100644
vcoubard 4:7019f1d6317d 15 --- a/source/nordic_sdk/components/softdevice/s130/headers/nrf_svc.h
vcoubard 4:7019f1d6317d 16 +++ b/source/nordic_sdk/components/softdevice/s130/headers/nrf_svc.h
vcoubard 4:7019f1d6317d 17 @@ -53,7 +53,7 @@
vcoubard 4:7019f1d6317d 18 { \
vcoubard 4:7019f1d6317d 19 __asm( \
vcoubard 4:7019f1d6317d 20 "svc %0\n" \
vcoubard 4:7019f1d6317d 21 - "bx r14" : : "I" (number) : "r0" \
vcoubard 4:7019f1d6317d 22 + "bx r14" : : "I" ((uint32_t) number) : "r0" \
vcoubard 4:7019f1d6317d 23 ); \
vcoubard 4:7019f1d6317d 24 } \
vcoubard 4:7019f1d6317d 25 _Pragma("GCC diagnostic pop")
vcoubard 4:7019f1d6317d 26 ```
vcoubard 4:7019f1d6317d 27
vcoubard 4:7019f1d6317d 28 ## Porting new versions of Nordic SDK
vcoubard 4:7019f1d6317d 29 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 he filename.
vcoubard 4:7019f1d6317d 30
vcoubard 4:7019f1d6317d 31 ### Script usage
vcoubard 4:7019f1d6317d 32 ```
vcoubard 4:7019f1d6317d 33 python pick_nrf51_files.py <full-noridc-sdk-path> <nrf51-sdk-yotta-module-path>
vcoubard 4:7019f1d6317d 34 ```
vcoubard 4:7019f1d6317d 35
vcoubard 5:ce89fa3dfbaf 36 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).
vcoubard 5:ce89fa3dfbaf 37
vcoubard 5:ce89fa3dfbaf 38 After running the script, the changes in [the previous section](#changes-made-to-nordic-files) will have to be applied manually again.
vcoubard 5:ce89fa3dfbaf 39
vcoubard 5:ce89fa3dfbaf 40 Folder structure or even file name can change between releases of the nordic sdk, hence a degree of manual adjustment is needed when porting.
vcoubard 5:ce89fa3dfbaf 41
vcoubard 5:ce89fa3dfbaf 42 ### Using Noridc Headers
vcoubard 5:ce89fa3dfbaf 43 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.
vcoubard 5:ce89fa3dfbaf 44 ```c
vcoubard 5:ce89fa3dfbaf 45 extern "C" {
vcoubard 5:ce89fa3dfbaf 46 #include "softdevice_handler.h"
vcoubard 5:ce89fa3dfbaf 47 }
vcoubard 5:ce89fa3dfbaf 48 ```