wiki:GettingStarted

Getting started with INGA

To enable a quick start, we'll provide a short introduction. First of all we assume an installed Bootloader for this - if the Bootloader is not yet installed refer to the Programming section.

Also, INGA has to be in the bootloader in order to receive flash images. Getting INGA into the bootloader is as simple as this:

  1. Press and hold the button
  2. Switch INGA off
  3. Switch INGA back on
  4. The green LED should be constantly lit while the red LED should be off

Now you can program flash images onto INGA using different operating systems as detailed in the following sections.

Flashing INGA using Linux

Using Linux is the most convenient way of working with INGA because all features of INGA are currently supported. Namely, INGA can automatically be reset before programming a flash image, so that the aforementioned procedure can be omitted. However, the automatic reset feature has a number of dependencies, which is why it may not be applicable in all scenarios. Please decide for yourself and use either the automatic or the manual reset way of programming INGA.

Prepare auto reset flashing

In order for INGA to be automatically reset before programming a flash image, we will need a program called inga_tool. It will not only allow you to reset INGA but is also integrated into the existing make system of INGA and does not have to be called manually. After successfully compiling the tool, we will update the EEPROM of INGA to reflect a certain combination of USB Vendor and Product ID string. This allows to deterministically distinguish INGA from other FTDI USB devices. Finally, we will install a so-called udev rule. This rule will allow ordinary users to reset INGA. Many Linux distributions have preserved this feature for the root user.

Compiling inga_tool

You will need the following libraries on your Linux system:

  • Libusb 0.1
  • Libftdi >= 0.19
  • Libpopt
  • Libudev

On a recent Debian or Ubuntu version, you can install the packets using this command:

$ sudo apt-get install libusb-0.1-4 libusb-dev libftdi1 libftdi-dev libpopt0 libpopt-dev libudev1 libudev-dev

Now, you can go on and compile the inga_tool’’.

$ cd tools/inga/inga_tool
$ make

If you have problems building the inga_tool, please check if all the above-mentioned dependencies are met and if libftdi has at least version 0.19.

Updating INGAs EEPROM

Updating INGAs EEPROM to carry the correct USB Vendor and Product ID string is straightforward once inga_tool has been successfully compiled. First of all, figure out the device name of your INGA. Typically this will be /dev/ttyUSBx, whereas x is between 0 and 9.

Now, tell inga_tool to update your EEPROM.

$ sudo ./inga_tool --device=/dev/ttyUSBx –f

The output should look similar to this:

$ sudo ./inga_tool --device=/dev/ttyUSB0 -f
Reading out EEPROM image...done
Writing updated EEPROM image...done

Now your EEPROM is updated and ready for use.

Getting the permissions straight

In order for inga_tool to be able to reset your node, your user ID will have to have write access to the corresponding USB device located in /dev/bus/usb. In many Linux distributions, these files are only writable for root. To gain write access even as regular user, a custom udev rule will change the group of INGAs USB device file every time you connect your INGA. Installing the udev rule is as simple as this:

Create a new file /etc/udev/rules.d/30-inga-usb.rules with the following content:

SUBSYSTEM=="usb", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ATTR{product}=="INGA", GROUP="plugdev", OPTIONS+="last_rule"

Now unplug your INGA and plug it back in. Test if you have the correct permissions by resetting INGA using inga_tool:

$ ./inga_tool --device=/dev/ttyUSB0 -r
Resetting INGA node...done

If you are still not allowed to reset INGA, please check, if your user is member of the group "plugdev". You can easily do that using the "groups" command like so:

$ groups
adm dialout cdrom plugdev lpadmin admin sambashare

If this list does not contain plugdev, please either add your user to this group or change the group specified in /etc/udev/rules.d/30-inga-usb.rules to a group your user is in.

Dependencies

To flash INGA under Linux, you will need the following tools:

  • avrdude
  • gcc-avr
  • avr-libc
  • binutils-avr

On a recent Debian or Ubuntu version, you can install the packets using this command:

$ sudo apt-get install avrdude gcc-avr avr-libc binutils-avr

Flash process

Flashing INGA now is very simple:

$ cd examples/hello-world/
$ make TARGET=inga savetarget
$ make hello-world.upload
$ make login

If you rely on INGAs manual reset, please make sure, that you get INGA into the bootloader before issuing the commands stated #GettingstartedwithINGA above.

Flashing INGA using Mac OS X

Using INGA under Mac OS X is almost as convenient as under Linux. However, due to unresolved problems, INGA cannot be automatically reset before programming. Please make sure that you get INGA into the bootloader before attempting to program a flash image as explained #GettingstartedwithINGA above.

Dependencies

To flash INGA under Mac OS X, you will need the following tools:

After installing these tools, you will have to close and reopen your terminal session to honour the new PATH variable that was set.

Flash process

In principle, flashing INGA using Mac OS X is similar to the process on Linux. First get INGA into the bootloader as stated #GettingstartedwithINGA above.

Then, the process works as under Linux:

$ cd examples/hello-world/
$ make TARGET=inga savetarget
$ make hello-world.upload
$ make login

At the moment, automatic reset of the nodes does not work and is still being worked upon. Please be patient.

Last modified 6 years ago Last modified on 04.11.2013 18:40:23