Skip to content

Commit

Permalink
tools/cpy2remed: Addition of cpy2remed programmer to nucleo-L552ZE-Q
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysztof-cabaj committed Feb 11, 2022
1 parent 4aa173d commit d417e95
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 0 deletions.
6 changes: 6 additions & 0 deletions boards/nucleo-l552ze-q/Makefile.include
Original file line number Diff line number Diff line change
@@ -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
16 changes: 16 additions & 0 deletions boards/nucleo-l552ze-q/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

## 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,
Expand Down Expand Up @@ -34,6 +36,20 @@ 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).


## Supported Toolchains

For using the ST Nucleo-L552ZE-Q board we recommend the usage of the
Expand Down
13 changes: 13 additions & 0 deletions dist/tools/cpy2remed/cpy2remed.sh
Original file line number Diff line number Diff line change
@@ -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"
6 changes: 6 additions & 0 deletions makefiles/tools/cpy2remed.inc.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

FLASHER ?= $(RIOTTOOLS)/cpy2remed/cpy2remed.sh

FLASHFILE ?= $(HEXFILE)

FFLAGS ?= $(FLASHFILE) $(DIR_NAME_AT_REMED)

0 comments on commit d417e95

Please sign in to comment.