NuMaker GPIO Interrupt with Debounce Setting

Committer:
rkuo2000
Date:
Fri Oct 14 07:59:15 2016 +0000
Revision:
0:29e056412215
GPIO interrupt input to flash led1

Who changed what in which revision?

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