
H bridge with 4 relays for cycling motor, with a temporisatoin or position reading
README.md@0:7aa5e1ea57aa, 2018-02-20 (annotated)
- Committer:
- maeldiy
- Date:
- Tue Feb 20 09:48:09 2018 +0000
- Revision:
- 0:7aa5e1ea57aa
provide H bridge through 4 relays for cycling motor with a temporisation
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
maeldiy | 0:7aa5e1ea57aa | 1 | # Getting started with Blinky on mbed OS |
maeldiy | 0:7aa5e1ea57aa | 2 | |
maeldiy | 0:7aa5e1ea57aa | 3 | This guide reviews the steps required to get Blinky working on an mbed OS platform. |
maeldiy | 0:7aa5e1ea57aa | 4 | |
maeldiy | 0:7aa5e1ea57aa | 5 | Please install [mbed CLI](https://github.com/ARMmbed/mbed-cli#installing-mbed-cli). |
maeldiy | 0:7aa5e1ea57aa | 6 | |
maeldiy | 0:7aa5e1ea57aa | 7 | ## Import the example application |
maeldiy | 0:7aa5e1ea57aa | 8 | |
maeldiy | 0:7aa5e1ea57aa | 9 | From the command-line, import the example: |
maeldiy | 0:7aa5e1ea57aa | 10 | |
maeldiy | 0:7aa5e1ea57aa | 11 | ``` |
maeldiy | 0:7aa5e1ea57aa | 12 | mbed import mbed-os-example-blinky |
maeldiy | 0:7aa5e1ea57aa | 13 | cd mbed-os-example-blinky |
maeldiy | 0:7aa5e1ea57aa | 14 | ``` |
maeldiy | 0:7aa5e1ea57aa | 15 | |
maeldiy | 0:7aa5e1ea57aa | 16 | ### Now compile |
maeldiy | 0:7aa5e1ea57aa | 17 | |
maeldiy | 0:7aa5e1ea57aa | 18 | 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: |
maeldiy | 0:7aa5e1ea57aa | 19 | |
maeldiy | 0:7aa5e1ea57aa | 20 | ``` |
maeldiy | 0:7aa5e1ea57aa | 21 | mbed compile -m K64F -t ARM |
maeldiy | 0:7aa5e1ea57aa | 22 | ``` |
maeldiy | 0:7aa5e1ea57aa | 23 | |
maeldiy | 0:7aa5e1ea57aa | 24 | Your PC may take a few minutes to compile your code. At the end, you see the following result: |
maeldiy | 0:7aa5e1ea57aa | 25 | |
maeldiy | 0:7aa5e1ea57aa | 26 | ``` |
maeldiy | 0:7aa5e1ea57aa | 27 | [snip] |
maeldiy | 0:7aa5e1ea57aa | 28 | +----------------------------+-------+-------+------+ |
maeldiy | 0:7aa5e1ea57aa | 29 | | Module | .text | .data | .bss | |
maeldiy | 0:7aa5e1ea57aa | 30 | +----------------------------+-------+-------+------+ |
maeldiy | 0:7aa5e1ea57aa | 31 | | Misc | 13939 | 24 | 1372 | |
maeldiy | 0:7aa5e1ea57aa | 32 | | core/hal | 16993 | 96 | 296 | |
maeldiy | 0:7aa5e1ea57aa | 33 | | core/rtos | 7384 | 92 | 4204 | |
maeldiy | 0:7aa5e1ea57aa | 34 | | features/FEATURE_IPV4 | 80 | 0 | 176 | |
maeldiy | 0:7aa5e1ea57aa | 35 | | frameworks/greentea-client | 1830 | 60 | 44 | |
maeldiy | 0:7aa5e1ea57aa | 36 | | frameworks/utest | 2392 | 512 | 292 | |
maeldiy | 0:7aa5e1ea57aa | 37 | | Subtotals | 42618 | 784 | 6384 | |
maeldiy | 0:7aa5e1ea57aa | 38 | +----------------------------+-------+-------+------+ |
maeldiy | 0:7aa5e1ea57aa | 39 | Allocated Heap: unknown |
maeldiy | 0:7aa5e1ea57aa | 40 | Allocated Stack: unknown |
maeldiy | 0:7aa5e1ea57aa | 41 | Total Static RAM memory (data + bss): 7168 bytes |
maeldiy | 0:7aa5e1ea57aa | 42 | Total RAM memory (data + bss + heap + stack): 7168 bytes |
maeldiy | 0:7aa5e1ea57aa | 43 | Total Flash memory (text + data + misc): 43402 bytes |
maeldiy | 0:7aa5e1ea57aa | 44 | Image: .\.build\K64F\ARM\mbed-os-example-blinky.bin |
maeldiy | 0:7aa5e1ea57aa | 45 | ``` |
maeldiy | 0:7aa5e1ea57aa | 46 | |
maeldiy | 0:7aa5e1ea57aa | 47 | ### Program your board |
maeldiy | 0:7aa5e1ea57aa | 48 | |
maeldiy | 0:7aa5e1ea57aa | 49 | 1. Connect your mbed device to the computer over USB. |
maeldiy | 0:7aa5e1ea57aa | 50 | 1. Copy the binary file to the mbed device. |
maeldiy | 0:7aa5e1ea57aa | 51 | 1. Press the reset button to start the program. |
maeldiy | 0:7aa5e1ea57aa | 52 | |
maeldiy | 0:7aa5e1ea57aa | 53 | The LED on your platform turns on and off. |
maeldiy | 0:7aa5e1ea57aa | 54 | |
maeldiy | 0:7aa5e1ea57aa | 55 | ## Export the project to Keil MDK, and debug your application |
maeldiy | 0:7aa5e1ea57aa | 56 | |
maeldiy | 0:7aa5e1ea57aa | 57 | From the command-line, run the following command: |
maeldiy | 0:7aa5e1ea57aa | 58 | |
maeldiy | 0:7aa5e1ea57aa | 59 | ``` |
maeldiy | 0:7aa5e1ea57aa | 60 | mbed export -m K64F -i uvision |
maeldiy | 0:7aa5e1ea57aa | 61 | ``` |
maeldiy | 0:7aa5e1ea57aa | 62 | |
maeldiy | 0:7aa5e1ea57aa | 63 | To debug the application: |
maeldiy | 0:7aa5e1ea57aa | 64 | |
maeldiy | 0:7aa5e1ea57aa | 65 | 1. Start uVision. |
maeldiy | 0:7aa5e1ea57aa | 66 | 1. Import the uVision project generated earlier. |
maeldiy | 0:7aa5e1ea57aa | 67 | 1. Compile your application, and generate an `.axf` file. |
maeldiy | 0:7aa5e1ea57aa | 68 | 1. Make sure uVision is configured to debug over CMSIS-DAP (From the Project menu > Options for Target '...' > Debug tab > Use CMSIS-DAP Debugger). |
maeldiy | 0:7aa5e1ea57aa | 69 | 1. Set breakpoints, and start a debug session. |
maeldiy | 0:7aa5e1ea57aa | 70 | |
maeldiy | 0:7aa5e1ea57aa | 71 |  |
maeldiy | 0:7aa5e1ea57aa | 72 | |
maeldiy | 0:7aa5e1ea57aa | 73 | ## Troubleshooting |
maeldiy | 0:7aa5e1ea57aa | 74 | |
maeldiy | 0:7aa5e1ea57aa | 75 | If you have problems, you can review the [documentation](https://os.mbed.com/docs/latest/tutorials/debugging.html) for suggestions on what could be wrong and how to fix it. |