How ciqi6/embedlearn works
Project type and purpose
• This is an embedded-system learning/demo project targeting an STM32F10x microcontroller.
• It uses ARM’s CMSIS core support plus ST’s “FWlib” standard-peripheral library.
• The “User” folder contains drivers (LED, Key, SysTick, TimerBase, USART) and the main application.
File structure
• Top-level folders:
• Libraries/CMSIS – core Cortex‐M3 startup, vector table, system init
• Libraries/FWlib – ST’s peripheral drivers (GPIO, TIM, USART, EXTI, etc.)
• User – board-support drivers and application code
• Notice the typical HAL/BSP layering: application → BSP (User/*.c,h) → peripheral library → CMSIS → hardware.
README
• Brief description: “A embedded system Learning project organized by GDOU.”
• Confirms this is an educational/demo full-embedded stack from reset/startup to application.
Main components and their interactions
a. Components
• MCU Block (STM32F10x)
– Cortex‐M3 core (startup_stm32f10x*.s, system_stm32f10x.c)
– Peripherals: GPIO, EXTI, TIM (SysTick, TimerBase), USART
• Middleware
– CMSIS (core headers & system init)
– FWlib (stm32f10x_*.c/h drivers)
• Board-support & application
– LED driver (User/Led)
– Key (button) driver (User/Key, external interrupt)
– SysTick & TimerBase (User/SysTick, User/TimerBase)
– USART1 module (User/Usatrt)
– main.c & interrupt handlers (User/main.c, User/stm32f10x_it.c)
b. Relationships & data flow
– On reset: startup assembly → system_stm32f10x.c configures clock → main() in User launches init.
– main() initializes BSP modules (LED, Key, SysTick, TimerBase, USART1).
– SysTick and TimerBase drive scheduling/ticks.
– Key presses generate EXTI interrupts → User/Key/exti.c → signals application.
– USART1 handles serial RX/TX with interrupt service routines (stm32f10x_it.c).
– Application logic toggles LED or sends data over USART.
c. Architectural patterns
– Layered: hardware → CMSIS → peripheral library → BSP → application.
– ISR-driven events + tick scheduler for timeouts.
d. Key technologies & libraries
– ARM Cortex‐M3 (CMSIS)
– ST Standard Peripheral Library (FWlib)
– GNU ARM toolchain or Keil (implied by .s startup files)
Essential details to capture
• Startup/reset path (assembly → system init → main).
• The layered encapsulation: application never touches registers directly, it uses BSP → FWlib → CMSIS.
• ISR registration: vector table in startup files, mapping to User interrupt handlers.
• Timer architecture: SysTick vs general-purpose TimerBase.
• Pin mapping (e.g., PAx for LED, PBx for Key, PA9/PA10 for USART1).