Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools/cpy2remed: Addition of new programmer for nucleo boards #17550

Merged
merged 1 commit into from
Feb 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
15 changes: 15 additions & 0 deletions boards/nucleo-l552ze-q/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
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)