| Version 1 (modified by , 11 years ago) ( diff ) |
|---|
Here I try to collect some information about flashing new firmware onto the FSC board. While the FSC has been built to be Arduino-compatible, we never really managed to install the well known Arduino bootloader onto the FSC. So the firmware can't be installed via USB, but needs to be programmed via the ISP port using an external ISP programmer like the one shown in the picture below. This is an original "AVR ISP mkII", but others should work as well.
The AVR ISP mkII on Ubuntu
Check if the USB connection works. Leave the programmer unplugged from the board to be programmed, but connect it to your PC via USB. You should see it, when typing lsusb in a terminal, e.g. like this:
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 006 Device 007: ID 03eb:2104 Atmel Corp. AVR ISP mkII <--- this is it. Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
In order to speak to the programmer, the program called avrdude is needed. It can be simply installed by
sudo apt-get install avrdude
We can check, if avrdude can talk to the programmer, even before the programmer is connected to the board, by typing:
avrdude -p m328 -c avrispmkII -P usb -v
Here the -p parameter, specifies the type of the microcontroller (MCU) we want to program, since we actually don't want to program any MCU right now, but just check, if we can talk to the programmer, this parameter doesn't matter. However this parameter is not optional. The -c parameter specifies the type of programmer, we want to use and -P specifies the port, we connnected the programmer to. (Luckily specifying 'usb' is enough and we don't have to specify the bus and device number).
The ouput might look like this: {{{dneise@NeiseLenovo:~$ avrdude -p m328 -c avrispmkII -P usb -v
avrdude: Version 6.0.1, compiled on Oct 21 2013 at 15:55:32
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/ Copyright (c) 2007-2009 Joerg Wunsch
System wide configuration file is "/etc/avrdude.conf" User configuration file is "/home/dneise/.avrduderc" User configuration file does not exist or is not a regular file, skipping
Using Port : usb Using Programmer : avrispmkII
avrdude: usb_open(): cannot read serial number "error sending control message: Operation not permitted" avrdude: usb_open(): cannot read product name "error sending control message: Operation not permitted" avrdude: usbdev_open(): Found [unnamed product], serno: [unknown] avrdude: usbdev_open(): error setting configuration 1: could not set config 1: Operation not permitted avrdude: usbdev_open(): did not find any USB device "usb" }}}
The problem here is, that your user does not have access rights for this USB device. We solve this quickly by putting sudo in front of the command. Also we add the -v option in order to get more information
dneise@NeiseLenovo:~$ sudo avrdude -p m328 -c avrispmkII -P usb -v
avrdude: Version 6.0.1, compiled on Oct 21 2013 at 15:55:32
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch
System wide configuration file is "/etc/avrdude.conf"
User configuration file is "/home/dneise/.avrduderc"
User configuration file does not exist or is not a regular file, skipping
Using Port : usb
Using Programmer : avrispmkII
avrdude: usbdev_open(): Found AVRISP mkII, serno: 000200059292
AVR Part : ATmega328
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PC2
RESET disposition : dedicated
RETRY pulse : SCK
serial program mode : yes
parallel program mode : yes
Timeout : 200
StabDelay : 100
CmdexeDelay : 25
SyncLoops : 32
ByteDelay : 0
PollIndex : 3
PollValue : 0x53
Memory Detail :
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
eeprom 65 20 4 0 no 1024 4 0 3600 3600 0xff 0xff
flash 65 6 128 0 yes 32768 128 256 4500 4500 0xff 0xff
lfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
efuse 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
lock 0 0 0 0 no 1 0 0 4500 4500 0x00 0x00
calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
Programmer Type : STK500V2
Description : Atmel AVR ISP mkII
Programmer Model: AVRISP mkII
Hardware Version: 1
Firmware Version Master : 1.13
Vtarget : 0.0 V
SCK period : 0.50 us
avrdude: stk500v2_command(): command failed
avrdude: stk500v2_program_enable(): bad AVRISPmkII connection status: Target not detected
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.
avrdude done. Thank you.
As we see, the guy called avrdude, is pretty polite.
