1. Development Environment Setup
The 9Mod MCPBoard uses STM32F103CBT6 as the main MCU, communicating with the Ai-WV01-32S-Kit development board via the emMCP library for MCP protocol interaction.
Install STM32CubeIDE
Download and install STM32CubeIDE (includes STM32CubeMX, ARM GCC toolchain, and debugger all in one):
STM32CubeIDE is ST's all-in-one development environment. After installation you can compile, flash, and debug with no additional toolchain configuration.
Install VSCode Extensions (optional)
If you prefer editing code in VSCode, install these extensions from the marketplace:
- C/C++ — Code completion, navigation, syntax checking
- Cortex-Debug — ST-Link debugging support
- CMake — CMake syntax highlighting and integrated build
Get the Source Code
git clone https://github.com/Ai-Thinker-Open/emMCP.gitBuild the Firmware
cd emMCP/example/9Mod_MCPBoard
mkdir -p build && cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/gcc-arm-none-eabi.cmake
make -j$(nproc)After a successful build, the build/ directory will contain the 9Mod_MCPBoard.elf firmware file.
To produce a raw binary .bin file, run:
arm-none-eabi-objcopy -O binary 9Mod_MCPBoard.elf 9Mod_MCPBoard.binFlash
Connect an ST-Link debugger to the SWD interface (PA13 SWDIO / PA14 SWCLK / GND). Flash via STM32CubeIDE or OpenOCD:
openocd -f interface/stlink.cfg -f target/stm32f1x.cfg \
-c "program build/9Mod_MCPBoard.elf verify reset exit"2. Reference Video
3. Peripheral Pin Quick Reference
| Function Module | STM32 Pin | Interface |
|---|---|---|
| AI Module Communication | PA2(TX) / PA3(RX) | USART2 @ 115200 |
| TTL Debug Serial | PA9(TX) / PA10(RX) | USART1 @ 1500000 |
| OLED Display | PA1(DC) / PA4(CS1) / PA5(CLK) / PA7(MOSI) / PB0(CS2) | SPI |
| Radar Detection [Reserved] | PA8 | GPIO Input |
| Relay | PB5 | GPIO Output |
| WS2812 LED Strip | PA11 | TIM1_CH4 PWM+DMA |
| IR AC Control [Reserved] | PB10(TX) / PB11(RX) | USART3 |
| Temp/Humidity + PD Decoy | PB6(SDA) / PB7(SCL) | I²C (shared bus: SHT30=0x44, CH224K=0x22) |
| User Buttons | PB4 / PB8 | GPIO Input |
| SWD Debug Port | PA13(SWDIO) / PA14(SWDCLK) | SWD |
For full development documentation, refer to the emMCP Programming Guide and Quick Start Guide.

