96d952c84d2020e2a55015639d2c847f1f5dfb7e
Zephyr UART + LED - Nucleo G474RE
A learning project for Zephyr RTOS targeting the STM32 Nucleo G474RE dev board! I have always seen Zephyr projects in the wild and want to document my learning process. I've used FreeRTOS in the past and want to rewrite some projects using Zephyr 🙂
Hardware
| Board | ST Nucleo G474RE |
| MCU | STM32G474RE (ARM Cortex-M4F, 170 MHz) |
| UART | LPUART1 via onboard ST-Link VCP (PA2/PA3) |
| LED | LD2 on PA5 |
Connect via USB to the Nucleo's ST-Link port
Features
- Interrupt-driven UART RX - ISR writes bytes into a ring buffer
- Dedicated RX thread - sleeps on a semaphore, wakes on data arrival
- Line accumulation - buffers input until
\ror\n - Formatted output - prints received line with length and uptime timestamp
- LED - on PA5 configured via devicetree overlay (for testing)
Getting Started
Prerequisites
- Zephyr SDK installed
westinstalled and workspace initialized
Build & Flash
west build # board is set in CMakeLists.txt
west flash
(optionally)
west debug
Serial Monitor
Connect a terminal to the ST-Link Virtual COM Port at a baud rate of 115200:
Personally, I just use PuTTY!
Type a line and press Enter:
─────────────────────────────
│ RX: hello
│ Len: 5, Time: 6741
─────────────────────────────
License
Description
Languages
C
72.1%
Python
26.6%
CMake
1.3%