aboutsummaryrefslogtreecommitdiff
path: root/scripts/fw-to-ihex.sh
blob: 91a88fd6a1ceef1fd38530271c4dcf9a294e13a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/bash

F=$1
if [ "$F" = "" ]
then
	echo You must supply a firmware file.
	exit 1
fi

echo "unsigned char d[] = {" > $F.c
hexdump -v -e '"\t" 8/1 "0x%02x, " "\n"' $F >> $F.c
echo "};" >> $F.c

gcc -c $F.c
objcopy -Oihex $F.o $F.ihex