CMSIS DAPlink on Jolt or Streamline Connect

From Stm32World Wiki
(Redirected from CMSIS DAPlink)
Jump to navigation Jump to search
Jolt Connect device

This page documents how to run CMSIS DAPlink firmware on a Jolt Connect or Streamline Connect.

Build from Source

First clone this repository.

Enter the folder and create a virtual python environment

lth@ncpws04:~$ cd src/DAPLink
lth@ncpws04:~/src/DAPLink$ virtualenv venv
lth@ncpws04:~/src/DAPLink$ . venv/bin/activate
(venv) lth@ncpws04:~/src/DAPLink$ pip install -r requirements.txt

You can now build the two targets - the bootloader and the actual DAPLink firmware:

(venv) lth@ncpws04:~/src/DAPLink$ python tools/progen_compile.py --clean stm32f103xb_bl  stm32f103xb_stm32f103rb_if

Flashing with ST-Link

After successful build, enter the resulting directory and flash using a st-link:

lth@ncpws04:~/src/DAPLink$ st-flash erase ; st-flash write projectfiles/make_gcc_arm/stm32f103xb_bl/build/stm32f103xb_bl.bin 0x8000000

Reconnect the daplink device. It will show up as a disc labelled MAINTENANCE. Mount that and copy the firmware file over. On my system:

lth@ncpws04:~/src/DAPLink$ cp projectfiles/make_gcc_arm/stm32f103xb_stm32f103rb_if/build/stm32f103xb_stm32f103rb_if.bin /run/media/lth/MAINTENANCE/

The device will now be a DAPLink.

Flashing a target with DAPLink

There are multiple tools and approaches but the most "generic" is probably to use openocd. In a Makefile I got the following target:

flash: $(BUILD_DIR)/firmware.elf
	openocd -f interface/cmsis-dap.cfg -f target/stm32f4x.cfg -c "program $< verify reset exit"

Another benefit is that the same approach can be used for debugging and that it is easy to switch between ST-Link and DAPLink.

Here's an example of multiple flash targets using different tools:

stlflash: $(BUILD_DIR)/firmware.bin
	st-flash --reset write $< 0x8000000

stflash: $(BUILD_DIR)/firmware.bin
	openocd -f interface/st-link.cfg -f target/stm32f4x.cfg -c "program $< verify reset exit"

dapflash: $(BUILD_DIR)/firmware.bin
	pyocd flash --target stm32f412xe --base-address 0x8000000 $<

flash: $(BUILD_DIR)/firmware.elf
	openocd -f interface/cmsis-dap.cfg -f target/stm32f4x.cfg -c "program $< verify reset exit"

Miscellaneous links