diff --git a/boards/nucleo-l552ze-q/Makefile.include b/boards/nucleo-l552ze-q/Makefile.include index a7e3adb0d8..ead4e16dcb 100644 --- a/boards/nucleo-l552ze-q/Makefile.include +++ b/boards/nucleo-l552ze-q/Makefile.include @@ -1,2 +1,8 @@ +#variable needed by cpy2remed PROGRAMMER +#it contains name of ST-Link removable media +DIR_NAME_AT_REMED = "NODE_L552ZE" + +PROGRAMMERS_SUPPORTED += cpy2remed + # load the common Makefile.include for Nucleo boards include $(RIOTBOARD)/common/nucleo144/Makefile.include diff --git a/boards/nucleo-l552ze-q/doc.txt b/boards/nucleo-l552ze-q/doc.txt index a931373355..d0bbbe61c6 100644 --- a/boards/nucleo-l552ze-q/doc.txt +++ b/boards/nucleo-l552ze-q/doc.txt @@ -36,6 +36,8 @@ of Flash. ## Flashing the device +### Flashing the Board Using OpenOCD + The ST Nucleo-L552ZE-Q board includes an on-board ST-LINK programmer and can be flashed using OpenOCD. @note The upstream version of OpenOCD doesn't contain yet support for this board, @@ -65,6 +67,19 @@ and debug via GDB by simply typing make BOARD=nucleo-l552ze-q debug ``` +### Flashing the Board Using ST-LINK Removable Media + +On-board ST-LINK programmer provides via composite USB device removable media. +Copying the HEX file causes reprogramming of the board. This task +could be performed manually; however, the cpy2remed (copy to removable +media) PROGRAMMER script does this automatically. To program board in +this manner, use the command: +``` +make BOARD=nucleo-l552ze-q PROGRAMMER=cpy2remed flash +``` +@note This PROGRAMMER was tested using ST-LINK firmware 2.37.26. Firmware updates +could be found on [this STM webpage](https://www.st.com/en/development-tools/stsw-link007.html). + ## Accessing RIOT shell Default RIOT shell access utilize VCP (Virtual COM Port) via USB interface, diff --git a/dist/tools/cpy2remed/cpy2remed.sh b/dist/tools/cpy2remed/cpy2remed.sh new file mode 100755 index 0000000000..a5ad573448 --- /dev/null +++ b/dist/tools/cpy2remed/cpy2remed.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +#cpy2remed - copy to removable media +#$1 contains generated hexfile +#$2 contains directory name for this particular nucleo board which could be +# set in the board makefile.include using variable DIR_NAME_AT_REMED + +HEXFILE="$1" +DEV_DIR="$2" + +REMED_MOUNT_PATH="${REMED_MOUNT_PATH:-/media/$USER/$DEV_DIR/}" + +cp "$HEXFILE" "$REMED_MOUNT_PATH" diff --git a/makefiles/tools/cpy2remed.inc.mk b/makefiles/tools/cpy2remed.inc.mk new file mode 100644 index 0000000000..2135cf90b8 --- /dev/null +++ b/makefiles/tools/cpy2remed.inc.mk @@ -0,0 +1,6 @@ + +FLASHER ?= $(RIOTTOOLS)/cpy2remed/cpy2remed.sh + +FLASHFILE ?= $(HEXFILE) + +FFLAGS ?= $(FLASHFILE) $(DIR_NAME_AT_REMED)