Registered User No edit summary |
Registered User m (remove "Cortex-A35 master boot" chapter, useless for v6 and wording to review) Tag: 2017 source edit |
||
(42 intermediate revisions by 7 users not shown) | |||
Line 1: | Line 1: | ||
{{ApplicableFor | |||
|MPUs list=STM32MP13x, STM32MP15x, STM32MP21x, STM32MP23x, STM32MP25x | |||
|MPUs checklist=STM32MP13x, STM32MP15x, STM32MP21x, STM32MP23x, STM32MP25x | |||
}} | |||
==Article purpose== | ==Article purpose== | ||
The purpose of this article is to: | The purpose of this article is to: | ||
* briefly introduce the USART peripheral and its main features | * briefly introduce the USART peripheral and its main features, | ||
* indicate the | * indicate the peripheral instances assignment at boot time and their assignment at runtime (including whether instances can be allocated to secure contexts), | ||
* list the software frameworks and drivers managing the peripheral, | |||
* explain | * explain how to configure the peripheral. | ||
==Peripheral overview== | ==Peripheral overview== | ||
The '''USART''' peripheral is used to interconnect STM32 MPU devices with other systems, typically via RS232 or RS485 protocols. In addition, the USART | The '''USART''' peripheral is used to interconnect STM32 MPU devices with other systems, typically via RS232 or RS485 protocols. In addition, the USART can be used for smartcard interfacing or SPI master/slave operation and supports the '''Synchronous''' mode. | ||
The '''UART''' peripheral is similar to the USART, but does not support the Synchronous mode nor the smartcard interfacing. | |||
The | |||
= | High-speed data communications can be achieved by using the [[DMA internal peripheral|DMA]] or [[MDMA_internal_peripheral|MDMA]] on {{MicroprocessorDevice | device=1}} and [[HPDMA_internal_peripheral|HPDMA]] on {{MicroprocessorDevice | device=2}} for multibuffer configuration. | ||
Refer to the [[STM32 MPU resources#Reference manuals|STM32 MPU reference manuals]] for the complete list of features, and to the software frameworks and drivers, introduced below, to see which features are implemented. | |||
==Peripheral usage== | |||
This chapter is applicable in the scope of the '''OpenSTLinux BSP''' running on the Arm<sup>®</sup> Cortex<sup>®</sup>-A processor(s), and the '''STM32CubeMPU Package''' running on the Arm<sup>®</sup> Cortex<sup>®</sup>-M processor. | |||
===Boot time assignment=== | |||
====On {{MicroprocessorDevice | device=1}}==== | |||
< | All USART and UART instances that are not securable via ETZPC are boot devices that support serial boot for Flash programming with [[STM32CubeProgrammer]]. | ||
{{#lst:STM32MP1_internal_peripherals_assignment_table_template|stm32mp1_boottime}} | |||
<section begin=stm32mp13_boottime /><section begin=stm32mp15_boottime /> | |||
| rowspan="1" | Low speed interface | |||
| rowspan="1" | [[USART_internal_peripheral|USART]] | |||
| Any instance | |||
| <span title="system peripheral" style="font-size:21px">✓</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| | |||
|- | |||
<section end=stm32mp13_boottime /><section end=stm32mp15_boottime /> | |||
|} | |||
====On {{MicroprocessorDevice | device=21}}==== | |||
{{ | {{#lst:STM32MP2_internal_peripherals_assignment_table_template|stm32mp2_a35_boottime}} | ||
<section begin=stm32mp21_a35_boottime /> | |||
| rowspan="7" | Low speed interface | |||
| rowspan="7" | [[USART internal peripheral | USART]] | |||
| USART1 | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| | |||
|- | |||
| USART2 | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| | |||
|- | |||
| USART3 | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| | |||
|- | |||
| UART4 | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| | |||
|- | |||
| UART5 | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| | |||
|- | |||
| USART6 | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| | |||
|- | |||
| UART7 | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| | |||
|- | |||
<section end=stm32mp21_a35_boottime /> | |||
|} | |||
{{ | ====On {{MicroprocessorDevice | device=23}}==== | ||
{{#lst:STM32MP2_internal_peripherals_assignment_table_template|stm32mp2_a35_boottime}} | |||
{{: | <section begin=stm32mp23_a35_boottime /> | ||
| rowspan="7" | Low speed interface | |||
| rowspan="7" | [[USART internal peripheral | USART]] | |||
| USART1 | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| | |||
|- | |||
| USART2 | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| | |||
|- | |||
| USART3 | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| | |||
|- | |||
| UART4 | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| | |||
|- | |||
| UART5 | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| | |||
|- | |||
| USART6 | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| | |||
|- | |||
| UART7 | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| | |||
|- | |||
<section end=stm32mp23_a35_boottime /> | |||
|} | |||
==== | ====On {{MicroprocessorDevice | device=25}}==== | ||
==== | {{#lst:STM32MP2_internal_peripherals_assignment_table_template|stm32mp2_a35_boottime}} | ||
<section begin=stm32mp25_a35_boottime /> | |||
| rowspan="9" | Low speed interface | |||
| rowspan="9" | [[USART internal peripheral | USART]] | |||
| USART1 | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| | |||
|- | |||
| USART2 | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| | |||
|- | |||
| USART3 | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| | |||
|- | |||
| UART4 | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| | |||
|- | |||
| UART5 | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| | |||
|- | |||
| USART6 | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| | |||
|- | |||
| UART7 | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| | |||
|- | |||
| UART8 | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| | |||
|- | |||
| UART9 | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| | |||
|- | |||
<section end=stm32mp25_a35_boottime /> | |||
|} | |||
{{: | ===Runtime assignment=== | ||
< | ====On {{MicroprocessorDevice | device=13}}==== | ||
{{#lst:STM32MP1_internal_peripherals_assignment_table_template|stm32mp13_runtime}} | |||
<section begin=stm32mp13_runtime /> | |||
| rowspan="8" | Low speed interface | |||
| rowspan="8" | [[USART_internal_peripheral|USART]] | |||
| USART1 | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| Assignment (single choice) | |||
|- | |||
| USART2 | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| Assignment (single choice) | |||
|- | |||
| USART3 | |||
| | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | | <span title="assignable peripheral" style="font-size:21px">☐</span> | ||
| | |||
|- | |||
| UART4 | |||
| | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | | <span title="assignable peripheral" style="font-size:21px">☐</span> | ||
| | |||
|- | |||
| UART5 | |||
| | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | | <span title="assignable peripheral" style="font-size:21px">☐</span> | ||
| | |||
|- | |||
| USART6 | |||
| | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | | <span title="assignable peripheral" style="font-size:21px">☐</span> | ||
| | |||
|- | |||
| UART7 | |||
| | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | | <span title="assignable peripheral" style="font-size:21px">☐</span> | ||
| | |||
|- | |||
| UART8 | |||
| | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | | <span title="assignable peripheral" style="font-size:21px">☐</span> | ||
| | |||
|- | |||
<section end=stm32mp13_runtime /> | |||
|} | |||
====On {{MicroprocessorDevice | device=15}}==== | |||
{{#lst:STM32MP1_internal_peripherals_assignment_table_template|stm32mp15_runtime}} | |||
<section begin=stm32mp15_runtime /> | |||
| rowspan="8" | Low speed interface | |||
| rowspan="8" | [[USART_internal_peripheral|USART]] | |||
| USART1 | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| | |||
| Assignment (single choice) | |||
|- | |||
| USART2 | |||
| | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | | <span title="assignable peripheral" style="font-size:21px">☐</span> | ||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| Assignment (single choice) | |||
|- | |||
| USART3 | |||
| | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | | <span title="assignable peripheral" style="font-size:21px">☐</span> | ||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| Assignment (single choice) | |||
|- | |||
| UART4 | |||
| | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | | <span title="assignable peripheral" style="font-size:21px">☐</span> | ||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| Assignment (single choice). <br />Used for Linux<sup>®</sup> serial console on [[:Category:STM32 MPU boards|ST boards]]. | |||
|- | |||
| UART5 | |||
| | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | | <span title="assignable peripheral" style="font-size:21px">☐</span> | ||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| Assignment (single choice) | |||
|- | |||
| USART6 | |||
| | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | | <span title="assignable peripheral" style="font-size:21px">☐</span> | ||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| Assignment (single choice) | |||
|- | |||
| UART7 | |||
| | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | | <span title="assignable peripheral" style="font-size:21px">☐</span> | ||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| Assignment (single choice) | |||
|- | |||
| UART8 | |||
| | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | | <span title="assignable peripheral" style="font-size:21px">☐</span> | ||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| Assignment (single choice) | |||
|- | |||
<section end=stm32mp15_runtime /> | |||
|} | |||
====On {{MicroprocessorDevice | device=21}}==== | |||
{{#lst:STM32MP2_internal_peripherals_assignment_table_template|stm32mp21_runtime}} | |||
<section begin=stm32mp21_a35_runtime /> | |||
| rowspan="7" | Low speed interface | |||
</ | | rowspan="7" | [[USART internal peripheral | USART]] | ||
| USART1 | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span><sup>OP-TEE</sup><br/> <span title="assignable peripheral" style="font-size:21px">☐</span><sup>TF-A BL31</sup> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| | |||
|- | |||
| USART2 | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span><sup>OP-TEE</sup><br/> <span title="assignable peripheral" style="font-size:21px">☐</span><sup>TF-A BL31</sup> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| | |||
|- | |||
| USART3 | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span><sup>OP-TEE</sup><br/> <span title="assignable peripheral" style="font-size:21px">☐</span><sup>TF-A BL31</sup> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| | |||
|- | |||
| UART4 | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span><sup>OP-TEE</sup><br/> <span title="assignable peripheral" style="font-size:21px">☐</span><sup>TF-A BL31</sup> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| | |||
|- | |||
| UART5 | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span><sup>OP-TEE</sup><br/> <span title="assignable peripheral" style="font-size:21px">☐</span><sup>TF-A BL31</sup> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| | |||
|- | |||
| USART6 | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span><sup>OP-TEE</sup><br/> <span title="assignable peripheral" style="font-size:21px">☐</span><sup>TF-A BL31</sup> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| | |||
|- | |||
| UART7 | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span><sup>OP-TEE</sup><br/> <span title="assignable peripheral" style="font-size:21px">☐</span><sup>TF-A BL31</sup> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| | |||
|- | |||
<section end=stm32mp21_a35_runtime /> | |||
|} | |||
====On {{MicroprocessorDevice | device=23}}==== | |||
{{#lst:STM32MP2_internal_peripherals_assignment_table_template|stm32mp23_runtime}} | |||
<section begin=stm32mp23_a35_runtime /> | |||
| rowspan="7" | Low speed interface | |||
| rowspan="7" | [[USART internal peripheral | USART]] | |||
| USART1 | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span><sup>OP-TEE</sup><br/> <span title="assignable peripheral" style="font-size:21px">☐</span><sup>TF-A BL31</sup> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| | |||
|- | |||
| USART2 | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span><sup>OP-TEE</sup><br/> <span title="assignable peripheral" style="font-size:21px">☐</span><sup>TF-A BL31</sup> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| | |||
|- | |||
| USART3 | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span><sup>OP-TEE</sup><br/> <span title="assignable peripheral" style="font-size:21px">☐</span><sup>TF-A BL31</sup> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| | |||
|- | |||
| UART4 | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span><sup>OP-TEE</sup><br/> <span title="assignable peripheral" style="font-size:21px">☐</span><sup>TF-A BL31</sup> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| | |||
|- | |||
| UART5 | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span><sup>OP-TEE</sup><br/> <span title="assignable peripheral" style="font-size:21px">☐</span><sup>TF-A BL31</sup> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| | |||
|- | |||
| USART6 | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span><sup>OP-TEE</sup><br/> <span title="assignable peripheral" style="font-size:21px">☐</span><sup>TF-A BL31</sup> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| | |||
|- | |||
| UART7 | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span><sup>OP-TEE</sup><br/> <span title="assignable peripheral" style="font-size:21px">☐</span><sup>TF-A BL31</sup> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| | |||
|- | |||
<section end=stm32mp23_a35_runtime /> | |||
|} | |||
====On {{MicroprocessorDevice | device=25}}==== | |||
{{#lst:STM32MP2_internal_peripherals_assignment_table_template|stm32mp25_runtime}} | |||
<section begin=stm32mp25_a35_runtime /> | |||
| rowspan="9" | Low speed interface | |||
| rowspan="9" | [[USART internal peripheral | USART]] | |||
| USART1 | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span><sup>OP-TEE</sup><br/> <span title="assignable peripheral" style="font-size:21px">☐</span><sup>TF-A BL31</sup> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| | |||
| | |||
|- | |||
| USART2 | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span><sup>OP-TEE</sup><br/> <span title="assignable peripheral" style="font-size:21px">☐</span><sup>TF-A BL31</sup> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| | |||
| | |||
|- | |||
| USART3 | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span><sup>OP-TEE</sup><br/> <span title="assignable peripheral" style="font-size:21px">☐</span><sup>TF-A BL31</sup> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| | |||
| | |||
|- | |||
| UART4 | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span><sup>OP-TEE</sup><br/> <span title="assignable peripheral" style="font-size:21px">☐</span><sup>TF-A BL31</sup> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| | |||
| | |||
|- | |||
| UART5 | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span><sup>OP-TEE</sup><br/> <span title="assignable peripheral" style="font-size:21px">☐</span><sup>TF-A BL31</sup> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| | |||
| | |||
|- | |||
| USART6 | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span><sup>OP-TEE</sup><br/> <span title="assignable peripheral" style="font-size:21px">☐</span><sup>TF-A BL31</sup> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| | |||
| | |||
|- | |||
| UART7 | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span><sup>OP-TEE</sup><br/> <span title="assignable peripheral" style="font-size:21px">☐</span><sup>TF-A BL31</sup> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| | |||
| | |||
|- | |||
| UART8 | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span><sup>OP-TEE</sup><br/> <span title="assignable peripheral" style="font-size:21px">☐</span><sup>TF-A BL31</sup> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| | |||
| | |||
|- | |||
| UART9 | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span><sup>OP-TEE</sup><br/> <span title="assignable peripheral" style="font-size:21px">☐</span><sup>TF-A BL31</sup> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| <span title="assignable peripheral" style="font-size:21px">☐</span> | |||
| | |||
| | |||
|- | |||
<section end=stm32mp25_a35_runtime /> | |||
|} | |||
==Software frameworks and drivers== | |||
The STM32 MPU devices feature USART instances (supporting both Asynchronous and Synchronous modes), and UART instances (supporting only Asynchronous mode). | |||
Below are listed the software frameworks and drivers managing the USART peripheral for the embedded software components listed in the above tables. | |||
* '''Linux<sup>®</sup>''': [[Serial TTY_overview|serial/tty framework]]; however, the Linux<sup>®</sup> kernel supports only the UART Asynchronous mode (Synchronous mode not supported) | |||
* '''OP-TEE''': [[STM32 MPU OP-TEE_overview|USART driver]] and {{CodeSource | OP-TEE_OS | core/include/drivers/stm32_uart.h | header file of USART OP-TEE driver}}, typically to communicate with a smartcard | |||
* '''STM32Cube''': [[STM32CubeMP15 Package architecture|USART HAL driver]] and {{CodeSource | STM32CubeMP1 | Drivers/STM32MP1xx_HAL_Driver/Inc/stm32mp1xx_hal_usart.h | header file of USART HAL module}}; both USART synchronous and asynchronous modes are supported by the STM32Cube MPU Package | |||
{{InternalInfo| On STM32MP15, from a hardware point of view, USART1 can be configured as a non-secure peripheral in the ETZPC. However: | |||
* It remains secure from RCC standpoint. This means that secure services are required to control it from Arm<sup>®</sup> Cortex<sup>®</sup>-A7 non-secure core, which is not possible from Arm<sup>®</sup> Cortex<sup>®</sup>-M4 side. The clock control from non-secure world is possible starting from STM32MP15 Rev.B. However the reset control remains secure. | |||
* The MDMA controller must be used with this instance whereas all other USART and UART instances are controlled via DMA1 or DMA2. For simplicity purposes, only the MDMA is shared between the Arm<sup>®</sup>Cortex<sup>®</sup>-A7 secure and the Arm<sup>®</sup>Cortex<sup>®</sup>-A7 non secure contexts.}} | |||
==How to assign and configure the peripheral== | |||
The peripheral assignment can be done via the [[STM32CubeMX]] graphical tool (and manually completed if needed).<br /> | |||
This tool also helps to configure the peripheral: | |||
* partial device trees (pin control and clock tree) generation for the OpenSTLinux software components, | |||
* HAL initialization code generation for the STM32CubeMPU Package. | |||
The configuration is applied by the firmware running in the context in which the peripheral is assigned. | |||
See also additional information in the [[Serial TTY device tree configuration]] article for Linux<sup>®</sup>. | |||
==How to go further== | ==How to go further== | ||
Additional documentation on USART peripheral is available on st.com: | Additional documentation on USART peripheral is available on st.com: | ||
* STM32 USART training <ref> | * STM32 USART training <ref>[https://www.st.com/resource/en/product_training/STM32MP1-Peripheral-USART_interface_USART.pdf| STM32MP1 - USART training document]</ref> presents the STM32 Universal Synchronous/Asynchronous Receiver/Transmitter interface. | ||
* STM32 USART automatic baud rate detection <ref>[https://www.st.com/resource/en/application_note/dm00327191-stm32-usart-automatic-baud-rate-detection-stmicroelectronics.pdf STM32 USART automatic baud rate detection application note (AN4908)]</ref> presents STM32 USART automatic baud rate detection. | |||
* STM32 USART automatic baud rate detection <ref>[ | |||
==References== | ==References== | ||
Line 126: | Line 534: | ||
<noinclude> | <noinclude> | ||
[[Category:Low speed interface peripherals]] | [[Category:Low speed interface peripherals]] | ||
{{ArticleBasedOnModel | Internal peripheral article model}} | |||
{{PublicationRequestId | 8315 | 2018-08-03 | AnneJ}} | {{PublicationRequestId | 8315 | 2018-08-03 | AnneJ}} | ||
</noinclude> | </noinclude> |
Latest revision as of 16:29, 22 October 2024
1. Article purpose[edit | edit source]
The purpose of this article is to:
- briefly introduce the USART peripheral and its main features,
- indicate the peripheral instances assignment at boot time and their assignment at runtime (including whether instances can be allocated to secure contexts),
- list the software frameworks and drivers managing the peripheral,
- explain how to configure the peripheral.
2. Peripheral overview[edit | edit source]
The USART peripheral is used to interconnect STM32 MPU devices with other systems, typically via RS232 or RS485 protocols. In addition, the USART can be used for smartcard interfacing or SPI master/slave operation and supports the Synchronous mode.
The UART peripheral is similar to the USART, but does not support the Synchronous mode nor the smartcard interfacing.
High-speed data communications can be achieved by using the DMA or MDMA on STM32MP1 series and HPDMA on STM32MP2 series for multibuffer configuration.
Refer to the STM32 MPU reference manuals for the complete list of features, and to the software frameworks and drivers, introduced below, to see which features are implemented.
3. Peripheral usage[edit | edit source]
This chapter is applicable in the scope of the OpenSTLinux BSP running on the Arm® Cortex®-A processor(s), and the STM32CubeMPU Package running on the Arm® Cortex®-M processor.
3.1. Boot time assignment[edit | edit source]
3.1.1. On STM32MP1 series[edit | edit source]
All USART and UART instances that are not securable via ETZPC are boot devices that support serial boot for Flash programming with STM32CubeProgrammer.
Click on to expand or collapse the legend...
Domain | Peripheral | Boot time allocation | Comment ![]() | |||
---|---|---|---|---|---|---|
Instance | Cortex-A7 secure (ROM code) |
Cortex-A7 secure (TF-A BL2) |
Cortex-A7 non-secure (U-Boot) | |||
Low speed interface | USART | Any instance | ✓ | ☐ | ☐ |
3.1.2. On STM32MP21x lines
[edit | edit source]
Click on to expand or collapse the legend...
Domain | Peripheral | Boot time allocation | Comment ![]() | |||
---|---|---|---|---|---|---|
Instance | Cortex-A35 secure (ROM code) |
Cortex-A35 secure (TF-A BL2) |
Cortex-A35 nonsecure (U-Boot) | |||
Low speed interface | USART | USART1 | ☐ | ☐ | ☐ | |
USART2 | ☐ | ☐ | ☐ | |||
USART3 | ☐ | ☐ | ☐ | |||
UART4 | ☐ | ☐ | ☐ | |||
UART5 | ☐ | ☐ | ☐ | |||
USART6 | ☐ | ☐ | ☐ | |||
UART7 | ☐ | ☐ | ☐ |
3.1.3. On STM32MP23x lines
[edit | edit source]
Click on to expand or collapse the legend...
Domain | Peripheral | Boot time allocation | Comment ![]() | |||
---|---|---|---|---|---|---|
Instance | Cortex-A35 secure (ROM code) |
Cortex-A35 secure (TF-A BL2) |
Cortex-A35 nonsecure (U-Boot) | |||
Low speed interface | USART | USART1 | ☐ | ☐ | ☐ | |
USART2 | ☐ | ☐ | ☐ | |||
USART3 | ☐ | ☐ | ☐ | |||
UART4 | ☐ | ☐ | ☐ | |||
UART5 | ☐ | ☐ | ☐ | |||
USART6 | ☐ | ☐ | ☐ | |||
UART7 | ☐ | ☐ | ☐ |
3.1.4. On STM32MP25x lines
[edit | edit source]
Click on to expand or collapse the legend...
Domain | Peripheral | Boot time allocation | Comment ![]() | |||
---|---|---|---|---|---|---|
Instance | Cortex-A35 secure (ROM code) |
Cortex-A35 secure (TF-A BL2) |
Cortex-A35 nonsecure (U-Boot) | |||
Low speed interface | USART | USART1 | ☐ | ☐ | ☐ | |
USART2 | ☐ | ☐ | ☐ | |||
USART3 | ☐ | ☐ | ☐ | |||
UART4 | ☐ | ☐ | ☐ | |||
UART5 | ☐ | ☐ | ☐ | |||
USART6 | ☐ | ☐ | ☐ | |||
UART7 | ☐ | ☐ | ☐ | |||
UART8 | ☐ | ☐ | ☐ | |||
UART9 | ☐ | ☐ | ☐ |
3.2. Runtime assignment[edit | edit source]
3.2.1. On STM32MP13x lines
[edit | edit source]
Click on to expand or collapse the legend...
Domain | Peripheral | Runtime allocation | Comment ![]() | ||
---|---|---|---|---|---|
Instance | Cortex-A7 secure (OP-TEE) |
Cortex-A7 non-secure (Linux) | |||
Low speed interface | USART | USART1 | ☐ | ☐ | Assignment (single choice) |
USART2 | ☐ | ☐ | Assignment (single choice) | ||
USART3 | ☐ | ||||
UART4 | ☐ | ||||
UART5 | ☐ | ||||
USART6 | ☐ | ||||
UART7 | ☐ | ||||
UART8 | ☐ |
3.2.2. On STM32MP15x lines
[edit | edit source]
Click on to expand or collapse the legend...
Domain | Peripheral | Runtime allocation | Comment ![]() | |||
---|---|---|---|---|---|---|
Instance | Cortex-A7 secure (OP-TEE) |
Cortex-A7 non-secure (Linux) |
Cortex-M4 (STM32Cube) | |||
Low speed interface | USART | USART1 | ☐ | ☐ | Assignment (single choice) | |
USART2 | ☐ | ☐ | Assignment (single choice) | |||
USART3 | ☐ | ☐ | Assignment (single choice) | |||
UART4 | ☐ | ☐ | Assignment (single choice). Used for Linux® serial console on ST boards. | |||
UART5 | ☐ | ☐ | Assignment (single choice) | |||
USART6 | ☐ | ☐ | Assignment (single choice) | |||
UART7 | ☐ | ☐ | Assignment (single choice) | |||
UART8 | ☐ | ☐ | Assignment (single choice) |
3.2.3. On STM32MP21x lines
[edit | edit source]
Click on to expand or collapse the legend...
Domain | Peripheral | Runtime allocation | Comment ![]() | ||||
---|---|---|---|---|---|---|---|
Instance | Cortex-A35 secure (OP-TEE / TF-A BL31) |
Cortex-A35 nonsecure (Linux) |
Cortex-M33 secure (TF-M) |
Cortex-M33 nonsecure (STM32Cube) | |||
Low speed interface | USART | USART1 | ☐OP-TEE ☐TF-A BL31 |
☐ | ☐ | ☐ | |
USART2 | ☐OP-TEE ☐TF-A BL31 |
☐ | ☐ | ☐ | |||
USART3 | ☐OP-TEE ☐TF-A BL31 |
☐ | ☐ | ☐ | |||
UART4 | ☐OP-TEE ☐TF-A BL31 |
☐ | ☐ | ☐ | |||
UART5 | ☐OP-TEE ☐TF-A BL31 |
☐ | ☐ | ☐ | |||
USART6 | ☐OP-TEE ☐TF-A BL31 |
☐ | ☐ | ☐ | |||
UART7 | ☐OP-TEE ☐TF-A BL31 |
☐ | ☐ | ☐ |
3.2.4. On STM32MP23x lines
[edit | edit source]
Click on to expand or collapse the legend...
Domain | Peripheral | Runtime allocation | Comment ![]() | ||||
---|---|---|---|---|---|---|---|
Instance | Cortex-A35 secure (OP-TEE / TF-A BL31) |
Cortex-A35 nonsecure (Linux) |
Cortex-M33 secure (TF-M) |
Cortex-M33 nonsecure (STM32Cube) | |||
Low speed interface | USART | USART1 | ☐OP-TEE ☐TF-A BL31 |
☐ | ☐ | ☐ | |
USART2 | ☐OP-TEE ☐TF-A BL31 |
☐ | ☐ | ☐ | |||
USART3 | ☐OP-TEE ☐TF-A BL31 |
☐ | ☐ | ☐ | |||
UART4 | ☐OP-TEE ☐TF-A BL31 |
☐ | ☐ | ☐ | |||
UART5 | ☐OP-TEE ☐TF-A BL31 |
☐ | ☐ | ☐ | |||
USART6 | ☐OP-TEE ☐TF-A BL31 |
☐ | ☐ | ☐ | |||
UART7 | ☐OP-TEE ☐TF-A BL31 |
☐ | ☐ | ☐ |
3.2.5. On STM32MP25x lines
[edit | edit source]
Click on to expand or collapse the legend...
Domain | Peripheral | Runtime allocation | Comment ![]() | |||||
---|---|---|---|---|---|---|---|---|
Instance | Cortex-A35 secure (OP-TEE / TF-A BL31) |
Cortex-A35 nonsecure (Linux) |
Cortex-M33 secure (TF-M) |
Cortex-M33 nonsecure (STM32Cube) |
Cortex-M0+ (STM32Cube) | |||
Low speed interface | USART | USART1 | ☐OP-TEE ☐TF-A BL31 |
☐ | ☐ | ☐ | ||
USART2 | ☐OP-TEE ☐TF-A BL31 |
☐ | ☐ | ☐ | ||||
USART3 | ☐OP-TEE ☐TF-A BL31 |
☐ | ☐ | ☐ | ||||
UART4 | ☐OP-TEE ☐TF-A BL31 |
☐ | ☐ | ☐ | ||||
UART5 | ☐OP-TEE ☐TF-A BL31 |
☐ | ☐ | ☐ | ||||
USART6 | ☐OP-TEE ☐TF-A BL31 |
☐ | ☐ | ☐ | ||||
UART7 | ☐OP-TEE ☐TF-A BL31 |
☐ | ☐ | ☐ | ||||
UART8 | ☐OP-TEE ☐TF-A BL31 |
☐ | ☐ | ☐ | ||||
UART9 | ☐OP-TEE ☐TF-A BL31 |
☐ | ☐ | ☐ |
4. Software frameworks and drivers[edit | edit source]
The STM32 MPU devices feature USART instances (supporting both Asynchronous and Synchronous modes), and UART instances (supporting only Asynchronous mode).
Below are listed the software frameworks and drivers managing the USART peripheral for the embedded software components listed in the above tables.
- Linux®: serial/tty framework; however, the Linux® kernel supports only the UART Asynchronous mode (Synchronous mode not supported)
- OP-TEE: USART driver and header file of USART OP-TEE driver , typically to communicate with a smartcard
- STM32Cube: USART HAL driver and header file of USART HAL module ; both USART synchronous and asynchronous modes are supported by the STM32Cube MPU Package
5. How to assign and configure the peripheral[edit | edit source]
The peripheral assignment can be done via the STM32CubeMX graphical tool (and manually completed if needed).
This tool also helps to configure the peripheral:
- partial device trees (pin control and clock tree) generation for the OpenSTLinux software components,
- HAL initialization code generation for the STM32CubeMPU Package.
The configuration is applied by the firmware running in the context in which the peripheral is assigned.
See also additional information in the Serial TTY device tree configuration article for Linux®.
6. How to go further[edit | edit source]
Additional documentation on USART peripheral is available on st.com:
- STM32 USART training [1] presents the STM32 Universal Synchronous/Asynchronous Receiver/Transmitter interface.
- STM32 USART automatic baud rate detection [2] presents STM32 USART automatic baud rate detection.
7. References[edit | edit source]