(home)

Learning About Atmel RZRAVEN

Description:

Introduction

ATAVRRZRAVEN 2.4 GHz Evaluation and Starter Kit product page

Product Links

USB Reverse Engineering Links

libusb and PyUSB links

Issues

(Response)

Code

Running on Linux

(Update: Word from Atmel is this will be able to be supported under libusb. Seems likely. :-) See above.)

All the software supplied from Atmel appears to be Windows only. The underlying USB implementation based on WinDriver does seem to have a Linux version also. WinDriver 9.20 USB User's Manual.

It seems Xilinx hardware/software may use a similar implementation, see these for possible pointers:

The driver seems to use 'windrvr6.o' or platform specific variations thereof.

Tools

At this stage all the firmware appears to be binary only. So in order to do some poking around:

Project Log

srec_cat 3290.infile.hex -intel -o 3290.outfile.bin -Binary
import socket

import time

s = socket.socket()
s.connect(("127.0.0.1", 27000))
s.send("\xaa\x02\x00\x00\x41")

time.sleep(0.5)

print repr(s.recv(1))
s.close()
## Connect and start terminal
#avrdude -p atmega3290 -c avrisp -P /dev/ttyS0 -t -v -F

## Dump the flash of the chip to file
#avrdude -p atmega3290 -c avrisp -P /dev/ttyS0 -v -F -U flash:r:"3290.download.b0rked.bin":r 

## Upload the original hex firmware to the chip (the '-e' isn't strictly necessary)
#avrdude -p atmega3290 -c avrisp -P /dev/ttyS0 -v -F -e -U flash:w:"../3290.infile.hex" 
// Stream and Events.
#define EVENT_STREAM_AC_DATA          0x50
#define EVENT_SNIFFER_SCAN_COMPLETE   0x51
#define EVENT_SNIFFER_ERROR           0x52
#define EVENT_NWK_DATA                0x53
#define EVENT_NWK_JOIN                0x54
#define EVENT_NWK_LEAVE               0x55
export USB_DEBUG=3
srec_cat my3290.hex -intel AVRRAVEN_3290p_BOOTLOADER.hex -intel -offset 0x7000 -o merged.hex -intel
avrdude -p atmega3290 -c avrisp -P /dev/ttyS0 -v -F -e -U flash:w:"merged.hex"
$ srec_info merged.hex -intel
Format: Intel Hexadecimal (MCS-86)
Start:  00000000
Data:   0000 - 00E1
        7000 - 7B71

$ xsltproc get-hv-params.xsl ATmega1284P.xml

produces

    pp_controlstack     =
        0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F,
        0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F,
        0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B,
        0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02;
    hventerstabdelay    = 100;
    progmodedelay       = 0;
    latchcycles         = 6;
    togglevtg           = 1;
    poweroffdelay       = 15;
    resetdelayms        = 1;
    resetdelayus        = 0;
    hvleavestabdelay    = 15;
    chiperasepulsewidth = 0;
    chiperasepolltimeout = 10;
    programfusepulsewidth = 0;
    programfusepolltimeout = 5;
    programlockpulsewidth = 0;
    programlockpolltimeout = 5;
$ xsltproc get-dw-params.xsl ATmega1284P.xml
The source code is available in the project release folder under the respective folders. 
In order to compile the source code provided, WinAVR GCC compiler is a required 
plug-in to AVR Studio.
--- raven3290.c.orig    2008-07-07 23:21:19.000000000 +1200
+++ raven3290.c 2008-07-08 00:16:31.000000000 +1200
@@ -133,7 +133,11 @@
 const tmenu_item menu_items[21];
 #else  // !DOXYGEN
 /** @brief This is the menu text in Flash. See menu_items[] for menu operation. */
+#if 1
+const char menu_text0[] PROGMEM =  "DONKEY8";
+#else
 const char menu_text0[] PROGMEM =  "RES 1.0";
+#endif
 const char menu_text1[] PROGMEM =  "SETUP";
 const char menu_text2[] PROGMEM =  "CHANNEL";
 const char menu_text3[] PROGMEM =  "POWER";
@@ -233,6 +237,13 @@
     // and draw it
     lcd_puts_P(menu.text);

+    lcd_puts_P(PSTR("W00T BOOP DOOP"));
+
+#if 1
+#include "beep.h"
+    beep();
+#endif
+
     for (;;)
     {
         // Make sure interrupts are always on

make -f Makefile.linux
avrdude -p atmega3290 -c avrisp2 -P /dev/ttyS0 -v -F -e -U flash:w:raven-3290.hex
/**                                                                             
    @brief This displays a time out message to the user based on the paramter   
    reason x.                                                                   

    @param x Reason for USART time out.                                         
*/
void timeout_msg(uint8_t x)
{
    char str[20] = "TO     ";

    dectoascii(x, str+3);
    lcd_puts(str);
}
    // Check for SOF                                                            
    ch = get_char_rx();
    if (ch != SOF_CHAR)
        return timeout_msg(1);

    // turn on nose LED for activity indicator                                  
    led_on();
--- raven3290.c.orig    2008-07-07 23:21:19.000000000 +1200
+++ raven3290.c 2008-07-08 00:50:51.000000000 +1200
@@ -133,7 +133,11 @@
 const tmenu_item menu_items[21];
 #else  // !DOXYGEN
 /** @brief This is the menu text in Flash. See menu_items[] for menu operation. */
+#if 1
+const char menu_text0[] PROGMEM =  "DONKEY8";
+#else
 const char menu_text0[] PROGMEM =  "RES 1.0";
+#endif
 const char menu_text1[] PROGMEM =  "SETUP";
 const char menu_text2[] PROGMEM =  "CHANNEL";
 const char menu_text3[] PROGMEM =  "POWER";
@@ -222,7 +226,9 @@

     key_init();

+#if 0
     uart_init();
+#endif 

     sei();

@@ -233,6 +239,13 @@
     // and draw it
     lcd_puts_P(menu.text);

+    lcd_puts_P(PSTR("W00T BOOP DOOP"));
+
+#if 1
+#include "beep.h"
+    beep();
+#endif
+
     for (;;)
     {
         // Make sure interrupts are always on

avrdude -p atmega3290p -c usbtiny -v -U flash:w:"raven-3290.hex"
code@rancidbacon.com