Group PAG
/
PAG-CourseWork-NicksEdits
Minor fixes
Fork of Coursework by
README.md@43:4ddc392dd0cc, 2017-05-04 (annotated)
- Committer:
- pburtenshaw
- Date:
- Thu May 04 12:55:16 2017 +0000
- Revision:
- 43:4ddc392dd0cc
- Parent:
- 41:cdcb65dbb16d
queue updatd but many errors - suspected missing colon or bracket?
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
pburtenshaw | 43:4ddc392dd0cc | 1 | Group P - SOFT 253 Environment Sensor Coursework comments start on line 92!! |
RossalaTTM | 40:c3c4bac03b4f | 2 | |
RossalaTTM | 40:c3c4bac03b4f | 3 | |
Jonathan Austin |
0:2757d7abb7d9 | 4 | # Getting started with Blinky on mbed OS |
Jonathan Austin |
0:2757d7abb7d9 | 5 | |
mbed_official | 27:e64a31d541da | 6 | This guide reviews the steps required to get Blinky working on an mbed OS platform. |
Jonathan Austin |
0:2757d7abb7d9 | 7 | |
Jonathan Austin |
0:2757d7abb7d9 | 8 | Please install [mbed CLI](https://github.com/ARMmbed/mbed-cli#installing-mbed-cli). |
Jonathan Austin |
0:2757d7abb7d9 | 9 | |
mbed_official | 27:e64a31d541da | 10 | ## Import the example application |
Jonathan Austin |
0:2757d7abb7d9 | 11 | |
mbed_official | 27:e64a31d541da | 12 | From the command-line, import the example: |
Jonathan Austin |
0:2757d7abb7d9 | 13 | |
Jonathan Austin |
0:2757d7abb7d9 | 14 | ``` |
Jonathan Austin |
0:2757d7abb7d9 | 15 | mbed import mbed-os-example-blinky |
Jonathan Austin |
0:2757d7abb7d9 | 16 | cd mbed-os-example-blinky |
Jonathan Austin |
0:2757d7abb7d9 | 17 | ``` |
Jonathan Austin |
0:2757d7abb7d9 | 18 | |
Jonathan Austin |
0:2757d7abb7d9 | 19 | ### Now compile |
Jonathan Austin |
0:2757d7abb7d9 | 20 | |
mbed_official | 27:e64a31d541da | 21 | Invoke `mbed compile`, and specify the name of your platform and your favorite toolchain (`GCC_ARM`, `ARM`, `IAR`). For example, for the ARM Compiler 5: |
Jonathan Austin |
0:2757d7abb7d9 | 22 | |
Jonathan Austin |
0:2757d7abb7d9 | 23 | ``` |
Jonathan Austin |
0:2757d7abb7d9 | 24 | mbed compile -m K64F -t ARM |
Jonathan Austin |
0:2757d7abb7d9 | 25 | ``` |
Jonathan Austin |
0:2757d7abb7d9 | 26 | |
mbed_official | 27:e64a31d541da | 27 | Your PC may take a few minutes to compile your code. At the end, you see the following result: |
Jonathan Austin |
0:2757d7abb7d9 | 28 | |
Jonathan Austin |
0:2757d7abb7d9 | 29 | ``` |
Jonathan Austin |
0:2757d7abb7d9 | 30 | [snip] |
Jonathan Austin |
0:2757d7abb7d9 | 31 | +----------------------------+-------+-------+------+ |
Jonathan Austin |
0:2757d7abb7d9 | 32 | | Module | .text | .data | .bss | |
Jonathan Austin |
0:2757d7abb7d9 | 33 | +----------------------------+-------+-------+------+ |
Jonathan Austin |
0:2757d7abb7d9 | 34 | | Misc | 13939 | 24 | 1372 | |
Jonathan Austin |
0:2757d7abb7d9 | 35 | | core/hal | 16993 | 96 | 296 | |
Jonathan Austin |
0:2757d7abb7d9 | 36 | | core/rtos | 7384 | 92 | 4204 | |
Jonathan Austin |
0:2757d7abb7d9 | 37 | | features/FEATURE_IPV4 | 80 | 0 | 176 | |
Jonathan Austin |
0:2757d7abb7d9 | 38 | | frameworks/greentea-client | 1830 | 60 | 44 | |
Jonathan Austin |
0:2757d7abb7d9 | 39 | | frameworks/utest | 2392 | 512 | 292 | |
Jonathan Austin |
0:2757d7abb7d9 | 40 | | Subtotals | 42618 | 784 | 6384 | |
Jonathan Austin |
0:2757d7abb7d9 | 41 | +----------------------------+-------+-------+------+ |
Jonathan Austin |
0:2757d7abb7d9 | 42 | Allocated Heap: unknown |
Jonathan Austin |
0:2757d7abb7d9 | 43 | Allocated Stack: unknown |
Jonathan Austin |
0:2757d7abb7d9 | 44 | Total Static RAM memory (data + bss): 7168 bytes |
Jonathan Austin |
0:2757d7abb7d9 | 45 | Total RAM memory (data + bss + heap + stack): 7168 bytes |
Jonathan Austin |
0:2757d7abb7d9 | 46 | Total Flash memory (text + data + misc): 43402 bytes |
Jonathan Austin |
1:846c97078558 | 47 | Image: .\.build\K64F\ARM\mbed-os-example-blinky.bin |
Jonathan Austin |
0:2757d7abb7d9 | 48 | ``` |
Jonathan Austin |
0:2757d7abb7d9 | 49 | |
Jonathan Austin |
0:2757d7abb7d9 | 50 | ### Program your board |
Jonathan Austin |
0:2757d7abb7d9 | 51 | |
Jonathan Austin |
0:2757d7abb7d9 | 52 | 1. Connect your mbed device to the computer over USB. |
mbed_official | 27:e64a31d541da | 53 | 1. Copy the binary file to the mbed device. |
Jonathan Austin |
0:2757d7abb7d9 | 54 | 1. Press the reset button to start the program. |
Jonathan Austin |
0:2757d7abb7d9 | 55 | |
mbed_official | 27:e64a31d541da | 56 | The LED on your platform turns on and off. |
Jonathan Austin |
0:2757d7abb7d9 | 57 | |
mbed_official | 27:e64a31d541da | 58 | ## Export the project to Keil MDK, and debug your application |
Jonathan Austin |
0:2757d7abb7d9 | 59 | |
mbed_official | 27:e64a31d541da | 60 | From the command-line, run the following command: |
Jonathan Austin |
0:2757d7abb7d9 | 61 | |
Jonathan Austin |
0:2757d7abb7d9 | 62 | ``` |
Jonathan Austin |
1:846c97078558 | 63 | mbed export -m K64F -i uvision |
Jonathan Austin |
0:2757d7abb7d9 | 64 | ``` |
Jonathan Austin |
0:2757d7abb7d9 | 65 | |
Jonathan Austin |
0:2757d7abb7d9 | 66 | To debug the application: |
Jonathan Austin |
0:2757d7abb7d9 | 67 | |
Jonathan Austin |
0:2757d7abb7d9 | 68 | 1. Start uVision. |
Jonathan Austin |
0:2757d7abb7d9 | 69 | 1. Import the uVision project generated earlier. |
mbed_official | 27:e64a31d541da | 70 | 1. Compile your application, and generate an `.axf` file. |
Jonathan Austin |
0:2757d7abb7d9 | 71 | 1. Make sure uVision is configured to debug over CMSIS-DAP (From the Project menu > Options for Target '...' > Debug tab > Use CMSIS-DAP Debugger). |
mbed_official | 27:e64a31d541da | 72 | 1. Set breakpoints, and start a debug session. |
Jonathan Austin |
0:2757d7abb7d9 | 73 | |
Jonathan Austin |
0:2757d7abb7d9 | 74 | ![Image of uVision](img/uvision.png) |
Jonathan Austin |
0:2757d7abb7d9 | 75 | |
Jonathan Austin |
0:2757d7abb7d9 | 76 | ## Troubleshooting |
Jonathan Austin |
0:2757d7abb7d9 | 77 | |
mbed_official | 24:a0164b11ed6f | 78 | 1. Make sure `mbed-cli` is working correctly and its version is `>1.0.0` |
Jonathan Austin |
0:2757d7abb7d9 | 79 | |
Jonathan Austin |
0:2757d7abb7d9 | 80 | ``` |
Jonathan Austin |
0:2757d7abb7d9 | 81 | mbed --version |
Jonathan Austin |
0:2757d7abb7d9 | 82 | ``` |
Jonathan Austin |
0:2757d7abb7d9 | 83 | |
mbed_official | 27:e64a31d541da | 84 | If not, you can update it: |
Jonathan Austin |
0:2757d7abb7d9 | 85 | |
Jonathan Austin |
0:2757d7abb7d9 | 86 | ``` |
Jonathan Austin |
0:2757d7abb7d9 | 87 | pip install mbed-cli --upgrade |
Jonathan Austin |
0:2757d7abb7d9 | 88 | ``` |
Jonathan Austin |
0:2757d7abb7d9 | 89 | |
RossalaTTM | 40:c3c4bac03b4f | 90 | 2. If using Keil MDK, make sure you have a license installed. [MDK-Lite](http://www.keil.com/arm/mdk.asp) has a 32 KB restriction on code size. |
RossalaTTM | 40:c3c4bac03b4f | 91 | |
RossalaTTM | 40:c3c4bac03b4f | 92 | ---Dev Notes--- |
RossalaTTM | 40:c3c4bac03b4f | 93 | /~\ |
RossalaTTM | 40:c3c4bac03b4f | 94 | |oo ) We're doomed! |
RossalaTTM | 40:c3c4bac03b4f | 95 | _\=/_ |
RossalaTTM | 40:c3c4bac03b4f | 96 | ___ # / _ \ # |
RossalaTTM | 40:c3c4bac03b4f | 97 | /() \ \\//|/.\|\\// |
RossalaTTM | 40:c3c4bac03b4f | 98 | _|_____|_ \/ \_/ \/ |
RossalaTTM | 40:c3c4bac03b4f | 99 | | | === | | |\ /| |
RossalaTTM | 40:c3c4bac03b4f | 100 | |_| O |_| \_ _/ |
RossalaTTM | 40:c3c4bac03b4f | 101 | || O || | | | |
RossalaTTM | 40:c3c4bac03b4f | 102 | ||__*__|| | | | |
RossalaTTM | 40:c3c4bac03b4f | 103 | |~ \___/ ~| []|[] |
RossalaTTM | 40:c3c4bac03b4f | 104 | /=\ /=\ /=\ | | | |
RossalaTTM | 40:c3c4bac03b4f | 105 | ________________[_]_[_]_[_]________/_]_[_\_________________________ |
RossalaTTM | 40:c3c4bac03b4f | 106 | |
RossalaTTM | 40:c3c4bac03b4f | 107 | TO DO: |
RossalaTTM | 40:c3c4bac03b4f | 108 | |
RossalaTTM | 41:cdcb65dbb16d | 109 | Queue - |
RossalaTTM | 41:cdcb65dbb16d | 110 | class - methods and variables, .h and .cpp- ask peter if you need help |
RossalaTTM | 41:cdcb65dbb16d | 111 | implement in main |
RossalaTTM | 41:cdcb65dbb16d | 112 | use with messages |
pburtenshaw | 43:4ddc392dd0cc | 113 | look into delete n - when performed, isFull should become false |
RossalaTTM | 41:cdcb65dbb16d | 114 | Commands- |
RossalaTTM | 41:cdcb65dbb16d | 115 | Add each method for each command |
RossalaTTM | 41:cdcb65dbb16d | 116 | Change input to readchar, printchar, repeat |
RossalaTTM | 41:cdcb65dbb16d | 117 | |
RossalaTTM | 40:c3c4bac03b4f | 118 | |
RossalaTTM | 40:c3c4bac03b4f | 119 | |
RossalaTTM | 40:c3c4bac03b4f | 120 | NOTES: |
RossalaTTM | 40:c3c4bac03b4f | 121 | In order to accept text input, you need to change the putty setting under Terminal> Line discipline options->Local echo-> Force on |