Programming the firmware ===================================================== Instructions for programming in Windows ===================================================== First, you need to download FLIP (Flexible In-system Programmer), the software tool from Atmel for flashing firmware: http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3886 When your sdr-widget is plugged in for the first time, Windows will ask for a driver. You can find the driver in the FLIP directory (c:\program files\atmel\flip 3.4.2\usb). To use FLIP in 64bit versions of Windows, you may need a "signed" driver, which can be downloaded from: http://www.avrfreaks.net/index.php?module=Freaks%20Files&func=viewFile&id=3842&showinfo=1 Next, download the version of widget firmware you would like to flash. For new Windows users, I would suggest you start with: /demo_UAC1_v087_a_WinXP.tar.gz Various versions of the firmware can be downloaded from: http://code.google.com/p/sdr-widget/downloads/list To extract files from this compressed file, you use a utility called 7zip (download from http://www.7-zip.org/). Extract the file "demo_composite.elf" from the Release subdirectory. Copy this file to the following directory: c:\Program Files\Atmel\Flip 3.4.2\bin In a terminal window, cd to this directory: > cd c:\Program Files\Atmel\Flip 3.4.2\bin Connect the widget, press the PRG button down, and keeping it down, press RESET button once. This puts the widget in bootloader mode, readying for programming. > batchisp -device at32uc3a3256 -hardware usb -operation erase f memory flash blankcheck loadbuffer demo_composite.elf program verify start reset 0 (Note the above command is all in one line.) After flashing the firmware, press RESET button on widget once. The new firmware should start running and Windows may now find a new hardware device, and will start asking for drivers. Depending on the version of firmware, you will need to install one or two Windows drivers: Download the relevant drivers from: http://code.google.com/p/sdr-widget/downloads/list For demo_UAC1_v087_a_WinXP, you will need to install: SDRWDGT-USB-Driver-1.2.1.0.zip Unzip the driver into a convenient location, eg the Desktop. Lead Windows to the driver. ============================================================ Instructions for programming in Linux Ubuntu 10.04 and later ============================================================ NOTE: the stock dfu-programmer currently does NOT support "User Page" programming. User Page is used in the sdr-widget firmware to store radio control parameters such as filter crossover points and calibration data (like EEPROM). (1) I have a hacked version of dfu-programmer which skips the "User Page" flashing without exiting in Address Error. This hacked dfu-programmer has been tested to be able to flash all the existing firmware that I have tested. It can be downloaded from: http://code.google.com/p/sdr-widget/downloads/list You install this hacked version instead of the one from Ubuntu. (2) Next, install the ELF to HEX conversion utility: > sudo apt-get install binutils-avr (3) You create a script called, say, program-widget: #!/bin/bash ## ## program the sdr-widget under linux as of Sun May 1, 2011 ## accepts either a widget.elf file or a widget.hex file ## echo program-widget with $1 [[ -z $1 ]] && echo "no file specified to program-widget" && exit 1 [[ ! -f $1 ]] && echo "no such file '$1'" && exit 1 case $1 in *.elf) hex=/tmp/`basename $1 .elf`.hex objcopy -O ihex $1 $hex && \ dfu-programmer at32uc3a3256 erase --debug 6 && \ dfu-programmer at32uc3a3256 flash --suppress-bootloader-mem $hex --debug 6 && \ dfu-programmer at32uc3a3256 reset --debug 4 && \ rm $hex && \ exit 0 ;; *.hex) dfu-programmer at32uc3a3256 erase --debug 6 && \ dfu-programmer at32uc3a3256 flash --suppress-bootloader-mem $1 --debug 6 && \ dfu-programmer at32uc3a3256 reset --debug 4 && \ exit 0 ;; *) echo unrecognized file format for programming: $1 exit 1 esac (5) Create (or modify an existing) 99-avrtools.rules in /ect/udev/rules.d # ICE50: SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2101", MODE:="0666" # JTAGICE mkII: SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2103", MODE:="0666" # AVRISP mkII: SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2104", MODE:="0666" # AVRONE: SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2105", MODE:="0666" # STK600: SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2106", MODE:="0666" # AVR Dragon: SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2107", MODE:="0666" # RzUsbStick: SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="210a", MODE:="0666" # QT600: SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2114", MODE:="0666" # QT600P: SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2116", MODE:="0666" # Add support AT32UC3A0128 AT32UC3A0256 AT32UC3A0512 # AT32UC3A1128 AT32UC3A1256 AT32UC3A1512 SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ff8", MODE:="0666" # Add support AT32UC3A3256 SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ff1", MODE:="0666" # Add support AT32UC3B0128 AT32UC3B0256 AT32UC3B064 # AT32UC3B1128 AT32UC3B1256 AT32UC3B164 SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ff6", MODE:="0666" (6) Reboot for this udev rule to take effect. (7) To program: > ./program-widget widget.elf ===================================================== Instructions for programming in Windows, by Mike Collins ===================================================== Hi all, Thought I would start a new post now that the CPU is up and running. Have the board running this morning with the DFU bootloader installed and George's Blinky application code loaded (via USB) and running. Can reset to either the DFU or Blinky depending on the state of the PROGRAM switch installed on the board. Looks rock solid and main computer detects the DFU on USB each time it is reset in that mode. Think we probably need a builders notes section to start documenting known issues. Here is a start: Programming via DFU (i.e. USB): 1) the AVR32 Studio implementation doesn't seem to work. Flip doesn't work for the device either. Must use the batchisp program (in the Program Files\Atmel\Flip 3.3.4\bin directory). The command line at works great is: batchisp -device at32uc3a3256 -hardware usb -operation erase f memory flash blankcheck loadbuffer programname.elf program verify start reset 0 put the desired file (i.e. programname.elf) in the batchisp directory. 2) You can just leave the trampoline in place for code development. That allows the user to download using JTAG or using the DFU with the same *.elf file. With the batchisp DFU the trampoline code is ignored since it overlaps the DFU protected space. Reloading DFU using JTAGICE MKII: 1) the AVR32 Studio implementation for programming bootloader doesn't work. It loads a incorrect FUSE setup that doesn't allow the DFU to run. To reload DFU: set the Fuse Bits(fff7ffff), set the User Configuration at 808001fc (4 bytes of 929e2a9e), then just program the 8K of DFU code Running JTAGICE MKII in AVR32 Studio: 1) the command names are a bit strange to me: Run is really: Program and reset device. Must use resume (or other) to actually "run". Run and Debug are more states than verbs. 2) Make sure you connect the JTAG green connector correctly to the board. The board has pin one on the bottom right side of the JTAG connector. The JTAGICE MKII cable drapes over the top of the processor for proper orientation. 73, Mike Collins KF4BQ ======================================================= Signed Windows Driver for widget - by Fred ======================================================= For Windows, you will need this signed driver (especially for Win 7 64 bit) for the flashed widget to enumerate: http://home.ict.nl/~fredkrom/pe0fko/ca/X/ download the SDRWDGT-USB driver. =======================================================