You are not logged in.

#1 2019-04-11 02:15:14

chra
Member
Registered: 2019-01-04
Posts: 46

AVR microcontroller name won't show up in lsusb

At university I am trying to load a program onto an ATmega324a microcontroller through the command below:

sudo avrdude -c usbasp -p m324a -U flash:w:ssd -C ~/avrdude.conf

Unfortunately, I get this error:

avrdude: error: could not find USB device with vid=0x16c0 pid=0x5dc vendor='www.fischl.de' product='USBasp'

It seems this might be linked to the fact that the AVR microcontroller is not 'named' after typing lsusb (it's the one with no name):

Bus 002 Device 002: ID 0bda:0328 Realtek Semiconductor Corp. 
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 006: ID 06cb:009a Synaptics, Inc. 
Bus 001 Device 005: ID 13d3:56b2 IMC Networks 
Bus 001 Device 004: ID 8087:0a2b Intel Corp. 
Bus 001 Device 008: ID 1ffb:00b0  
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Are there steps I can take to resolve this issue?

Offline

#2 2019-04-11 03:33:36

mpan
Member
Registered: 2012-08-01
Posts: 1,669
Website

Re: AVR microcontroller name won't show up in lsusb

I don’t have USBasp myself and I doubt you will easily find someone, who has it (it seems like a niche product). So debugging the issue will not be easy and perhaps will only point you in the right direction. There are already two things that are strange: so I guess we need a sanity check first.

You are stating, that you can’t see the name of the AVR microcontroller, but you are using ATmega324. ATMega324 has no USB support at all. Note that this has nothing to do with USB support of the programmer — but I just read what is written and may indicate a misunderstanding of some kind.

The other thing: are you actually using the genuine USBasp? Because the device ID in lsusb indicates a different programmer: 0x1FFB is vendor ID of Pololu, and the product ID fits the one they mention for their “AVR Programmer v2”.

Last edited by mpan (2019-04-11 03:38:37)

Offline

#3 2019-04-11 06:03:33

chra
Member
Registered: 2019-01-04
Posts: 46

Re: AVR microcontroller name won't show up in lsusb

mpan wrote:

I don’t have USBasp myself and I doubt you will easily find someone, who has it (it seems like a niche product). So debugging the issue will not be easy and perhaps will only point you in the right direction. There are already two things that are strange: so I guess we need a sanity check first.

You are stating, that you can’t see the name of the AVR microcontroller, but you are using ATmega324. ATMega324 has no USB support at all. Note that this has nothing to do with USB support of the programmer — but I just read what is written and may indicate a misunderstanding of some kind.

The other thing: are you actually using the genuine USBasp? Because the device ID in lsusb indicates a different programmer: 0x1FFB is vendor ID of Pololu, and the product ID fits the one they mention for their “AVR Programmer v2”.

It's connected to a micro usb port on the microcontroller which is then connected to my laptop via normal usb. So I guess there is USB? Anyway, I think you have discovered my issue. I was unaware of which programmer to use but most AVR guides were using usbasp so I guess I just thought that was the right one. I have seen Pololu somewhere with respect to the microcontroller so I guess that is the programmer.

So I don't run into this problem again when I have access to the device next week, may I ask how I discover which programmer name to write in the avrdude command? After searching for "avrdude Pololu" everyone seems to be using "avrispv2" for the -c (programmer argument). Is there somewhere I can determine which one is the correct one to use? It seems "avrispv2" corresponds to "Atmel AVR ISP V2" but I haven't found much more information on this stuff anywhere. Even after looking in the datasheet.



EDIT: I think I have discovered what the programmer is now. That is how the ATMega324a is connecting to the computer via USB.

Last edited by chra (2019-04-11 06:05:43)

Offline

#4 2019-04-11 09:59:34

mpan
Member
Registered: 2012-08-01
Posts: 1,669
Website

Re: AVR microcontroller name won't show up in lsusb

If that programmer is indeed “Pololu USB AVR Programmer v2” then, according to their shop, the device emulates STK500. They also provide a guide, which uses “stk500v2” as the programmer ID. So this seems to be the best thing to test first.

chra wrote:

EDIT: I think I have discovered what the programmer is now. That is how the ATMega324a is connecting to the computer via USB.

OK. Do you know, how this works? There is nothing wrong with not knowing things — JUST ASK and people will explain smile. The problems start when one pretends to know — it brings confusion, miscommunication and irritation.

The programmer is a device that programs a microcontroller. More specifically: it writes data to the microcontroller’s memory. In this particular case it receives program from the computer (via USB) and transfers it to the microcontroller:

 ,----------------.         ,-------------.
 |  ,---------.   |-- - - --|             |
 |  | avrdude |-----> USB  --> Programmer |
 |  `---------'   |-- - - --|             |
 |       ^        |         `-------------'
 |       |        |             |
 |  ,.----------. |       ,-----|------------.
 | /_| compiled | |       | ,---V----------. |
 | |     code   | |       | | Memory       | |
 | `------------' |       | `--------------' |
 |   Computer     |       |  Microcontroller |
 `----------------'       `------------------'

This is a bit of oversimplification: industrial programmers may be completely autonomous and store the program to write,  programmers may be capable of both writing and reading, they may access things other than program memory (e.g. in AVR8: fuses, EEPROM) etc.

Offline

#5 2019-04-13 01:42:34

chra
Member
Registered: 2019-01-04
Posts: 46

Re: AVR microcontroller name won't show up in lsusb

mpan wrote:

If that programmer is indeed “Pololu USB AVR Programmer v2” then, according to their shop, the device emulates STK500. They also provide a guide, which uses “stk500v2” as the programmer ID. So this seems to be the best thing to test first.

chra wrote:

EDIT: I think I have discovered what the programmer is now. That is how the ATMega324a is connecting to the computer via USB.

OK. Do you know, how this works? There is nothing wrong with not knowing things — JUST ASK and people will explain smile. The problems start when one pretends to know — it brings confusion, miscommunication and irritation.

The programmer is a device that programs a microcontroller. More specifically: it writes data to the microcontroller’s memory. In this particular case it receives program from the computer (via USB) and transfers it to the microcontroller:

 ,----------------.         ,-------------.
 |  ,---------.   |-- - - --|             |
 |  | avrdude |-----> USB  --> Programmer |
 |  `---------'   |-- - - --|             |
 |       ^        |         `-------------'
 |       |        |             |
 |  ,.----------. |       ,-----|------------.
 | /_| compiled | |       | ,---V----------. |
 | |     code   | |       | | Memory       | |
 | `------------' |       | `--------------' |
 |   Computer     |       |  Microcontroller |
 `----------------'       `------------------'

This is a bit of oversimplification: industrial programmers may be completely autonomous and store the program to write,  programmers may be capable of both writing and reading, they may access things other than program memory (e.g. in AVR8: fuses, EEPROM) etc.

I didn't exactly know what a programmer did. Sorry, I probably should have been more clear. After seeing an image of a programmer during my searches I figured it did something like that. Thanks for the explanation. Unfortunately, they skip over those parts at university.

I'll test this out on Monday and see if it works.

Offline

#6 2019-05-01 15:42:09

YGator
Member
Registered: 2013-08-09
Posts: 10

Re: AVR microcontroller name won't show up in lsusb

Beware, that usb support has not been compiled into version avrdude-1:6.3-5 and you must downgrade to avrdude-1:6.3-4.

I hope they put it back in.

Offline

#7 2019-05-01 17:53:16

dviktor
Member
From: Moscow
Registered: 2015-10-18
Posts: 162

Re: AVR microcontroller name won't show up in lsusb

Seems like your USBasp isn't detected at all. Could you please show dmesg output right after plugging in usbasp programmer?

Offline

Board footer

Powered by FluxBB