MCUProg
MCU programmer for J-LINK and DAPLink, using Keil MDK's *.FLM Flashing Algorithm
Install / Use
/learn @XIVN1987/MCUProgREADME
MCUProg
MCU programmer for J-LINK and DAPLink, using Keil MDK's *.FLM Flashing Algorithm
To run this software, you need python 3.6+ and pyqt5.
To use DAPLink, you need additional pyusb for CMSIS-DAPv2 and another usb-backend for CMSIS-DAPv1 (hidapi or pywinusb for windows, hidapi for mac, pyusb for linux).
pip install PyQt5 pyusb hidapi six pyelftools

add new chip
Simple method
add chip's name and FLM file path in devices.txt as below:
STM32F103C8 FlashAlgo/STM32F10x_128.FLM
and then, MCUProg can erase/write STM32F103C8.
In the previous configuration, we assume that chip's RAM locates at 0x20000000, and FLM uses 4KB RAM.
If the default values do not apply to your chip, you can explicitly specify the address and size of RAM used by FLM as below:
NUM480 0x20000000 0x2000 FlashAlgo/M481_AP_512.FLM
Powerful method
- put new_chip.FLM to FlashAlgo folder
- run FlashAlgo/flash_algo.py to generate new_chip_algo.py
- add below code in device/new_chip.py file:
class new_chip(chip.Chip):
def __init__(self, xlink):
super(new_chip, self).__init__(xlink, 'new_chip_algo')
- add below code in device/__init__.py file:
('new_chip', new_chip.new_chip),
In class new_chip, you can add arbitrary python code to do something FLM don't support, so i call it 'Powerful method'.
FlashAlgo/flash_algo.py is used to parse Keil MDK's *.FLM file and extract code and its runing information into a python dict.
multi file programming
By using STM32_withBoot.ini with content as below, you can write multi file to different address one-time for same flash algorithm.
[BOOT]
addr = 0x00000
path = D:/work_dir/STM32-Boot-Demo/STM32_UserBoot/out/STM32_stdperiph_lib.hex
[APP]
addr = 0x10000
path = D:/work_dir/STM32-Boot-Demo/STM32_App/out/STM32_stdperiph_lib.bin
Related Skills
node-connect
339.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.9kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
339.5kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
83.9kCommit, push, and open a PR
