Serial Ports: Difference between revisions

From STorM32-BGC Wiki
Jump to navigation Jump to search
Tag: Reverted
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
This article provides clarification regarding the STorM32's serial ports.
This article aims at providing some clarification concerning the STorM32's serial ports.


<div class="toclimit-2">__TOC__</div>
<div class="toclimit-2">__TOC__</div>
Line 5: Line 5:
== Ports ==
== Ports ==


Generally, the STorM32 port naming follows this scheme: The name of a port is simply the type of the port, plus a number for a 2nd port of that type, and so on. Example: {{BOX|RC}} and {{BOX|RC2}}. The STorM32 serial ports are named {{BOX|USB}}, {{BOX|UART}}, {{BOX|UART2}}, and {{BOX|UART3}}, and are accessible in the GUI as {{PARAMVALUE|usb}}, {{PARAMVALUE|uart}}, {{PARAMVALUE|uart2}}, and {{PARAMVALUE|uart3}}. The pins corresponding to these serial ports are labelled as Rx/Tx.
The naming of the STorM32 serial ports may appear confusing at first. However, it is in fact pretty consistent, across all boards - with one (unfortunate) exception: UART1.  


There is one exception, found on the the v3.3 board: UART1. It is not a port like {{BOX|UART}} or {{BOX|UART2}}, and you won't find any parameter option {{PARAMVALUE|uart1}} in the GUI.
Generally, the STorM32 port naming follows this scheme: The name of a port is simply the type of the port, plus a number (or symbol) for the 2nd port of that type, and so on. Example: {{BOX|RC}} and {{BOX|RC2}}. The STorM32 serial ports are named {{BOX|USB}}, {{BOX|UART}}, {{BOX|UART2}}, and {{BOX|UARTX}}, and are accessible in the GUI as {{PARAMVALUE|usb}}, {{PARAMVALUE|uart}}, {{PARAMVALUE|uart2}}, and {{PARAMVALUE|uartx}}. The pins corresponding to, e.g., the ports {{BOX|UART}} and {{BOX|UART2}} are labelled accordingly as Rx/Tx and Rx2/Tx2.


