1.. _module-pw_sys_io_baremetal_stm32f429: 2 3----------------------------- 4pw_sys_io_baremetal_stm32f429 5----------------------------- 6.. pigweed-module:: 7 :name: pw_sys_io_baremetal_stm32f429 8 9``pw_sys_io_baremetal_stm32f429`` implements the ``pw_sys_io`` facade over 10UART. 11 12The STM32F429 baremetal sys IO backend provides device startup code and a UART 13driver layer that allows applications built against the ``pw_sys_io`` interface 14to run on a STM32F429 chip and do simple input/output via UART. The code is 15optimized for the STM32F429I-DISC1, using USART1 (which is connected to the 16virtual COM port on the embedded ST-LINKv2 chip). However, this should work with 17all STM32F429 variations (and even some STM32F4xx chips). 18 19This backend has no configuration options. The point of it is to provide bare- 20minimum platform code needed to do UART reads/writes. 21 22Setup 23===== 24This module requires relatively minimal setup: 25 261. Write code against the ``pw_sys_io`` facade. 272. Set the backend, in a way appropriate to your build system: 28 29 * In GN, specify the ``dir_pw_sys_io_backend`` GN global variable to point to this 30 backend. 31 * In Bazel, set the ``--@pigweed//pw_sys_io:backend`` label flag to 32 ``@pigweed//pw_sys_io_baremetal_stm32f429``. Also, add the 33 ``@pigweed//pw_sys_io_baremetal_stm32f429:compatible`` constraint to 34 your platform, to indicate that the platform is compatible with 35 this backend. 36 373. Build an executable with a main() function using a toolchain that 38 supports Cortex-M4. 39 40.. note:: 41 This module provides early firmware init and a linker script, so it will 42 conflict with other modules that do any early device init or provide a linker 43 script. 44 45Module usage 46============ 47After building an executable that utilizes this backend, flash the 48produced .elf binary to the development board. Then, using a serial 49communication terminal like minicom/screen (Linux/Mac) or TeraTerm (Windows), 50connect to the device at a baud rate of 115200 (8N1). If you're not using a 51STM32F429I-DISC1 development board, manually connect a USB-to-serial TTL adapter 52to pins ``PA9`` (MCU TX) and ``PA10`` (MCU RX), making sure to match logic 53levels (e.g. 3.3V versus 1.8V). 54 55Sample connection diagram 56------------------------- 57 58.. code-block:: text 59 60 --USB Serial--+ +-----STM32F429 MCU----- 61 | | 62 TX o--->o PA10/USART1_RX 63 | | 64 RX o<---o PA9/USART1_TX 65 | | 66 --------------+ +----------------------- 67 68Dependencies 69============ 70- :ref:`module-pw_sys_io` 71- :ref:`module-pw_preprocessor` 72