OpenCores
URL https://opencores.org/ocsvn/neorv32/neorv32/trunk

Subversion Repositories neorv32

[/] [neorv32/] [trunk/] [sw/] [image_gen/] [uart_upload.sh] - Diff between revs 34 and 62

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 34 Rev 62
Line 6... Line 6...
 
 
if [ $# -ne 2 ]
if [ $# -ne 2 ]
then
then
  echo "Upload image via serial port (UART) to the NEORV32 bootloader."
  echo "Upload image via serial port (UART) to the NEORV32 bootloader."
  echo "Reset processor before starting the upload."
  echo "Reset processor before starting the upload."
  echo "Usage:   [sudo] sh uart_upload.sh <tty> <file>"
  echo "Usage:   [sudo] sh uart_upload.sh <port> <NEORV32 executable>"
  echo "Example: sh uart_upload.sh /dev/ttyS6 neorv32_exe.bin"
  echo "Example: sh uart_upload.sh /dev/ttyS6 neorv32_exe.bin"
  exit
  exit
fi
fi
 
 
# configure serial port
# configure serial port
Line 18... Line 18...
 
 
# trigger fast upload mode and get response
# trigger fast upload mode and get response
exec 3<$1                              # redirect serial output to fd 3
exec 3<$1                              # redirect serial output to fd 3
  cat <&3 > uart_upload.response.dat & # redirect serial output to file
  cat <&3 > uart_upload.response.dat & # redirect serial output to file
  PID=$!                               # save pid to kill cat
  PID=$!                               # save pid to kill cat
    printf "#" > $1                    # send fast/silent upload to serial port
    printf "u" > $1                    # send upload command to serial port
    sleep 0.5s                         # wait for bootloader response
    sleep 0.5s                         # wait for bootloader response
  kill $PID                            # kill cat process
  kill $PID                            # kill cat process
 
 
exec 3<&- # free fd 3
exec 3<&- # free fd 3
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.