mirror of
git://projects.qi-hardware.com/ben-wpan.git
synced 2024-11-22 13:49:21 +02:00
5129029d3b
This patch adds support for the rzusbstick for the atusb firmware. More detailed information about this usb stick: http://www.atmel.com/tools/rzusbstick.aspx Original I have the rzraven kit: http://www.atmel.com/tools/rzraven.aspx Which comes with a special cable and avr dragon programmer. You need some programmer and wires to the programmers pins. To lookup how to connect the programmer to the rzusbstick pinout, see: http://www.atmel.com/Images/doc8117.pdf page 22 (schematics of the rzusbstick). Difference between atusb and rzusbstick(rzusb) is mainly the at86rf231 vs at86rf230 one. The rzusb contains the at86rf230 which is a little bit hard to deal with it (and has a huge errata inside the datasheet). Nevertheless with small schanges the atusb firmware can run now on the rzusb. The rzusb contains also a bigger mcu, so we can maybe cache more pdus for receive handling. To compile the rzusb firmware call: make NAME=rzusb this will generate the rzusb.bin then call the programmer (in my case avrdude): avrdude -P usb -c dragon_jtag -p usb1287 -U flash:w:rzusb.bin NOTE: currently there is no chance (I suppose) to ensure that the atusb receive the correct firmware, so don't try to flash the atusb with the rzusb firmware! Also the vendor and product id is the same. This currently a RFC, it's a quick hack and I think we should update more the documentation to support the rzusb. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Cc: Stefan Schmidt <stefan@osg.samsung.com> Cc: Werner Almesberger <werner@almesberger.net> |
||
---|---|---|
.. | ||
an | ||
include | ||
usb | ||
atusb.c | ||
board_app.c | ||
board.c | ||
board.h | ||
boot.c | ||
descr.c | ||
ep0.c | ||
flash.c | ||
mac.c | ||
mac.h | ||
Makefile | ||
README | ||
sernum.c | ||
sernum.h | ||
spi.c | ||
spi.h | ||
version.h |
Requires a very recent toolchain, because ATmega32U2 is relatively new. - Building: make - Uploading the firmware to a Ben (for flashing with the atusb-pgm cable): make HOST=<hostname> upload Example: make HOST=ben upload HOST defaults to "jlime". - Flashing the boot loader: Prerequisite: avrdude on the Ben. Disconnect the atusb board from USB. Insert the atusb-pgm connector into the Ben. Place the atusb-pgm adapter on the exposed contact pads of the atusb board and push it down. Then run make prog This takes about 30 seconds. If the programming fails with an error message like "Yikes! Invalid device signature.", verify that the atusb-pgm board is properly connected and placed, then try again. - Uploading the application: Prerequisite: dfu-util installed on the PC. Insert atusb into the PC, then run make dfu Note: since the boot loader resets the USB bus after timing out, this operation can fail with a message like "No DFU capable USB device found". Just retry, and it will eventually get through. -------------------------- 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.1.tar.bz2 tar xfj avr-libc-1.7.1.tar.bz2 cd avr-libc-1.7.1 ./bootstrap # the automake at the end takes a while ./configure --build=`./config.guess` --host=avr make make install