1

I'm using a modified version of Arduino Zero Bootloader. I am trying to write software to automatically detect which USB device the bootloader is currently running on in order to execute bossac.

I have noticed a few unique characteristics when using "lsusb -v". Things like "bDeviceClass" is always 2. and "bDeviceSubClass" is always 0; However, I do not feel confident in using these traits to identify the bootloader. Is there any clear indication of bootloader so I can find the correct ttyACM#?

1
  • Have you tried ls -l /dev/serial/by-id? On my Ubuntu, it shows aliases with rather indicative names (ProductID in particular) and the alias points to the right ttyACM#. Commented Aug 9, 2016 at 21:03

1 Answer 1

1

The only things you have at your disposal are what is in lsusb -v. Using those you can craft a udev rule to create a symlink to a unique device name. I do that with all my boards so that they all get a unique name.

Here is one of my rules:

ATTRS{idVendor}=="2341", ATTRS{idProduct}=="0042",  
  ATTRS{serial}=="95336333635351F091B1", KERNEL=="ttyACM*", 
  MODE="0660", GROUP="plugdev", SYMLINK+="board/arduino/mega2560"

That links /dev/board/arduino/mega2560 to whatever /dev/ttyACM* node got created when it was plugged in. That is in /etc/udev/rules.d/50-boards.rules

More on udev here: http://playground.arduino.cc/Linux/Udev

A useful command is udevadm info -a -n /dev/ttyACM0 which lists all the attributes for that device which you can then use in the udev rule.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.