blob: 44c68e360fc5d9d37a31f10d8bf8393b2b53382f [file] [log] [blame]
Armando Montanezf7a5a742020-03-02 14:58:59 -08001.. _chapter-pw-sys-io-baremetal-stm32f429:
Armando Montaneza69244e2019-11-15 11:25:10 -08002
3.. default-domain:: cpp
4
5.. highlight:: sh
6
Armando Montanezf7a5a742020-03-02 14:58:59 -08007-----------------------------
8pw_sys_io_baremetal_stm32f429
9-----------------------------
Armando Montanezd2e49032019-12-06 13:06:01 -080010
Armando Montanezf7a5a742020-03-02 14:58:59 -080011``pw_sys_io_baremetal_stm32f429`` implements the ``pw_sys_io`` facade over
Armando Montanezd2e49032019-12-06 13:06:01 -080012UART.
13
Armando Montanezf7a5a742020-03-02 14:58:59 -080014The STM32F429 baremetal sys IO backend provides device startup code and a UART
15driver layer that allows applications built against the ``pw_sys_io`` interface
Armando Montanezd2e49032019-12-06 13:06:01 -080016to run on a STM32F429 chip and do simple input/output via UART. The code is
17optimized for the STM32F429I-DISC1, using USART1 (which is connected to the
18virtual COM port on the embedded ST-LINKv2 chip). However, this should work with
19all STM32F429 variations (and even some STM32F4xx chips).
Armando Montaneza69244e2019-11-15 11:25:10 -080020
21This backend has no configuration options. The point of it is to provide bare-
22minimum platform code needed to do UART reads/writes.
23
24Setup
25=====
26This module requires relatively minimal setup:
27
Armando Montanezf7a5a742020-03-02 14:58:59 -080028 1. Write code against the ``pw_sys_io`` facade.
29 2. Specify the ``dir_pw_sys_io_backend`` GN global variable to point to this
Armando Montaneza69244e2019-11-15 11:25:10 -080030 backend.
31 3. Build an executable with a main() function using a toolchain that
32 supports Cortex-M4.
33
34.. note::
35 This module provides early firmware init and a linker script, so it will
36 conflict with other modules that do any early device init or provide a linker
37 script.
38
39Module usage
40============
Tennessee Carmel-Veilleuxe716e0a2020-01-14 14:56:59 -050041After building an executable that utilizes this backend, flash the
Armando Montaneza69244e2019-11-15 11:25:10 -080042produced .elf binary to the development board. Then, using a serial
Tennessee Carmel-Veilleuxe716e0a2020-01-14 14:56:59 -050043communication terminal like minicom/screen (Linux/Mac) or TeraTerm (Windows),
44connect to the device at a baud rate of 115200 (8N1). If you're not using a
45STM32F429I-DISC1 development board, manually connect a USB-to-serial TTL adapter
46to pins ``PA9`` (MCU TX) and ``PA10`` (MCU RX), making sure to match logic
47levels (e.g. 3.3V versus 1.8V).
48
49Sample connection diagram
50-------------------------
51
52.. code-block:: text
53
54 --USB Serial--+ +-----STM32F429 MCU-----
55 | |
56 TX o--->o PA10/USART1_RX
57 | |
58 RX o<---o PA9/USART1_TX
59 | |
60 --------------+ +-----------------------
Armando Montaneza69244e2019-11-15 11:25:10 -080061
62Dependencies
63============
Armando Montanez0054a9b2020-03-13 13:06:24 -070064 * ``pw_sys_io`` facade
65 * ``pw_preprocessor`` module