Here's how to adapt the FreeRTOS [STM32](https://www.ampheo.com/search/STM32) example (LED blink + UART print + ADC read) for different STM32 chips, including pinout hints and differences you may need to watch for. ![stm32-boards-1024x482](https://hackmd.io/_uploads/SyrYvCJSgl.jpg) **Target Options** You can apply this example to any STM32 with: * FreeRTOS support * GPIO output * ADC peripheral * UART peripheral Below are versions for popular STM32 chips: **[STM32F103C8T6](https://www.ampheo.com/product/stm32f103c8t6-131876) (Blue Pill)** ![企业微信截图_20250630171006](https://hackmd.io/_uploads/BJ6O4CySgx.png) **Notes:** * Use USART1 (PA9/PA10) since it's default and easier for USB-UART * Supply 3.3V (NOT 5V) to peripherals * You can use printf via HAL_UART_Transmit **[STM32L432KC](https://www.ampheo.com/search/STM32L432KC) ([Nucleo-L432KC](https://www.onzuu.com/product/stmicroelectronics-nucleo-l432kc-3220002))** ![企业微信截图_20250630171051](https://hackmd.io/_uploads/SyqjV0yHgg.png) **Notes:** * Use Low Power modes if needed (FreeRTOS handles idle) * Cortex-M4 with FPU; optimize math in ADC task **[STM32H743ZI](https://www.ampheo.com/search/STM32H743ZI) ([Nucleo-H743ZI2](https://www.onzuu.com/product/stmicroelectronics-nucleo-h743zi2-3217326))** ![企业微信截图_20250630171135](https://hackmd.io/_uploads/BJDR40JSle.png) **Notes:** * Enable DCache & ICache carefully in FreeRTOS projects * [STM32H7](https://www.ampheo.com/search/STM32H7) uses separate DTCM and AXI SRAM — configure stack carefully * More performance headroom; can use vTaskDelayUntil for precise timing **How to Adapt in STM32CubeIDE** **Step-by-Step:** 1. Create a new [STM32](https://www.ampheoelec.de/search/STM32) project for your target chip 2. Open the .ioc file and: * Enable GPIO (for LED) * Enable UART (e.g., USART1 or 2) * Enable ADC1 on available pin * Enable FreeRTOS → CMSIS v2 3. Add 3 tasks: * blinkLED * uartTask * adcTask 4. Implement code same as in the [STM32F4](https://www.ampheo.com/search/STM32F4) example, adjusting pin names if needed 5. Compile and flash the board **Summary Table for Popular Targets** ![企业微信截图_20250630171305](https://hackmd.io/_uploads/S1l4HCJSxg.png)