Skip to content

Commit

Permalink
added myflash.sh scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
Sven Oliver Moll committed Mar 5, 2021
1 parent 182d570 commit 3b9f1f5
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 6 deletions.
20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,9 @@ FAQ

* Can I send any CDTV specific codes via keyboard? \
This is possible. Right now, only one keystroke is implemented: the power
button. This way you can turn the machine on, if it is powered by the
4-pin mini DIN connector. Others can be implemented as well, just ask.
button (PrtSc/SysRq). This way you can turn the machine on, if it is
powered by the 4-pin mini DIN connector. Others can be implemented as well,
just ask.

* Do I have to install the Arduino IDE just for flashing? \
No, precompiled hex-files ready for flashing are included in the directory
Expand All @@ -119,20 +120,27 @@ FAQ
a hex-file as a standalone application. "Duemilanove/Nano(ATmega328)"
worked for me as the device to upload to. Linux users need the command
line tool "avrdude" and the search engine of your choice to figure out
the commandline parameters for the ATmega328 microcontroller used.
the commandline parameters for the ATmega328p microcontroller used. There
also is a script called "myflash.sh" in this directory that _might_ work
with your environment as well, but to be honest it's just a quick hack I
did for my setup.

* Why can't I compile the project with the Arduino IDE on Windows? \
The git client you're using is not configured to be using symbolic links.
I'm using symlinks as a hack to build different variants with an almost
similar codebase. I had to cope with a bad IDE and a bad OS. A possbile
solution is described
similar codebase. Coping with a bad IDE and a bad OS, this was the best
setup I could come up with. A possible solution is described
[here](https://github.community/t/git-bash-symbolic-links-on-windows/522/4).

* Why doesn't pressing both mouse buttons bring on the menu on Kickstart 2+? \
The microcontroller needs more time to start up and run USB detection than
it takes for the Amiga to boot and check for the mouse buttons. Doing a
keyboard reset (Ctrl-Win/Amiga-Win/Amiga or Ctrl-Alt-Delete) and then
pressing both buttons will do the trick.
pressing both buttons will do the trick. Also to shorten the startup time,
it should be possible to flash this firmware without a bootloader using an
[ICSP programmer](https://en.wikipedia.org/wiki/In-system_programming).
But this only seems to be possible with the USB host shield disconnected,
so this probably would mean: no updating.

------------------------------------------------------------------------------

Expand Down
28 changes: 28 additions & 0 deletions hex/myflash.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/sh

DEVICE="/dev/ttyUSB0"
HEXFILE=""

for i; do
case "${i}" in
/dev/*) DEVICE="${i}" ;;
*) HEXFILE="${i}" ;;
esac
done

if [ -z "${HEXFILE}" -o ! -f "${HEXFILE}" ]; then
cat <<EOF
usage: $0 (<device>) <hexfile>
Will try to use avrdude to flash the specified hexfile into the Arduino.
The following configuration is assumed:
- ATmega328p @ 3.3V
- Arduino bootloader @ 57600 Baud
- Serial interface @ ${DEVICE} (can be changed by parameter)
(This script is called "myflash.sh" because it might not work for you!)
EOF
exit 1
fi

exec avrdude -v -patmega328p -carduino -P"${DEVICE}" -b57600 -D -Uflash:w:"${HEXFILE}":i

0 comments on commit 3b9f1f5

Please sign in to comment.