1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-11-26 16:08:27 +02:00
ben-wpan/atusb/fw
Werner Almesberger f91738c306 atusb/fw/usb/: adapted DFU engine to current stack and abstracted Flash ops
- dfu.c: updated includes
- dfu.c (device_descriptor): renamed USB IDs from USB_VENDOR/PRODUCT to
  DFU_USB_VENDOR/PRODUCT to allow differentiation
- dfu.c: changed all __bit to "int"
- dfu.c: removed all __xdata and __reentrant
- dfu.c: changed "ep0" to "eps[0]"
- dfu.c (payload, flash_erase_page, flash_write_byte, block_write,
  block_receive, block_transmit, my_setup): abstracted Flash interface
  and removed target-specific operations
- dfu.h: added prototypes for target-specific Flash operations
- dfu,c (my_setup, my_descr): removed SDCC-specific hacks
- dfu.c (my_reset): commented out - did we actually use this ?
2011-03-08 19:10:58 -03:00
..
an moved atusb/fw3/ to atusb/fw/ 2011-02-22 00:24:07 -03:00
include atusb/fw2/: assigned hardware revision code point; some cleanup 2011-02-10 07:24:37 -03:00
usb atusb/fw/usb/: adapted DFU engine to current stack and abstracted Flash ops 2011-03-08 19:10:58 -03:00
atusb.c usb/fw/atusb.c (main): removed 100 ms LED flash 2011-03-08 19:03:25 -03:00
board.c moved atusb/fw3/ to atusb/fw/ 2011-02-22 00:24:07 -03:00
board.h atusb/fw/: moved USB IDs from descr.c to board.h 2011-03-08 19:01:54 -03:00
descr.c atusb/fw/: moved USB IDs from descr.c to board.h 2011-03-08 19:01:54 -03:00
ep0.c moved atusb/fw3/ to atusb/fw/ 2011-02-22 00:24:07 -03:00
Makefile atusb/fw/Makefile: abstract host so that one can use HOST=ben instead of jlime 2011-03-04 21:50:01 -03:00
README moved atusb/fw3/ to atusb/fw/ 2011-02-22 00:24:07 -03:00
spi.c moved atusb/fw3/ to atusb/fw/ 2011-02-22 00:24:07 -03:00
spi.h moved atusb/fw3/ to atusb/fw/ 2011-02-22 00:24:07 -03:00
version.h moved atusb/fw3/ to atusb/fw/ 2011-02-22 00:24:07 -03:00

Requires very recent toolchain, because ATmega32U2 is relatively new.

Building:

make
make upload prog

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

Making the toolchain:

# patches according to
# http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=789527

# some gcc prerequisites

apt-get remove avr-libc gcc-avr binutils-avr
apt-get install libmpfr-dev libmpc-dev

# binutils

wget http://ftp.gnu.org/gnu/binutils/binutils-2.21.tar.bz2
tar xfj binutils-2.21.tar.bz2 
cd binutils-2.21
./configure --target=avr --disable-nls
make
make install

# gcc

wget http://ftpmirror.gnu.org/gcc/gcc-4.5.2/gcc-4.5.2.tar.bz2
wget -O gcc_452_avr.patch http://gcc.gnu.org/bugzilla/attachment.cgi?id=23050
tar xfj gcc-4.5.2.tar.bz2
cd gcc-4.5.2
patch -p1 -s <../gcc_452_avr.patch
mkdir obj-avr
cd obj-avr
../configure --target=avr --enable-languages=c \
    --disable-nls --disable-libssp --with-dwarf2
make
make install

wget http://download.savannah.gnu.org/releases/avr-libc/avr-libc-1.7.0.tar.bz2
wget -O avr_libc_170.patch \
  https://savannah.nongnu.org/support/download.php?file_id=21669
tar xfj avr-libc-1.7.0.tar.bz2 
cd avr-libc-1.7.0
patch -p0 -s <../avr_libc_170.patch
./bootstrap	# the automake at the end takes a while
./configure --build=`./config.guess` --host=avr
make
make install