These are the ramblings of Matthijs Kooijman, concerning the software he hacks on, hobbies he has and occasionally his personal life.
Most content on this site is licensed under the WTFPL, version 2 (details).
Questions? Praise? Blame? Feel free to contact me.
My old blog (pre-2006) is also still available.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
(...), Arduino, AVR, BaRef, Blosxom, Book, Busy, C++, Charity, Debian, Electronics, Examination, Firefox, Flash, Framework, FreeBSD, Gnome, Hardware, Inter-Actief, IRC, JTAG, LARP, Layout, Linux, Madness, Mail, Math, MS-1013, Mutt, Nerd, Notebook, Optimization, Personal, Plugins, Protocol, QEMU, Random, Rant, Repair, S270, Sailing, Samba, Sanquin, Script, Sleep, Software, SSH, Study, Supermicro, Symbols, Tika, Travel, Trivia, USB, Windows, Work, X201, Xanthe, XBee
Last week, I got a fancy new JTAGICE3 programmer / debugger. I wanted to achieve two things in my Pinoccio work: Faster uploading of programs (Having 256k of flash space is nice, but flashing so much code through a 115200 baud serial connection is slow...) and doing in-circuit debugging (stepping through code and dumping variables should turn out easier than adding serial prints and re-uploading every time).
In any case, the JTAGICE3 device is well-supported by avrdude
, the
opensource uploader for AVR boards. However, unlike devices like the
STK500 development board, the AVR dragon programmer/debugger and the
Arduino bootloader, which use an (emulated) serial port to communicate,
the JTAGICE3 uses a native USB protocol. The upside is that the data
transfer rate is higher, but the downside is that the kernel doesn't
know how to talk to the device, so it doesn't expose something like
/dev/ttyUSB0
as for the other devices.
avrdude
solves this by using libusb, which can talk to USB devices
directly, through files in /dev/usb/
. However, by default these device
files are writable only by root, since the kernel has no idea what kind
of devices they are and whom to give permissions.
To solve this, we'll have to configure the udev
daemon to create the
files in /dev/usb
with the right permissions. I created a file called
/etc/udev/rules.d/99-local-jtagice3.rules
, containg just this line:
SUBSYSTEM=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2110", GROUP="dialout"
This matches the JTAGICE3 specifically using it's USB vidpid (03eb:2110,
use lsusb
to find the id of a given device) and changes the group for
the device file to dialout
(which is also used for serial devices on
Debian Linux), but you might want to use another group (don't forget to
add your own user to that group and log in again, in any case).
Comments are closed for this story.