Using the ZeptoProg II on OS X

I’ve decided that I should be using xmega AVR microcontrollers rather than the older series — the timer architecture is much nicer for one thing. The only downside is that they are 3.3V only — and have a different programming interface.

I bought the ZeptoProg II and a simple header board from Justin Mattair at mattairtech.com.

The programmer isn’t explicitly supported on OS X, but in fact it works fine once you set it up correctly.

I use avrdude for programming AVRs, and when I first ran it with the ZeptoProg II I got:

Blonder:avrtest tomd$ avrdude -c avrisp2 -p x128a4 -P usb:000200012345 -U flash:r:flash.hex:h -v -v -v -v

avrdude: Version 5.11.1, compiled on Feb 16 2012 at 22:11:20
    Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
    Copyright (c) 2007-2009 Joerg Wunsch

    System wide configuration file is "/usr/local/CrossPack-AVR-20120217/etc/avrdude.conf"
    User configuration file is "/Users/tomd/.avrduderc"

    Using Port                    : usb:000200012345
    Using Programmer              : avrisp2
avrdude: usbdev_open(): Found AVRISP mkII, serno: 000200012345
avrdude: usbdev_open(): using read endpoint 0x82
avrdude: Sent: . [01] 
avrdude: usbdev_recv_frame(): usb_bulk_read(): usb_bulk_read: An error occured during read (see messages above)
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: usbdev_send(): wrote -104 out of 1 bytes, err = usb_bulk_write: An error occured during write (see messages above)
avrdude: stk500_send_mk2(): failed to send command to serial port

I contacted Justin, who explained that this meant that the ZeptoProg was in AVR Studio mode, not avrdude mode. There’s a Java application which allows you to change this (it also allows you to use the ZeptoProg as a logic analyzer and signal generator).

There was one gotcha — the jar containing this application bundles the librxtxSerial.jnilib library which it needs to talk to the USB port, but only a 32 bit version. Java on my OS X version is 64 bit only, so I got messages like:

Blonder:xmega tomd$ java -jar ~/Downloads/ZeptoProg_II.jar 
java.lang.UnsatisfiedLinkError: /private/var/folders/tv/58qc8nq53x50q8f7r31z_6280000gn/T/natives3881310/librxtxSerial.jnilib: dlopen(/private/var/folders/tv/58qc8nq53x50q8f7r31z_6280000gn/T/natives3881310/librxtxSerial.jnilib, 1): no suitable image found.  Did find:
/private/var/folders/tv/58qc8nq53x50q8f7r31z_6280000gn/T/natives3881310/librxtxSerial.jnilib: no matching architecture in universal wrapper thrown while loading gnu.io.RXTXCommDriver
Exception in thread "main" java.lang.UnsatisfiedLinkError: /private/var/folders/tv/58qc8nq53x50q8f7r31z_6280000gn/T/natives3881310/librxtxSerial.jnilib: dlopen(/private/var/folders/tv/58qc8nq53x50q8f7r31z_6280000gn/T/natives3881310/librxtxSerial.jnilib, 1): no suitable image found.  Did find:
/private/var/folders/tv/58qc8nq53x50q8f7r31z_6280000gn/T/natives3881310/librxtxSerial.jnilib: no matching architecture in universal wrapper
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1939)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1868)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1854)
at java.lang.Runtime.loadLibrary0(Runtime.java:845)
at java.lang.System.loadLibrary(System.java:1084)
at gnu.io.CommPortIdentifier.<clinit>(CommPortIdentifier.java:83)
at GUITerminal.getAvailableSerialPortNames(GUITerminal.java:234)
at GUITerminal.<init>(GUITerminal.java:134)
at ZeptoProgGUI.<init>(ZeptoProgGUI.java:56)
at ZeptoProg_II.main(ZeptoProg_II.java:25)

The strange /private/var/folders/tv/58qc8nq53x50q8f7r31z_6280000gn/T... path in the message above is where the jnilib from the jar is unpacked.

To fix this I needed to:

  • download this file http://code.google.com/p/create-lab-commons/source/browse/trunk/java/lib/rxtx/librxtxSerial64.jnilib (this contains 64 bit and 32 bit architectures)
  • rename it to librxtxSerial.jnilib (possible not necessary)
  • replace the file in the jar: jar uf ZeptoProg_II.jar librxtxSerial.jnilib
  • then it runs fine with java -jar ZeptoProg_II.jar
  • Put the board into multitool mode, then a file /dev/tty.usbmodem513281 will appear (not sure if the number is always the same) and you can refresh the COM port list, select it and connect. When the board is not in tool mode that device is not present in /dev.

Once set up like that the ZeptoProg works with avrdude.

One Comment

  1. Posted June 2, 2014 at 12:59 pm | Permalink

    Hi there, You’ve done an incredible job. I will definitely digg it and personally recommend to my friends. I am sure they will be benefited from this website.

Post a Comment

Your email is never shared. Required fields are marked *

*
*