--- 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. The repo root is the working directory; use the repo-relative path (the old absolute path `D:\Code\DTU 程序\...` is stale): ```powershell & "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.