pw_sys_io_stm32cube implements the
pw_sys_io facade over UART using
the STM32Cube HAL to support an assortment of boards from STMicroelectronics.
The UART baud rate is fixed at 115200 (8N1).
This module requires relatively minimal setup:
Write code against the
dir_pw_sys_io_backendGN global variable to point to this backend.
pw_sys_io_Init()during init so the UART is properly initialized and configured.
For devices other than the STM32F429I-DISC1, this module will need to be configured to use the appropriate GPIO pins and USART peripheral.
Module Configuration Options#
The following configurations can be adjusted via compile-time configuration of this module, see the module documentation for more details.
The USART peripheral number to use. (1 for USART1, 2 for USART2, etc.)
The port that the USART peripheral TX/RX pins are on. (e.g. to use A9/A10 pins for TX and RX, respectively, set this to A)
The port for the USART peripheral TX pin, if different from PW_SYS_IO_STM32CUBE_GPIO_PORT.
The port for the USART peripheral RX pin, if different from PW_SYS_IO_STM32CUBE_GPIO_PORT.
The pin index to use for USART transmission within the port set by
The pin index to use for USART reception within the port set by
The alternate function index to use for USART reception within the port set by
The peripheral name prefix (either UART or USART) for the peripheral selected by
PW_SYS_IO_STM32CUBE_USART_NUM. Defaults to USART.
After building an executable that utilizes this backend, flash the
produced .elf binary to the development board. Then, using a serial
communication terminal like minicom/screen (Linux/Mac) or TeraTerm (Windows),
connect to the device at a baud rate of 115200 (8N1). If you’re not using a
STM32F429I-DISC1 development board, manually connect a USB-to-serial TTL adapter
PA9 (MCU TX) and
PA10 (MCU RX), making sure to match logic
levels (e.g. 3.3V versus 1.8V).
Sample connection diagram#
--USB Serial--+ +-----STM32F429 MCU----- | | TX o--->o PA10/USART1_RX | | RX o<---o PA9/USART1_TX | | --------------+ +-----------------------