stm32f429Discovery mbedos

Committer:
zhlyz2003
Date:
Thu Jun 15 16:51:56 2017 +0000
Revision:
0:9c727e104a90
stm32f429Discovery mbedos

Who changed what in which revision?

UserRevisionLine numberNew contents of line
zhlyz2003 0:9c727e104a90 1 # Getting started with Blinky on mbed OS
zhlyz2003 0:9c727e104a90 2
zhlyz2003 0:9c727e104a90 3 This is a very simple guide, reviewing the steps required to get Blinky working on an mbed OS platform.
zhlyz2003 0:9c727e104a90 4
zhlyz2003 0:9c727e104a90 5 Please install [mbed CLI](https://github.com/ARMmbed/mbed-cli#installing-mbed-cli).
zhlyz2003 0:9c727e104a90 6
zhlyz2003 0:9c727e104a90 7 ## Get the example application!
zhlyz2003 0:9c727e104a90 8
zhlyz2003 0:9c727e104a90 9 From the command line, import the example:
zhlyz2003 0:9c727e104a90 10
zhlyz2003 0:9c727e104a90 11 ```
zhlyz2003 0:9c727e104a90 12 mbed import mbed-os-example-blinky
zhlyz2003 0:9c727e104a90 13 cd mbed-os-example-blinky
zhlyz2003 0:9c727e104a90 14 ```
zhlyz2003 0:9c727e104a90 15
zhlyz2003 0:9c727e104a90 16 ### Now compile
zhlyz2003 0:9c727e104a90 17
zhlyz2003 0:9c727e104a90 18 Invoke `mbed compile` specifying the name of your platform and your favorite toolchain (`GCC_ARM`, `ARM`, `IAR`). For example, for the ARM Compiler 5:
zhlyz2003 0:9c727e104a90 19
zhlyz2003 0:9c727e104a90 20 ```
zhlyz2003 0:9c727e104a90 21 mbed compile -m K64F -t ARM
zhlyz2003 0:9c727e104a90 22 ```
zhlyz2003 0:9c727e104a90 23
zhlyz2003 0:9c727e104a90 24 Your PC may take a few minutes to compile your code. At the end you should get the following result:
zhlyz2003 0:9c727e104a90 25
zhlyz2003 0:9c727e104a90 26 ```
zhlyz2003 0:9c727e104a90 27 [snip]
zhlyz2003 0:9c727e104a90 28 +----------------------------+-------+-------+------+
zhlyz2003 0:9c727e104a90 29 | Module | .text | .data | .bss |
zhlyz2003 0:9c727e104a90 30 +----------------------------+-------+-------+------+
zhlyz2003 0:9c727e104a90 31 | Misc | 13939 | 24 | 1372 |
zhlyz2003 0:9c727e104a90 32 | core/hal | 16993 | 96 | 296 |
zhlyz2003 0:9c727e104a90 33 | core/rtos | 7384 | 92 | 4204 |
zhlyz2003 0:9c727e104a90 34 | features/FEATURE_IPV4 | 80 | 0 | 176 |
zhlyz2003 0:9c727e104a90 35 | frameworks/greentea-client | 1830 | 60 | 44 |
zhlyz2003 0:9c727e104a90 36 | frameworks/utest | 2392 | 512 | 292 |
zhlyz2003 0:9c727e104a90 37 | Subtotals | 42618 | 784 | 6384 |
zhlyz2003 0:9c727e104a90 38 +----------------------------+-------+-------+------+
zhlyz2003 0:9c727e104a90 39 Allocated Heap: unknown
zhlyz2003 0:9c727e104a90 40 Allocated Stack: unknown
zhlyz2003 0:9c727e104a90 41 Total Static RAM memory (data + bss): 7168 bytes
zhlyz2003 0:9c727e104a90 42 Total RAM memory (data + bss + heap + stack): 7168 bytes
zhlyz2003 0:9c727e104a90 43 Total Flash memory (text + data + misc): 43402 bytes
zhlyz2003 0:9c727e104a90 44 Image: .\.build\K64F\ARM\mbed-os-example-blinky.bin
zhlyz2003 0:9c727e104a90 45 ```
zhlyz2003 0:9c727e104a90 46
zhlyz2003 0:9c727e104a90 47 ### Program your board
zhlyz2003 0:9c727e104a90 48
zhlyz2003 0:9c727e104a90 49 1. Connect your mbed device to the computer over USB.
zhlyz2003 0:9c727e104a90 50 1. Copy the binary file to the mbed device .
zhlyz2003 0:9c727e104a90 51 1. Press the reset button to start the program.
zhlyz2003 0:9c727e104a90 52
zhlyz2003 0:9c727e104a90 53 You should see the LED of your platform turning on and off.
zhlyz2003 0:9c727e104a90 54
zhlyz2003 0:9c727e104a90 55 Congratulations if you managed to complete this test!
zhlyz2003 0:9c727e104a90 56
zhlyz2003 0:9c727e104a90 57 ## Export the project to Keil MDK and debug your application
zhlyz2003 0:9c727e104a90 58
zhlyz2003 0:9c727e104a90 59 From the command line, run the following command:
zhlyz2003 0:9c727e104a90 60
zhlyz2003 0:9c727e104a90 61 ```
zhlyz2003 0:9c727e104a90 62 mbed export -m K64F -i uvision
zhlyz2003 0:9c727e104a90 63 ```
zhlyz2003 0:9c727e104a90 64
zhlyz2003 0:9c727e104a90 65 To debug the application:
zhlyz2003 0:9c727e104a90 66
zhlyz2003 0:9c727e104a90 67 1. Start uVision.
zhlyz2003 0:9c727e104a90 68 1. Import the uVision project generated earlier.
zhlyz2003 0:9c727e104a90 69 1. Compile your application and generate an `.axf` file.
zhlyz2003 0:9c727e104a90 70 1. Make sure uVision is configured to debug over CMSIS-DAP (From the Project menu > Options for Target '...' > Debug tab > Use CMSIS-DAP Debugger).
zhlyz2003 0:9c727e104a90 71 1. Set breakpoints and start a debug session.
zhlyz2003 0:9c727e104a90 72
zhlyz2003 0:9c727e104a90 73 ![Image of uVision](img/uvision.png)
zhlyz2003 0:9c727e104a90 74
zhlyz2003 0:9c727e104a90 75 ## Troubleshooting
zhlyz2003 0:9c727e104a90 76
zhlyz2003 0:9c727e104a90 77 1. Make sure `mbed-cli` is working correctly and its version is `>1.0.0`
zhlyz2003 0:9c727e104a90 78
zhlyz2003 0:9c727e104a90 79 ```
zhlyz2003 0:9c727e104a90 80 mbed --version
zhlyz2003 0:9c727e104a90 81 ```
zhlyz2003 0:9c727e104a90 82
zhlyz2003 0:9c727e104a90 83 If not, you can update it easily:
zhlyz2003 0:9c727e104a90 84
zhlyz2003 0:9c727e104a90 85 ```
zhlyz2003 0:9c727e104a90 86 pip install mbed-cli --upgrade
zhlyz2003 0:9c727e104a90 87 ```
zhlyz2003 0:9c727e104a90 88
zhlyz2003 0:9c727e104a90 89 2. If using Keil MDK, make sure you have a license installed. [MDK-Lite](http://www.keil.com/arm/mdk.asp) has a 32KB restriction on code size.