Files
STM32F4-Base/.opencode/command/download.md
T
2026-08-30 15:38:40 +08:00

21 lines
912 B
Markdown

---
description: Download (flash) the program to the STM32 via Keil MDK. Use ONLY when the user asks to flash, download, program, or burn the firmware to the MCU.
agent: build
---
Run the Keil MDK flash download by executing the download script with the bash tool. Use the absolute path, NOT relative cd:
```powershell
& "D:\Code\DTU 程序\STM32F4-Base\MDK-ARM\download.bat"
```
Then read the tail of `MDK-ARM/download_log.txt` and report the result.
This compiles the project then flashes the target via the configured debugger (ST-Link).
Exit code interpretation:
- 0 = download successful — PASS
- nonzero = download/build failed — see `MDK-ARM/download_log.txt` for details
Note: Since flashing overwrites the running firmware, confirm the debug probe is connected and the user is ready to flash before running this. If the user only wants to verify compilation (not flash), use `@build` instead.