How hxy513696765/stm32f103rb_cmsis-dsp_tft_ddisplay_128_fft works
Project Type and Purpose
• This is a bare‑metal embedded firmware project targeting an STM32F103RB microcontroller (Cortex‑M3).
• The goal is to sample an analog signal, run a 128‑point FFT via the ARM CMSIS‑DSP library, and render the frequency spectrum in real time on an ALIENTEK MINISTM32 TFT.
File‑Structure Analysis
• Top‑level directories:
• CORE: CMSIS core startup and vector table (core_cm3.c/h, startup .s).
• HARDWARE: Board‑specific drivers (ADC, LCD, LED) plus the ST Standard Peripheral Library (STM32F10x_StdPeriph_Driver).
• STM32F10x_FWLib: Duplicate or reference of ST’s firmware library (inc and src).
• SYSTEM: Lightweight HAL for delay, system tick, USART (sys, delay, usart).
• USER: Application code—main(), FFT examples, startup, system config, interrupt handlers, project files (.uvprojx), debug configs, and build artifacts under OBJ.
• README points out use of CMSIS‑DSP v1.4.4 and the goal of displaying 128‑point FFT on the TFT.
Architectural Components
a. Microcontroller & Core
• Cortex‑M3 core (vector table, NVIC)
• System clock & SysTick (SYSTEM/sys)
b. Peripheral Abstraction Layers
• CMSIS core header (CORE/)
• ST StdPeriph drivers (HARDWARE/STM32F10x_StdPeriph_Driver)
• Simplified SYSTEM drivers (delay, usart)
c. Board‑Level Drivers
• ADC driver (HARDWARE/ADC)
• LCD driver and font (HARDWARE/LCD)
• LED driver for status indication (HARDWARE/LED)
d. DSP Processing
• CMSIS‑DSP library (ARM DSP routines linked into USER/arm_fft_*.c)
• FFT pipeline: sample acquisition → buffer → FFT transform → magnitude calculation
e. Application Layer
• main.c: initialization sequence, perpetual loop or timer/interrupt driven task
• Data flow: ADC ISR or DMA → FFT routine → render via LCD driver
• Optional USART output for debugging (SYSTEM/usart)
f. External Interfaces
• ALIENTEK TFT (parallel/SPI bus)
• Analog input (sensor) into ADC
• JTAG/SWD for debugging (USER/JLinkSettings.ini)
Relationships and Interactions
• ADC hardware → ADC driver → sample buffer
• Sample buffer → CMSIS‑DSP FFT function → frequency data
• Frequency data → LCD driver → TFT display
• SysTick → delay/SYSTEM services → timing control
• USART → debug console (optional)
• LED driver → status LED (heartbeat or error indicator)
• Interrupt or DMA paths if used (e.g., ADC conversion complete ISR triggering FFT).
Architectural Patterns & Principles
• Layered HAL approach:
• CMSIS core → StdPeriph or custom SYSTEM HAL → board drivers → application
• Modular separation:
• Hardware drivers in HARDWARE/…
• DSP algorithms in USER/arm_fft_*
• System utilities (delay, usart) in SYSTEM/…
• Single‑threaded, callback or interrupt‑driven design (no RTOS).
Technologies & Frameworks
• ARM CMSIS (CORE directory)
• ST Standard Peripheral Library (HARDWARE and STM32F10x_FWLib)
• CMSIS‑DSP v1.4.4 (USER/arm_fft_bin_example_f32.c, .h)
• Keil MDK‑ARM project files (.uvprojx, .uvoptx)
Essential Elements to Capture
• MCU core & vector table
• Clock and SysTick subsystem
• ADC acquisition path
• DSP processing block (CMSIS‑DSP)
• Output path (LCD driver → TFT)
• Support services (delay, usart, LED)
• External hardware interfaces (TFT, analog sensor, debug port)