George Djabarov / Mbed OS mbed-os-example-mesh-minimal
Committer:
mbed_official
Date:
Fri Aug 05 09:15:17 2016 +0100
Revision:
10:5819b0a88423
Parent:
8:f02c15c5e51e
Child:
13:4a0466077538
Removing Nucleo F401RE Doc Ref

* Removing pin mapping issue related mention of Nucleo F401RE


Commit copied from https://github.com/ARMmbed/mbed-os-example-mesh-minimal

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Seppo Takalo 0:bde1843b9885 1 # Example mesh application for mbed OS
Seppo Takalo 0:bde1843b9885 2
Seppo Takalo 0:bde1843b9885 3 This application is the simplest one to utilize our mesh networking stack. It just joins your device to the unsecure *6LoWPAN-ND* network.
Seppo Takalo 0:bde1843b9885 4
Seppo Takalo 0:bde1843b9885 5 ## Setup
Seppo Takalo 0:bde1843b9885 6
Seppo Takalo 0:bde1843b9885 7 ### Download the application
Seppo Takalo 0:bde1843b9885 8
Seppo Takalo 0:bde1843b9885 9 ```
Seppo Takalo 0:bde1843b9885 10 mbed import mbed-os-example-mesh-minimal
Seppo Takalo 0:bde1843b9885 11 cd mbed-os-example-mesh-minimal
Seppo Takalo 0:bde1843b9885 12 ```
Seppo Takalo 0:bde1843b9885 13
Seppo Takalo 0:bde1843b9885 14 ### Change the channel settings (optional)
Seppo Takalo 0:bde1843b9885 15
Seppo Takalo 0:bde1843b9885 16 See the file `mbed_app.json` for an example of defining an IEEE 802.15.4 channel to use.
Seppo Takalo 0:bde1843b9885 17
Seppo Takalo 0:bde1843b9885 18 ### Compile the application
Seppo Takalo 0:bde1843b9885 19
Seppo Takalo 0:bde1843b9885 20 ```
Seppo Takalo 0:bde1843b9885 21 mbed compile -m K64F -t GCC_ARM
Seppo Takalo 0:bde1843b9885 22 ```
Seppo Takalo 0:bde1843b9885 23
Seppo Takalo 0:bde1843b9885 24 A binary is generated at the end of the build process.
Seppo Takalo 0:bde1843b9885 25
Seppo Takalo 0:bde1843b9885 26 ### Connect the RF shield to the board
Seppo Takalo 0:bde1843b9885 27
Seppo Takalo 0:bde1843b9885 28 By default, we are using the Atmel AT86RF233 and it can be purchased [here](https://firefly-iot.com/product/firefly-arduino-shield-2-4ghz/). Place the shield on top of your board and power it up.
Seppo Takalo 0:bde1843b9885 29
Seppo Takalo 0:bde1843b9885 30 ### Program the target
Seppo Takalo 0:bde1843b9885 31
Seppo Takalo 0:bde1843b9885 32 Drag and drop the binary to the target to program the application.
Seppo Takalo 0:bde1843b9885 33
Seppo Takalo 0:bde1843b9885 34 ### Update the firmware of the border router
Seppo Takalo 0:bde1843b9885 35
Seppo Takalo 0:bde1843b9885 36 You can read the instructions on updating the firmware of your K64F working as 6LoWPAN border router [here](https://github.com/ARMmbed/mbed-os-example-client#mbed-gateway).
Seppo Takalo 0:bde1843b9885 37
Seppo Takalo 0:bde1843b9885 38 Please do not forget to connect the Ethernet cable between the border router and your home/office router. Then power up the board.
Seppo Takalo 0:bde1843b9885 39
Seppo Takalo 0:bde1843b9885 40 ## Testing
Seppo Takalo 0:bde1843b9885 41
Seppo Takalo 0:bde1843b9885 42 As soon as both the border router and the target are up and running you can verify the correct behaviour. Open a serial console and see the IP address obtained by the device.
Seppo Takalo 0:bde1843b9885 43
Seppo Takalo 0:bde1843b9885 44 <span class="notes">**Note:** This application uses a baud rate of 115200.</span>
Seppo Takalo 0:bde1843b9885 45
Seppo Takalo 0:bde1843b9885 46 ```
Seppo Takalo 0:bde1843b9885 47 connected. IP = 2001:db8:a0b:12f0::1
Seppo Takalo 0:bde1843b9885 48 ```
Seppo Takalo 0:bde1843b9885 49
Seppo Takalo 0:bde1843b9885 50 You can use this IP address to `ping` from your PC and verify that the connection is working correctly.
Seppo Takalo 0:bde1843b9885 51
Seppo Takalo 0:bde1843b9885 52 ### Changing the radio driver (optional)
Seppo Takalo 0:bde1843b9885 53
Seppo Takalo 0:bde1843b9885 54 To run a 6LoWPAN-ND network, you need a working RF driver for Nanostack. This example uses the Atmel AT86RF233 by default.
Seppo Takalo 0:bde1843b9885 55
Seppo Takalo 0:bde1843b9885 56 To change the RF driver:
Seppo Takalo 0:bde1843b9885 57
Seppo Takalo 0:bde1843b9885 58 1. Uninstall the Atmel RF driver.
Seppo Takalo 0:bde1843b9885 59
Seppo Takalo 0:bde1843b9885 60 mbed remove atmel-rf-driver
Seppo Takalo 0:bde1843b9885 61
Seppo Takalo 0:bde1843b9885 62 2. Install the new driver. (For example, for the FRDM-CR20A radio shield based on the MCR20A device.)
Seppo Takalo 0:bde1843b9885 63
Seppo Takalo 0:bde1843b9885 64 mbed add mcr20a-rf-driver
Seppo Takalo 0:bde1843b9885 65
Seppo Takalo 0:bde1843b9885 66 3. Recompile your application.
Seppo Takalo 0:bde1843b9885 67
Seppo Takalo 0:bde1843b9885 68 mbed compile -m K64F -t GCC_ARM
Seppo Takalo 0:bde1843b9885 69
mbed_official 7:0540282551e7 70 ## Important Note (Multi-platform support)
mbed_official 7:0540282551e7 71
mbed_official 10:5819b0a88423 72 mbed-OS provides the developer with total control of the device. However some defaults are always loaded if the user does not provide proper information regarding them. This becomes evident when a user switches among platforms. On some platforms a particular pin might be reserved for a particular functionality (depending upon the MCU) which thus cannot be used generally. If the ardurino form factor is not available, or the required peripherial is on a different pin, the pins values can be set manually. For example, the user can add *"atmel-rf.spi-rst": "D4"* to his/her mbed_app.json file. This will set the SPI_RST pin to D4 of the GPIO.
mbed_official 7:0540282551e7 73
mbed_official 7:0540282551e7 74 ```json
mbed_official 7:0540282551e7 75 {
mbed_official 7:0540282551e7 76 "target_overrides": {
mbed_official 7:0540282551e7 77 "*": {
mbed_official 7:0540282551e7 78 "target.features_add": ["IPV6", "COMMON_PAL"],
mbed_official 7:0540282551e7 79 "atmel-rf.spi-rst": "D4"
mbed_official 7:0540282551e7 80 }
mbed_official 7:0540282551e7 81 }
mbed_official 7:0540282551e7 82 }
mbed_official 7:0540282551e7 83 ```
mbed_official 7:0540282551e7 84
mbed_official 7:0540282551e7 85 Desired work flow in such situations (if it may arise) should be:
mbed_official 7:0540282551e7 86
mbed_official 7:0540282551e7 87 1. Checking the platform pinmap from [mbed Platforms](https://developer.mbed.org/platforms/).
mbed_official 7:0540282551e7 88 2. Making sure that the desired GPIO pin is free by looking at the data sheet of the particular MCU. Most of the data sheets are available on [mbed Platforms](https://developer.mbed.org/platforms/).
mbed_official 8:f02c15c5e51e 89 3. If necessary, change the pin or pins by using the mbed -OS config mechanism. You can get more informations about the configuration system in the [documentation](https://github.com/ARMmbed/mbed-os/blob/master/docs/config_system.md)