Skip to content

Microcontroller

udev rules to allow access to mySmartUSB as user

Use the following in rule in the new file /etc/udev/rules.d/0-usb-mysmartusb-permissions.rules:

KERNEL=="ttyUSB*", SUBSYSTEMS=="usb", ATTRS{idVendor}=="10c4", ATTRS{idProduct}=="ea60", MODE="0660"

This will make avrdude and PlatformIO in Visual Studio Code working.

Using avrdude in Linux

Default options

In ~/.avrduderc you can set the default port and programmer type as following for a STK500 compatible device connected via USB, like the mySmartUSB light:

default_serial = "/dev/ttyUSB0";
default_programmer = "stk500";

Example: read data

Read flash memory of an Atmega 328P connected with a mySmartUSB light in STK500 mode:

avrdude -P /dev/ttyUSB0 -c stk500 -p m328p -n -U flash:r:<FILENAME>

The options:

  • -P /dev/ttyUSB0 - the port for the programmer
  • -c stk500 - the type of programmer
  • -p m328p - the type of microcontroller
  • -n - do not write any data
  • -U flash:r:<FILENAME> - read flash memory and store it to

Note that you can omit -P and -c if you have configured default options. Then you only need to define the type of microcontroller:

avrdude -p m328p -n -U flash:r:<FILENAME>