A place to put my things.

diciembre 5, 2011

x0xb0x firmware load Linux/Debian

Archivado en: Sin categoría — Etiquetas: , , , — Ruben @ 12:56

A fix must be done to make the x0xb0x firmware update with Debian Wheezee

Basicaly it consist in changing the serial communication imported modules path in the code from “javax.comm” to “gnu.io”.

$ java -jar JAvrProg.jar
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: javax/comm/CommPortIdentifier

1. Prepare the system :

$ sudo apt-get install librxtx-java sun-java6-jdk

(not but should work tested with openjdk)

Check where is RXTXcomm.jar and place it where sun-java can find it:

dpkg -L librxtx-java | grep jar
/usr/share/java/RXTXcomm-2.2pre2.jar
/usr/share/java/RXTXcomm.jar

$sudo ln -s /usr/share/java/RXTXcomm.jar /usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/ext/comm.jar

2. Download the JAvrProg bootloader from http://sourceforge.net/projects/javrprog/

3. Change code and compile:

Uncompress .zip file:

$ unzip JAvrProg_alpha2.zip
$ cd JAvrProg
$ sed -i s/javax.comm/gnu.io/g *.java
$ javac *.java
$ jar cmf Manifest.txt JAvrProg.jar *.class

4. Fix LD_LIBRARY_PATH:

export LD_LIBRARY_PATH=/usr/lib/jni

5. Run the program:

$java -jar JAvrProg.jar

Now it is listening on /dev/ttyS0 serial device (nothing conected yet)

ruben@idea:~/gear/JAvrProg$ java -jar JAvrProg.jar
trying to open port /dev/ttyS0 at 19200bps
Failed to find AVR board

6. Now the upgrade/downgrade operation:

First:
$ sudo modprobe usbserial
As we are using a serial device throught a USB port.
For me I had to link /dev/ttyS0 to /dev/USB0 (the one the program searchs for)

Finaly i had some identification triying to write with an empty file:
Found x0xb0x1
supported: ATmega162

So I know i have to use “ATmega162″ mode.

If you try to write an .hex file it fails, so you have to close the program, run it again, load the .hex file, select ATmega162 mode…et voilá.

I hade to downgrade because I was experiecing timing errros using th x0xb0x as MIDI slave. Now after loading the original firmware,timing is perfect!

Of course none of the advanced funcions are working but when using an external sequencer it is not needed, and you can always go back to the latest firmware.

Advertisement

3 comentarios »

  1. Hi, I replaced the javax.comm import with gnu.io in the code, but my compiler complains that the package gnu.io cannot be found. I’ve tried both the OpenJDK and Sun JREs but it won’t work with either. I have RXTX installed also. I tried it on both my Debian Squeeze laptop and Fedora 16 desktop but it gives the same error… Do I need any additional Java libraries that aren’t mentioned here or something? Could you post the contents of your jre/lib/ext directory in case you don’t know what’s wrong?
    Thank you very much for your attention.

    Comentario por Chema — enero 23, 2012 @ 22:06

    • Hi Chema, something missing in my post:

      1. find where librxtx-java puts RXTXcomm.jar:

      ruben@idea:~/gear/JAvrProg$ dpkg -L librxtx-java | grep jar
      /usr/share/java/RXTXcomm-2.2pre2.jar
      /usr/share/java/RXTXcomm.jar

      2. link/copy RXTXcomm.jar to where javac can find it with name “comm.jar” :

      sudo ln -s /usr/share/java/RXTXcomm.jar /usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/ext/comm.jar

      It should work now.

      $ ls -l /usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/ext/
      total 1252
      lrwxrwxrwx 1 root root 28 ene 24 09:44 comm.jar -> /usr/share/java/RXTXcomm.jar
      -rw-r–r– 1 root root 8239 may 4 2011 dnsns.jar
      -rw-r–r– 1 root root 843998 jun 9 2011 localedata.jar
      -rw-r–r– 1 root root 429 may 4 2011 meta-index
      -rw-r–r– 1 root root 170239 may 4 2011 sunjce_provider.jar
      -rw-r–r– 1 root root 231939 may 4 2011 sunpkcs11.jar

      Hope it helps.

      Saludos! :)

      Comentario por Ruben — enero 24, 2012 @ 10:53

  2. Ah, yes, it works now, I was finally able to upgrade my firmware (I wanted to replace the stock firmware with SokkOS). The documentation at the official site is really out of date.

    Muchísimas gracias por tu ayuda :D .

    Comentario por Chema — enero 24, 2012 @ 18:56


RSS feed para los comentarios de esta entrada. URI para TrackBack.

Deja un comentario

Fill in your details below or click an icon to log in:

Logo de WordPress.com

You are commenting using your WordPress.com account. Log Out / Cambiar )

Twitter picture

You are commenting using your Twitter account. Log Out / Cambiar )

Facebook photo

You are commenting using your Facebook account. Log Out / Cambiar )

Connecting to %s

Tema Shocking Blue Green. Blog de WordPress.com.

Seguir

Get every new post delivered to your Inbox.