STmicro HAL driver DMA.

Committer:
aruaru
Date:
Mon Apr 08 15:40:58 2019 +0000
Revision:
6:431e375c94f4
Parent:
5:b14257cbe29a
iar

Who changed what in which revision?

UserRevisionLine numberNew contents of line
aruaru 2:9d67e2b0d96b 1 # Getting started example for Mbed OS stm32l4 dma uart
aruaru 0:96568f3ac645 2
aruaru 0:96568f3ac645 3 Please install [Mbed CLI](https://github.com/ARMmbed/mbed-cli#installing-mbed-cli).
aruaru 0:96568f3ac645 4
aruaru 0:96568f3ac645 5 ## Import the example application
aruaru 0:96568f3ac645 6
aruaru 0:96568f3ac645 7 From the command-line, import the example:
aruaru 0:96568f3ac645 8
aruaru 0:96568f3ac645 9 ```
aruaru 2:9d67e2b0d96b 10 mbed import http://os.mbed.com/teams/aruaru/code/mbed-os-stm32l4-dma-uart/
aruaru 2:9d67e2b0d96b 11 cd mbed-os-stm32l4-dma-uart
aruaru 0:96568f3ac645 12 ```
aruaru 0:96568f3ac645 13
aruaru 0:96568f3ac645 14 ### Now compile
aruaru 6:431e375c94f4 15 gcc only works.
aruaru 5:b14257cbe29a 16 online not correctry works.
aruaru 6:431e375c94f4 17 i do not have iar.
aruaru 6:431e375c94f4 18
aruaru 0:96568f3ac645 19 Invoke `mbed compile`, and specify the name of your platform and your favorite toolchain (`GCC_ARM`, `ARM`, `IAR`). For example, for the Arm Compiler:
aruaru 0:96568f3ac645 20
aruaru 0:96568f3ac645 21 ```
aruaru 2:9d67e2b0d96b 22 mbed compile -m NUCLEO_L476RG -t GCC_ARM
aruaru 0:96568f3ac645 23 ```
aruaru 0:96568f3ac645 24
aruaru 0:96568f3ac645 25 Your PC may take a few minutes to compile your code. At the end, you see the following result:
aruaru 0:96568f3ac645 26
aruaru 0:96568f3ac645 27 ```
aruaru 0:96568f3ac645 28 [snip]
aruaru 0:96568f3ac645 29
aruaru 2:9d67e2b0d96b 30 Image: ./BUILD/NUCLEO_L476RG/GCC_ARM/mbed-os-stm32l4-dma-uart.bin
aruaru 0:96568f3ac645 31 ```
aruaru 0:96568f3ac645 32
aruaru 0:96568f3ac645 33 ### Program your board
aruaru 0:96568f3ac645 34
aruaru 0:96568f3ac645 35 1. Connect your Mbed device to the computer over USB.
aruaru 0:96568f3ac645 36 1. Copy the binary file to the Mbed device.
aruaru 0:96568f3ac645 37 1. Press the reset button to start the program.
aruaru 0:96568f3ac645 38
aruaru 0:96568f3ac645 39 The LED on your platform turns on and off. The main thread will additionally take a snapshot of the device's runtime statistics and display it over serial to your PC. The snapshot includes:
aruaru 0:96568f3ac645 40
aruaru 0:96568f3ac645 41 * System Information:
aruaru 0:96568f3ac645 42 * Mbed OS Version: Will currently default to 999999
aruaru 0:96568f3ac645 43 * Compiler ID
aruaru 0:96568f3ac645 44 * ARM = 1
aruaru 0:96568f3ac645 45 * GCC_ARM = 2
aruaru 0:96568f3ac645 46 * IAR = 3
aruaru 0:96568f3ac645 47 * [CPUID Register Information](#cpuid-register-information)
aruaru 0:96568f3ac645 48 * [Compiler Version](#compiler-version)
aruaru 0:96568f3ac645 49 * CPU Statistics
aruaru 0:96568f3ac645 50 * Percentage of runtime that the device has spent awake versus in sleep
aruaru 0:96568f3ac645 51 * Heap Statistics
aruaru 0:96568f3ac645 52 * Current heap size
aruaru 0:96568f3ac645 53 * Max heap size which refers to the largest the heap has grown to
aruaru 0:96568f3ac645 54 * Thread Statistics
aruaru 0:96568f3ac645 55 * Provides information on all running threads in the OS including
aruaru 0:96568f3ac645 56 * Thread ID
aruaru 0:96568f3ac645 57 * Thread Name
aruaru 0:96568f3ac645 58 * Thread State
aruaru 0:96568f3ac645 59 * Thread Priority
aruaru 0:96568f3ac645 60 * Thread Stack Size
aruaru 0:96568f3ac645 61 * Thread Stack Space
aruaru 0:96568f3ac645 62
aruaru 0:96568f3ac645 63 #### Compiler Version
aruaru 0:96568f3ac645 64
aruaru 0:96568f3ac645 65 | Compiler | Version Layout |
aruaru 0:96568f3ac645 66 | -------- | -------------- |
aruaru 0:96568f3ac645 67 | ARM | PVVbbbb (P = Major; VV = Minor; bbbb = build number) |
aruaru 0:96568f3ac645 68 | GCC | VVRRPP (VV = Version; RR = Revision; PP = Patch) |
aruaru 0:96568f3ac645 69 | IAR | VRRRPPP (V = Version; RRR = Revision; PPP = Patch) |
aruaru 0:96568f3ac645 70
aruaru 0:96568f3ac645 71 #### CPUID Register Information
aruaru 0:96568f3ac645 72
aruaru 0:96568f3ac645 73 | Bit Field | Field Description | Values |
aruaru 0:96568f3ac645 74 | --------- | ----------------- | ------ |
aruaru 0:96568f3ac645 75 |[31:24] | Implementer | 0x41 = ARM |
aruaru 0:96568f3ac645 76 |[23:20] | Variant | Major revision 0x0 = Revision 0 |
aruaru 0:96568f3ac645 77 |[19:16] | Architecture | 0xC = Baseline Architecture |
aruaru 0:96568f3ac645 78 | | | 0xF = Constant (Mainline Architecture) |
aruaru 0:96568f3ac645 79 |[15:4] | Part Number | 0xC20 = Cortex-M0 |
aruaru 0:96568f3ac645 80 | | | 0xC60 = Cortex-M0+ |
aruaru 0:96568f3ac645 81 | | | 0xC23 = Cortex-M3 |
aruaru 0:96568f3ac645 82 | | | 0xC24 = Cortex-M4 |
aruaru 0:96568f3ac645 83 | | | 0xC27 = Cortex-M7 |
aruaru 0:96568f3ac645 84 | | | 0xD20 = Cortex-M23 |
aruaru 0:96568f3ac645 85 | | | 0xD21 = Cortex-M33 |
aruaru 0:96568f3ac645 86 |[3:0] | Revision | Minor revision: 0x1 = Patch 1 |
aruaru 0:96568f3ac645 87
aruaru 0:96568f3ac645 88
aruaru 0:96568f3ac645 89
aruaru 0:96568f3ac645 90 You can view individual examples and additional API information of the statistics collection tools at the bottom of the page in the [related links section](#related-links).
aruaru 0:96568f3ac645 91
aruaru 0:96568f3ac645 92
aruaru 0:96568f3ac645 93 ### Output
aruaru 2:9d67e2b0d96b 94 uart settings: 8n1,115200bps
aruaru 0:96568f3ac645 95
aruaru 0:96568f3ac645 96 ```
aruaru 6:431e375c94f4 97 [systemInfo] ./main.cpp started.
aruaru 6:431e375c94f4 98 [systemInfo] BUILD:Apr 9 2019T00:30:59,
aruaru 2:9d67e2b0d96b 99 [systemInfo] mbed-OS:5.11.5
aruaru 2:9d67e2b0d96b 100 [systemInfo] Mbed OS Version: 51105
aruaru 2:9d67e2b0d96b 101 [systemInfo] CPU ID: 0x410fc241
aruaru 6:431e375c94f4 102 [systemInfo] Compiler ID: 2
aruaru 6:431e375c94f4 103 [systemInfo] Compiler Version: 60300
aruaru 2:9d67e2b0d96b 104 [systemInfo] STM32HAL_driver Version: 0x01080200
aruaru 2:9d67e2b0d96b 105 uartRXstart status: 0
aruaru 6:431e375c94f4 106 utime:6570,cndtr:28,pos:1,69,i
aruaru 6:431e375c94f4 107 utime:6571,cndtr:17,pos:2,6e,n
aruaru 6:431e375c94f4 108 utime:6581,cndtr:1,pos:3,74,t
aruaru 6:431e375c94f4 109 utime:6591,cndtr:1,pos:4,20,
aruaru 6:431e375c94f4 110 utime:6601,cndtr:1,pos:5,70,p
aruaru 6:431e375c94f4 111 utime:6611,cndtr:1,pos:6,72,r
aruaru 6:431e375c94f4 112 utime:6621,cndtr:1,pos:7,69,i
aruaru 6:431e375c94f4 113 utime:6631,cndtr:1,pos:8,6e,n
aruaru 6:431e375c94f4 114 utime:6641,cndtr:1,pos:9,74,t
aruaru 0:96568f3ac645 115
aruaru 0:96568f3ac645 116
aruaru 0:96568f3ac645 117 ```
aruaru 0:96568f3ac645 118
aruaru 0:96568f3ac645 119 ## Troubleshooting
aruaru 0:96568f3ac645 120
aruaru 0:96568f3ac645 121 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.
aruaru 0:96568f3ac645 122
aruaru 0:96568f3ac645 123 ## Related Links
aruaru 0:96568f3ac645 124
aruaru 0:96568f3ac645 125 * [Mbed OS Stats API](https://os.mbed.com/docs/latest/apis/mbed-statistics.html)
aruaru 0:96568f3ac645 126 * [Mbed OS Configuration](https://os.mbed.com/docs/latest/reference/configuration.html)
aruaru 0:96568f3ac645 127 * [Mbed OS Serial Communication](https://os.mbed.com/docs/latest/tutorials/serial-communication.html)
aruaru 0:96568f3ac645 128
aruaru 0:96568f3ac645 129 ### License and contributions
aruaru 0:96568f3ac645 130
aruaru 0:96568f3ac645 131 The software is provided under Apache-2.0 license. Contributions to this project are accepted under the same license. Please see contributing.md for more info.
aruaru 0:96568f3ac645 132
aruaru 0:96568f3ac645 133 This project contains code from other projects. The original license text is included in those source files. They must comply with our license guide.