Skip to content

Commit

Permalink
Fix stlink upload scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
terrillmoore committed May 7, 2021
1 parent bea7343 commit 3d6f75a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions tools/linux/stlink_upload
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ fi

# cater to system differences
if [[ "$(uname)" = "Darwin" ]]; then
export DYLD_LIBRARY_PATH="$TOOLDIR/stlink/lib"
DYLD_LIBRARY_PATH="$TOOLDIR/stlink/lib"
else
if [[ "$(uname -m)" = "x86_64" ]]; then
TOOLDIR="$(dirname "$TOOLDIR")/linux64"
Expand All @@ -105,14 +105,14 @@ fi

# upload the bootloader
if [[ "$BOOTLOADER" != "-" ]]; then
if ! "$TOOLDIR"/stlink/st-flash write "$BOOTLOADER" 0x0x08000000; then
if ! "$TOOLDIR"/stlink/st-flash --format binary write "$BOOTLOADER" 0x08000000 ; then
echo "Error uploading bootloader"
exit 1
fi
fi

# upload the main file
if ! "$TOOLDIR"/stlink/st-flash write "$FILE" "$BASEADDR"; then
if ! "$TOOLDIR"/stlink/st-flash --format binary write "$FILE" "$BASEADDR" ; then
echo "Error uploading $FILE"
exit 1
fi
Expand Down
6 changes: 3 additions & 3 deletions tools/macosx/stlink_upload
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ fi

# cater to system differences
if [[ "$(uname)" = "Darwin" ]]; then
export DYLD_LIBRARY_PATH="$TOOLDIR/stlink/lib"
DYLD_LIBRARY_PATH="$TOOLDIR/stlink/lib"
else
if [[ "$(uname -m)" = "x86_64" ]]; then
TOOLDIR="$(dirname "$TOOLDIR")/linux64"
Expand All @@ -105,14 +105,14 @@ fi

# upload the bootloader
if [[ "$BOOTLOADER" != "-" ]]; then
if ! "$TOOLDIR"/stlink/st-flash write "$BOOTLOADER" 0x0x08000000; then
if ! "$TOOLDIR"/stlink/st-flash --format binary write "$BOOTLOADER" 0x08000000 ; then
echo "Error uploading bootloader"
exit 1
fi
fi

# upload the main file
if ! "$TOOLDIR"/stlink/st-flash write "$FILE" "$BASEADDR"; then
if ! "$TOOLDIR"/stlink/st-flash --format binary write "$FILE" "$BASEADDR" ; then
echo "Error uploading $FILE"
exit 1
fi
Expand Down

0 comments on commit 3d6f75a

Please sign in to comment.