{{COMMENT|The naming scheme may be confusing to those coming from the FPV-world, since in that world it has become common to name the UART ports by the MCU peripheral name. STorM32 doesn't follow that scheme (STorM32 is older than the FPV scheme in fact LOL), it rather follows the PX4/ArduPilot approach.}}
UART1 is different. It is not a port like {{BOX|UART}} or {{BOX|UART2}}, and you won't find any parameter with the option {{PARAMVALUE|uart1}} in the GUI, yet the name "UART1" appears in various places, e.g. as Rx1/Tx1 labels on boards, or in pin descriptions, or in documentary.
   
   
=== MCU Peripherals and Special Role of UART1 ===
=== MCU Peripherals and Special Role of UART1 on v1.x, v3.3 Boards ===


Few words on microcontroller (MCU) peripherals. STorM32 uses the STM32 series of chips. The STM32's serial peripherals are called UARTx or USARTx, where x goes from 1 to 5 for e.g. the STM32F103RC chip (we will not distinguish between UARTx or USARTx but just call them UARTx). Note: This naming convention is a choice of the chip manufacturer, not ours.  
The microcontroller (MCU) which is used in the STorM32 controllers (STM32F103 or STM323H7A3) offers a number of hardware peripherals, among them the serial peripherals. These are generally called UARTx or USARTx, where x goes from 1 to 5 for e.g. the STM32F103RC chip (we will not distinguish between UARTx or USARTx but just call them UARTx). Note: This naming convention is a choice of the chip manufacturer, not ours.  


The names for the MCU serial peripherals must not be confused with the names of the serial ports of the STorM32 controller! They may or may not coincide.
  The names for the serial hardware peripherals must not be confused with the names of the serial ports of the STorM32 controller!


For the STM32F103 chips used by the v3.3 board, the hardware peripheral UART1 is special, since it allows us to flash firmware into the microcontroller, and this is exploited by STorM32. On the v3.3 boards, the pins for the hardware peripheral are exposed, and this is the reason for why one finds a UART1 port (or Rx1/Tx1 labels) on this board.
For instance, on the v1.3x boards the serial port {{BOX|UART}} is the hardware peripheral UART3, while on the v3.3 and v4.1 boards it is    the hardware peripheral UART5. From a user perspective this is however irrelevant, since all the user needs to know is that there is a serial port {{BOX|UART}} which can be selected in the GUI as {{PARAMVALUE|uart}}.
 
The hardware peripheral UART1 is special, since it allows us to flash the firmware into the microcontroller of the v1.x and v3.3 boards, and it is used by STorM32 for exactly this purpose. Therefore, this peripheral is exposed on these STorM32 boards so we can flash the firmware using it, which is the reason for why one finds a UART1 port (or Rx1/Tx1 labels) on the v1.x and v3.3 boards.
 
Unfortunately, the number of serial ports provided by v1.3x STorM32 boards is not sufficient for some applications. Therefore, on v1.3x boards one can use also the peripheral UART1 to fullfill the user's needs. In the STorM32 software, this is made possible, for some features, as {{BOX|UARTX}} port.


=== Availability ===
=== Availability ===
Line 23: Line 27:
Concerning the availability of the serial ports (for STorM32 boards documented in this wik) one can note:
Concerning the availability of the serial ports (for STorM32 boards documented in this wik) one can note:


The v3.x, v4.x, v6.x STorM32 boards all provide the {{BOX|USB}}, {{BOX|UART}}, {{BOX|UATRT2}}, and {{BOX|UART3}} ports.
* All STorM32 boards provide a {{BOX|UART}} port.


The {{BOX|UART3}} port is shared with two pins of the {{BOX|RC}} port, pins RC-0 and RC-1
* All "full-size" STorM32 boards provide a {{BOX|USB}} port (exception are some special designs such as micro boards). On the v1.3x and v6.x1 boards the USB connector is tied to the MCU's USB peripheral, whereas for the v3.3 and v4.1 boards it is connected via a on-board USB-TTL adapter to the UART1 peripheral.
 
* The v3.3/v4.1/v6.x STorM32 boards provide a {{BOX|UART2}} serial on the {{BOX|UART2}} port or {{BOX|ESP}} port. The v1.x boards do not offer this serial (here the GUI setting {{PARAMVALUE|uart2}} has no effect).
 
* All STorM32 boards provide the {{BOX|UARTX}} serial. It is found on the {{BOX|RC}} port, pins RC-0 and RC-1, and is accessible in the GUI as {{PARAMVALUE|uartx}}. In pictures of the v1.x board it is however labelled as UART1 and not UARTX.
 
* On the v3.3 STorM32 board, the UART1 hardware peripheral is available as extra UART1 (Rx1/Tx1) port. On the v1.3x boards this peripheral is on the {{BOX|RC}} port, pins RC-0 and RC-1.


{| class="wikitable"
{| class="wikitable"
! Gui
! Gui
! v3.3/v4.1/v6.2
! v1.3x
! v3.3/v4.1
! v6.2/v6.3
|-
|-
| {{PARAMVALUE|uart}}  || {{BOX|UART}} port
| {{PARAMVALUE|uart}}  || {{BOX|UART}} port || {{BOX|UART}} port || {{BOX|UART}} port
|-
|-
| {{PARAMVALUE|uart2}} || {{BOX|UART2}} port
| {{PARAMVALUE|uart2}} || has no effect, {{BOX|UART2}} port not available || {{BOX|UART2}} port or on {{BOX|ESP}} port || {{BOX|UART2}} port
|-
|-
| {{PARAMVALUE|usb}} || USB connector (is internally connected to UART1 for)
| {{PARAMVALUE|usb}} || USB connector || USB connector or UART1 port<br>is equal to UART1 || USB connector
|-
|-
| {{PARAMVALUE|uart3}} || RC-0,RC-1 pins on {{BOX|RC}} port<br>labeled UART3
| {{PARAMVALUE|uartx}} || RC-0,RC-1 pins on {{BOX|RC}} port<br>labeled UART1, is equal to UART1 || RC-0,RC-1 pins on {{BOX|RC}} port<br>labeled UARTX || RC-0,RC-1 pins on {{BOX|RC}} port<br>labeled UARTX
|}
|}
<!--
The naming of the STorM32's serial ports can be confusing. This article aims at providing some clarification.
== Ports ==
Generally one has to distinguish between the hardware peripherals provided by the STM32 micro-controller and their names, and the available serial ports and their naming.
Unfortunately, there is some overlap in the naming, which certainly contributes to the confusion. Furthermore, some STorM32 serials may not be found on ports which are named accordingly, but on "other" ports. This mess is certainly unfortunate, but reflects the efforts to continually increase the STorM32's capabilities and satisfy user demands while keeping some backwards compatibility.
The hardware peripherals are generally called UARTx or USARTx, where x goes from 1 to 5 for e.g. STM32F103 chips. We will not distinguish between UART or USART but just call them UARTx.
Concerning the STorM32's serials, the general rule is that they are named {{BOX|USB}}, {{BOX|UART}}, {{BOX|UART2}}, and {{BOX|UARTX}}, and that these are accessible in the GUI as {{PARAMVALUE|usb}}, {{PARAMVALUE|uart}}, {{PARAMVALUE|uart2}}, and {{PARAMVALUE|uartx}}. These must not be confused with the STM32's peripherals UART1, UART2, UART3, and so on.
Concerning the availability of the serials, one can note:
* All STorM32 boards provide the {{BOX|UART}} port.
* The STorM32 v3.x boards do provide a port labeled UART1, which is indeed the STM32 UART1 peripheral, and can be used for flashing firmware, but to the STorM32 firmware it is the {{BOX|USB}} port (accessible in the GUI as {{PARAMVALUE|usb}}). Some STorM32 v3.x boards provide in addition a physical USB connector, which is however just also UART1 (i.e. connected to UART1 with a USB-TTL adapter), with said function. On the STorM32 v1.x boards the {{BOX|USB}} port is indeed the physical USB connector, while the STM32's UART1 peripheral used for flashing firmware is available on the STorM32 {{BOX|RC}} port, pins RC-0 and RC-1.
* On the STorM32 v3.x boards the {{BOX|UART2}} serial is either available as an explicit {{BOX|UART2}} port or via the {{BOX|ESP}} port. The v1.x boards do not offer this serial at all (for these boards the GUI setting {{PARAMVALUE|uart2}} has no effect).
* On all STorM32 boards the {{BOX|UARTX}} serial is available on the {{BOX|RC}} port, pins RC-0 and RC-1 (accessible in the GUI as {{PARAMVALUE|uartx}}). In pictures of the v1.x board it is however indicated as UART1 and not UARTX (on these boards UARTX is in fact the STM32 UART1 peripheral).
-->


== Baudrate ==
== Baudrate ==

Latest revision as of 19:34, 21 November 2025

This article aims at providing some clarification concerning the STorM32's serial ports.

Ports

The naming of the STorM32 serial ports may appear confusing at first. However, it is in fact pretty consistent, across all boards - with one (unfortunate) exception: UART1.

Generally, the STorM32 port naming follows this scheme: The name of a port is simply the type of the port, plus a number (or symbol) for the 2nd port of that type, and so on. Example: RC and RC2. The STorM32 serial ports are named USB, UART, UART2, and UARTX, and are accessible in the GUI as “usb”, “uart”, “uart2”, and “uartx”. The pins corresponding to, e.g., the ports UART and UART2 are labelled accordingly as Rx/Tx and Rx2/Tx2.

UART1 is different. It is not a port like UART or UART2, and you won't find any parameter with the option “uart1” in the GUI, yet the name "UART1" appears in various places, e.g. as Rx1/Tx1 labels on boards, or in pin descriptions, or in documentary.

MCU Peripherals and Special Role of UART1 on v1.x, v3.3 Boards

The microcontroller (MCU) which is used in the STorM32 controllers (STM32F103 or STM323H7A3) offers a number of hardware peripherals, among them the serial peripherals. These are generally called UARTx or USARTx, where x goes from 1 to 5 for e.g. the STM32F103RC chip (we will not distinguish between UARTx or USARTx but just call them UARTx). Note: This naming convention is a choice of the chip manufacturer, not ours.

 The names for the serial hardware peripherals must not be confused with the names of the serial ports of the STorM32 controller!

For instance, on the v1.3x boards the serial port UART is the hardware peripheral UART3, while on the v3.3 and v4.1 boards it is the hardware peripheral UART5. From a user perspective this is however irrelevant, since all the user needs to know is that there is a serial port UART which can be selected in the GUI as “uart”.

The hardware peripheral UART1 is special, since it allows us to flash the firmware into the microcontroller of the v1.x and v3.3 boards, and it is used by STorM32 for exactly this purpose. Therefore, this peripheral is exposed on these STorM32 boards so we can flash the firmware using it, which is the reason for why one finds a UART1 port (or Rx1/Tx1 labels) on the v1.x and v3.3 boards.

Unfortunately, the number of serial ports provided by v1.3x STorM32 boards is not sufficient for some applications. Therefore, on v1.3x boards one can use also the peripheral UART1 to fullfill the user's needs. In the STorM32 software, this is made possible, for some features, as UARTX port.

Availability

Concerning the availability of the serial ports (for STorM32 boards documented in this wik) one can note:

  • All STorM32 boards provide a UART port.
  • All "full-size" STorM32 boards provide a USB port (exception are some special designs such as micro boards). On the v1.3x and v6.x1 boards the USB connector is tied to the MCU's USB peripheral, whereas for the v3.3 and v4.1 boards it is connected via a on-board USB-TTL adapter to the UART1 peripheral.
  • The v3.3/v4.1/v6.x STorM32 boards provide a UART2 serial on the UART2 port or ESP port. The v1.x boards do not offer this serial (here the GUI setting “uart2” has no effect).
  • All STorM32 boards provide the UARTX serial. It is found on the RC port, pins RC-0 and RC-1, and is accessible in the GUI as “uartx”. In pictures of the v1.x board it is however labelled as UART1 and not UARTX.
  • On the v3.3 STorM32 board, the UART1 hardware peripheral is available as extra UART1 (Rx1/Tx1) port. On the v1.3x boards this peripheral is on the RC port, pins RC-0 and RC-1.
Gui v1.3x v3.3/v4.1 v6.2/v6.3
“uart” UART port UART port UART port
“uart2” has no effect, UART2 port not available UART2 port or on ESP port UART2 port
“usb” USB connector USB connector or UART1 port
is equal to UART1
USB connector
“uartx” RC-0,RC-1 pins on RC port
labeled UART1, is equal to UART1
RC-0,RC-1 pins on RC port
labeled UARTX
RC-0,RC-1 pins on RC port
labeled UARTX

Baudrate

The default baudrate is generally 115200 bps for all serial ports (including USB on the v3.3 and v4.1 boards).

They can be adjusted for the USB, UART, UART2 serial ports in the GUI. There is no possibility to adjust the baudrate of the UARTX serial port.

Comment: The GUI per default also communicates with a baudrate of 115200 bps. It can be changed in the GUI.

Comment: Changing the baudrate of a serial port can imply that one cannot connect to this port with the GUI anymore.