AVReAl/Linux and root privileges

Originally AVReAl/Linux worked with LPT directly, by processor in/out instructions. This method requires root privileges. Later /dev/parport support was added. It is enough to add a user in lp group for this access method. Both ways are described in AVReAl and LPT in Linux post.

Then FTDI MPSSE support was added. I noticed that without administrator rights the program can’t connect to FT2232 chip. But all AVReAl versions on my PC run with root priveleges because it is required for LPT direct acces testing. So, the program works fine with FTDI chips and I had no need to dig deeper.

Finally I decided to investigate the matter. As often happens, to do right you just stop and spend a little time to read and think.

To work with FTDI-based programmers without root priveleges add a file named, for example 55-ftdi.rules to directory /etc/udev/rules.d/. The file must have the following content:

# FTDI-based devices
# FTDI vid=0403
# FT2232, FT2232H: pid=6010
# FT4232H:  pid=6011
# FT232H:   pid=6014
SUBSYSTEM=="usb", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010|6011|6014", OWNER="root", GROUP="root", MODE="0666"

You need not reboot. It is enough to reconnet the programming adapter.

The rules use default vid/pid for FTDI chips. If you use an adapter with different vid/pid, add appropriate line into the file.

OpenOCD contains a file with rules for all adapters supported by this program. If FTDI-based adapter listed in the file is used with AVReAl, you can simply copy the file into /etc/udev/rules.d/ directory. OpenOCD rules use GROUP="plugdev", MODE="0664". As for me it is no difference between this two variants for desktop PC because all users are already included in plugdev group.

Of course, you must have administrator rights to create the file. After that you will be able to work with AVReAl without root privileges.

Attached Files:

AVReAl update — 1.28r6

avreal v1.28r6 (Sun 2011-01-09) has been released.

  • ATmega325A and ATmega329A are added.
  • Aliases for “A”-versions are added:
        ATmega165A, ATmega645A, ATmega6450A
        ATmega169A, ATmega329PA, ATmega649A, ATmega6490A
  • avreal/Linux64, FT2232* and FT4232H-based adapters:
    Library named libftd2xx.so.0 instead of previously used libftd2xx.so is loaded for FTDI chips support.
    This allows installation both old (required for avreal) and new library versions, for example libftd2xx.so.0.4.16 and libftd2xx.so.1.0.0.
    Read more about libftd2xx.so.1.0.0 problems in 64-bit Linux.
  • -k/-K switch now has two forms with different avreal stages execution order.

The FTDI’s gift

The FTDI’s gift is very interesting.

Keeping the “See Figure 1.” motto in their minds, they have changed data types when switching over from library libftd2xx.so versions 0.4.x to libftd2xx.so.1.0.0. The gift affects on 64-bit libraries only. There is no problem for 32-bit ones.

ftd2xx library was born in Windows and contains WinAPI-like UART support functions FT_W32_ххх(). That’s why WinAPI standard types DWORD, BYTE and so on are used in the library. For Linux version of the library they have added WinTypes.h header file with typedefs for these types. In general, it seems to be a logical step, but…

Continue reading ‘The FTDI’s gift’ »

avreal/linux and libftd2xx.so.1.0.0 64-bit

At the beginning of december FTDI gave us a small gift — a new version 1.0.0 of libftd2xx.so library. But avreal/Linux 64 bit doesn’t work with the library. I will check avreal code later. I have placed previous version 0.4.16 of libftd2xx.so with which avreal works properly, on the download page.

Read more in another post: “The FTDI’s gift”

bug in avreal 1.28r2 and 1.28r3

A strange bug was found in avreal 1.28r2 and 1.28r3. At the coincidence of conditions

  • An FT2232/FT4232-based adapter is used
  • There are some data for top two flash bytes — either data from hex-file or erase counter
  • flash and fuses are used in one avreal call
  • -v verification switch is used

for some microcontroller types avreal fails with “synchronosation lost” error after the first verification.

Continue reading ‘bug in avreal 1.28r2 and 1.28r3’ »

AVReAl update – 1.28r1

avreal v1.28r1 (Sun 2010-01-31) has been released.

  • FT2232H, FT4232H support is added. Both channels with MPSSE are allowed for programming. Allowable pin names are listed in configuration description.
  • Switch -k is added for waiting an adapter’s key being pressed before starting the programming. See key record description.
  • Switch modifier -os is added for selecting SCK frequency instead of MCU clocking frequency.
[flagcounter image]