5.2.1 - Updated I2C files

Dependents:   mbed-TFT-example-NCS36510 mbed-Accelerometer-example-NCS36510 mbed-Accelerometer-example-NCS36510

Committer:
group-onsemi
Date:
Wed Jan 25 20:34:15 2017 +0000
Revision:
0:098463de4c5d
Initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
group-onsemi 0:098463de4c5d 1 # About the exporters
group-onsemi 0:098463de4c5d 2
group-onsemi 0:098463de4c5d 3 The mbed exporters are used to export your code to various 3rd party tools and IDEs. Each exporter implements a `generate` function that produces an IDE specific project file. Exporters benefit from [mbed build tools](https://github.com/ARMmbed/mbed-os/blob/master/docs/BUILDING.md#build-mbed-sdk-library-from-sources). However, instead of using your source and [config data](https://github.com/ARMmbed/mbed-os/blob/master/docs/config_system.md) to create an executable, we use that information to populate an IDE project file that will be configured to build, flash, and debug your code. You can find exporter implementations [here](https://github.com/ARMmbed/mbed-os/tree/master/tools/export).
group-onsemi 0:098463de4c5d 4
group-onsemi 0:098463de4c5d 5 ## mbed-cli command
group-onsemi 0:098463de4c5d 6
group-onsemi 0:098463de4c5d 7 `mbed export -m [target] -i [IDE]`
group-onsemi 0:098463de4c5d 8
group-onsemi 0:098463de4c5d 9 # Adding export support for a target
group-onsemi 0:098463de4c5d 10
group-onsemi 0:098463de4c5d 11 If you have added new target to the mbed SDK, exporting will allow users to transition from mbed source code to the offline development environment of their choice. This functionality activates the use of your device for larger number of users.
group-onsemi 0:098463de4c5d 12
group-onsemi 0:098463de4c5d 13 ## Eclipse and Make
group-onsemi 0:098463de4c5d 14
group-onsemi 0:098463de4c5d 15 Eclipse project export utilizes a generated Makefile for building. Other than target configuration within the [config system](https://github.com/ARMmbed/mbed-os/blob/master/docs/mbed_targets.md) for mbed build system support, there is no additional work to provide Make export.
group-onsemi 0:098463de4c5d 16
group-onsemi 0:098463de4c5d 17 ### Available mbed-cli commands
group-onsemi 0:098463de4c5d 18
group-onsemi 0:098463de4c5d 19 `mbed export -m [target] -i [make_gcc_arm, make_iar, make_armc5, eclipse_gcc_arm, eclipse_iar, eclipse_armc5]`
group-onsemi 0:098463de4c5d 20
group-onsemi 0:098463de4c5d 21 ## UVision and IAR
group-onsemi 0:098463de4c5d 22
group-onsemi 0:098463de4c5d 23 ### CMSIS Packs
group-onsemi 0:098463de4c5d 24
group-onsemi 0:098463de4c5d 25 UVision and IAR both utilize [CMSIS packs](http://www.keil.com/pack/doc/CMSIS/Pack/html/index.html) to find target information necessary to create a valid project file.
group-onsemi 0:098463de4c5d 26
group-onsemi 0:098463de4c5d 27 We utilize the tool [ArmPackManager](https://github.com/ARMmbed/mbed-os/tree/master/tools/arm_pack_manager) to scrape [MDK5 Software Packs](https://www.keil.com/dd2/Pack/) for target information. This is achieved by parsing [http://www.keil.com/pack/index.idx](http://sadevicepacksprod.blob.core.windows.net/idxfile/index.idx). The relevant information in the [PDSC (Pack Description)](http://www.keil.com/pack/doc/CMSIS/Pack/html/_pack_format.html) retrieved from each URL in the index is stored in [index.json](https://github.com/ARMmbed/mbed-os/blob/master/tools/arm_pack_manager/index.json). A `.pdsc` file typically describes a family of devices. Each device is uniquely identified by its [device name](https://github.com/ARMmbed/mbed-os/blob/master/docs/mbed_targets.md#device_name). Thus, this name makes a natural key to associate a device with its information in `index.json`.
group-onsemi 0:098463de4c5d 28
group-onsemi 0:098463de4c5d 29 #### What's in a device name?
group-onsemi 0:098463de4c5d 30 There is no reliable way to map an mbed alias like [NUCLEO_F030R8](https://github.com/ARMmbed/mbed-os/blob/master/targets/targets.json#L603) to its unique identifier, [STM32F030R8](https://github.com/ARMmbed/mbed-os/blob/master/targets/targets.json#L615), as it is listed in a CMSIS pack (and subsequently `index.json`). So, we added a [device name](https://github.com/ARMmbed/mbed-os/blob/master/docs/mbed_targets.md#device_name) field in `targets.json`. **This field is required for IAR or UVision exporter support**.
group-onsemi 0:098463de4c5d 31
group-onsemi 0:098463de4c5d 32 #### Code Usage
group-onsemi 0:098463de4c5d 33 http://www.keil.com/pack/Keil.Kinetis_K20_DFP.pdsc is the PDSC that contains TEENSY_31 device (MK20DX256xxx7). It has been parsed by ArmPackManager and stored in `index.json`. The device information begins on line 156:
group-onsemi 0:098463de4c5d 34 ```xml
group-onsemi 0:098463de4c5d 35 <device Dname="MK20DX256xxx7">
group-onsemi 0:098463de4c5d 36 <processor Dfpu="0" Dmpu="0" Dendian="Little-endian" Dclock="72000000"/>
group-onsemi 0:098463de4c5d 37 <compile header="Device\Include\MK20D7.h" define="MK20DX256xxx7"/>
group-onsemi 0:098463de4c5d 38 <debug svd="SVD\MK20D7.svd"/>
group-onsemi 0:098463de4c5d 39 <memory id="IROM1" start="0x00000000" size="0x40000" startup="1" default="1"/>
group-onsemi 0:098463de4c5d 40 <memory id="IROM2" start="0x10000000" size="0x8000" startup="0" default="0"/>
group-onsemi 0:098463de4c5d 41 <memory id="IRAM1" start="0x20000000" size="0x8000" init ="0" default="1"/>
group-onsemi 0:098463de4c5d 42 <memory id="IRAM2" start="0x1FFF8000" size="0x8000" init ="0" default="0"/>
group-onsemi 0:098463de4c5d 43 <algorithm name="Flash\MK_P256.FLM" start="0x00000000" size="0x40000" default="1"/>
group-onsemi 0:098463de4c5d 44 <algorithm name="Flash\MK_D32_72MHZ.FLM" start="0x10000000" size="0x8000" default="1"/>
group-onsemi 0:098463de4c5d 45 <book name="Documents\K20P100M72SF1RM.pdf" title="MK20DX256xxx7 Reference Manual"/>
group-onsemi 0:098463de4c5d 46 <book name="Documents\K20P100M72SF1.pdf" title="MK20DX256xxx7 Data Sheet"/>
group-onsemi 0:098463de4c5d 47 </device>
group-onsemi 0:098463de4c5d 48 ```
group-onsemi 0:098463de4c5d 49
group-onsemi 0:098463de4c5d 50 ##### Uvision
group-onsemi 0:098463de4c5d 51 The dname (device name) field on line 156 directly corresponds to that in the Uvision5 IDE target selection window. [`tools/export/uvision/uvision.tmpl`](https://github.com/ARMmbed/mbed-os/blob/master/tools/export/uvision/uvision.tmpl#L15), uses target information from these packs is used to generate valid Uvision5 projects. If the device name is not found, we use a generic ARM CPU target in Uvision5.
group-onsemi 0:098463de4c5d 52
group-onsemi 0:098463de4c5d 53 ##### IAR
group-onsemi 0:098463de4c5d 54 [`tools/export/iar/iar_definitions.json`](https://github.com/ARMmbed/mbed-os/blob/master/tools/export/iar/iar_definitions.json) utilizes this device name to store information necessary to set the target in an IAR project.
group-onsemi 0:098463de4c5d 55
group-onsemi 0:098463de4c5d 56 ##### Updating index.json
group-onsemi 0:098463de4c5d 57 You can regenerate `index.json` to contain a newly made CMSIS pack with the following command:
group-onsemi 0:098463de4c5d 58
group-onsemi 0:098463de4c5d 59 `mbed export -i [IDE] --update-packs`
group-onsemi 0:098463de4c5d 60
group-onsemi 0:098463de4c5d 61 You should include the changes to `index.json` in your PR that adds support for the new target.
group-onsemi 0:098463de4c5d 62
group-onsemi 0:098463de4c5d 63
group-onsemi 0:098463de4c5d 64
group-onsemi 0:098463de4c5d 65