Thanks to visit codestin.com
Credit goes to github.com

Skip to content

How to Call Flash with JLink or STLink in CMake? #4

@breakersun

Description

@breakersun

Found the flash-st and flash-jlink target in makefile are quite handy for daily jobs.

stm32/Makefile

Lines 55 to 67 in 79d6508

flash-st: build
st-flash --reset write $(FIRMWARE) 0x08000000
$(BUILD_DIR)/jlink-script:
touch $@
@echo device $(DEVICE) > $@
@echo si 1 >> $@
@echo speed 4000 >> $@
@echo loadfile $(FIRMWARE),0x08000000 >> $@
@echo -e "r\ng\nqc" >> $@
flash-jlink: build | $(BUILD_DIR)/jlink-script
JLinkExe -commanderScript $(BUILD_DIR)/jlink-script

So I was wondering, how can we achieve the same thing in CMake process?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions