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