Welcome! Log In Create A New Profile

Advanced

Feel my pain, usbasp not found

Posted by AriesPrinters 
Feel my pain, usbasp not found
June 19, 2014 09:41AM
Spending 7 hours unsuccsefully trying to load a bootloader is something nobody should go through... alas, I have. I'm just praying someone is able to find my mistake. I tried these steps on an Inspiron M501R(duel boot both linux mint 17 and Windows 7) and an older Inspiron with Windows 7. Here is what I did (among maaaany other things):
1)Ordered a usbasp
2)Made a custom cable, 10 pin to 6 pin
3)connected it to my Gen 7 1.5 board with an Atmega1284-PU and 20Mhz crystal
4)downloaded Arduino 1.0.5r2, gen 7 IDE support package and Sprinter firmware from Kliment
a)For Windows 7- downloaded the drivers from an external site and continued as steps explained
5)Checked the fuses
6)connected usbasp to laptop and powered on board with external psu
7)In Arduino I selected my board and programmer and selected 'Burn Bootloader'
8)Recieved on linux:

avrdude: Warning: cannot query manufacturer for device: error sending control message: Operation not permitted
avrdude: error: could not find USB device "USBasp" with vid=0x16c0 pid=0x5dc

and on windows only the second line...

I'm relatively new to linux, but it appears the permissions are wrong, but that doesn't solve the second line... which is where the problem lies. Any ideas?

Here is some additional information:
a)In boards.txt

Gen7-1284P-20.name=Gen7 with ATmega1284P and 20 MHz
Gen7-1284P-20.upload.protocol=stk500v2
Gen7-1284P-20.upload.maximum_size=129024
Gen7-1284P-20.upload.speed=115200
Gen7-1284P-20.bootloader.low_fuses=0xF7
Gen7-1284P-20.bootloader.high_fuses=0xDC
Gen7-1284P-20.bootloader.extended_fuses=0xFC
Gen7-1284P-20.bootloader.path=Gen7
Gen7-1284P-20.bootloader.file=bootloader-1284P-20MHz.hex
Gen7-1284P-20.bootloader.unlock_bits=0x3F
Gen7-1284P-20.bootloader.lock_bits=0x0F
Gen7-1284P-20.build.mcu=atmega1284p
Gen7-1284P-20.build.f_cpu=20000000L
Gen7-1284P-20.build.core=arduino
Gen7-1284P-20.build.variant=gen7
Re: Feel my pain, usbasp not found
June 19, 2014 12:11PM
Off-topic, but instead of dual boot try this if you have the hardware for it, it works quite nice for me tbh.
For linux check arch wiki, you have to add user to certain groups so it can work with arduino and usb, perhaps that could be the permission issue.
So try $ groups and check if you are in groups lock, uucp, tty.
Quote

I'm relatively new to linux, but it appears the permissions are wrong, but that doesn't solve the second line... which is where the problem lies. Any ideas?
Its often said to just look at first error because the rest are probably consequences of that. So assuming it does not have the rights to access usb port, how could it possible talk to the programmer there. So second error is just consequence of first.

Edited 1 time(s). Last edit at 06/19/2014 12:20PM by NoobMan.
Re: Feel my pain, usbasp not found
June 19, 2014 11:37PM
You need to add your user to the dialout group

ie sudo adduser {your_user_name} dialout

With out being able to open up the serial port, you cant read the id and it it fails.
Re: Feel my pain, usbasp not found
June 20, 2014 01:30AM
I can't get my head around the permissions on linux. I followed the instructions on ArduinoPlayground and attempted the ArchWiki link, but to no avail. Couple of points:
1) In ArduinoIDE the serial ports are greyed out, can't even select one (where as in windows I can select a com)
2) When typing in: gpasswd -a $user lock , it says: gpasswd: group 'lock' does not exist in /etc/group
When i typed in groups to see what I have I got: damian adm dialout cdrom sudo dip plugdev lpadmin sambashare ,if that helps

I tried looking at a couple of videos and instructions, but being fresh on this os... it's kind-off difficult to take out the useful information and implement it into my situation.
Thanks for all the replies smiling smiley
Re: Feel my pain, usbasp not found
June 20, 2014 02:35AM
Uh sry i saw the linux part but didnt noticed the debian part. For mint the arduino page mentions only the dialout group and seems you are in it. Dunno what else. Perhaps try different versions - i have 1.5.6 and runs well for me.
If its just a fresh OS install and its same to you, can try install and give this a shot at it.
Re: Feel my pain, usbasp not found
June 21, 2014 02:01AM
I'm going to try to troubleshoot on Windows instead, I have more experience with it. I spent some time reading the other threads and as it turns out wierdly enough there is a difference between the atmega1284 and atmega1284p besides the picopower feature... I have the NON p. I changed the signature in avrdude.conf file to 0x1e 0x97 0x06 , but the same message persists... are there other factors to consider?

Also on my 10pin usbasp programmer I left the RXD and TXD alone, didn't plug anything into them (I have the programmer connected to my board via a 6 pin custom cable). I'm not 100% sure what they do, but from what I know they are a way of communication between the devices. Should I maybe jump them on the programmer? I also ordered a breadboard so I can try the 10 pin to 10 pin when that comes.
Re: Feel my pain, usbasp not found
June 21, 2014 04:06AM
Quote
AriesPrinters
there is a difference between the atmega1284 and atmega1284p besides the picopower feature... I have the NON p.

Uh, yes. Missed this bit, else I had answered already. It's the signature.

The proper way to go would be to add this signature to the bootloader sources and compile a new version. Bootloader is in the Gen7 repo, somewhere in the arduino folder.

A bit a dirty trick would be to force-upload (avrdude -F ...) the bootloader made for the 1284P and use this. Didn't test this, yet, but I think this bootloader should then report as 1284P and other than that, just work.

Adding your findings to the wiki page would be a welcome contribution, of course.


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Feel my pain, usbasp not found
June 24, 2014 08:53AM
Didn't have much time, and I still don't untill the week is over so I haven't recompiled the bootloaders yet... I tried to load directly from the usbasp without the bootloader for a quick fix. It said Com port not found and such, I checked and the programmer has no com port. I would think it wouldn't need one. Before I get at it again tommorrow and download a com port emulator, does anyone know if it's possible to disable them in arduino? I was having a hard time finding anything, but I didn't have much time to search so I could have easily missed something.
Re: Feel my pain, usbasp not found
June 27, 2014 12:47PM
Embarrassing update:

I had the self prog pin in place after miss reading some certain information, didn't take another hard look at the programmer until today. That bit is pulled out and now the dreaded usb not found message has disappeared smiling smiley However at a cost of something much worse... I fear I may have fried the chip. With and without the chip I get:

avrdude.exe: set SCK frequency to 93750 Hz
avrdude.exe: error: programm enable: target doesn't answer. 1
avrdude.exe: initialization failed, rc=-1
avrdude.exe: AVR device initialized and ready to accept instructions
avrdude.exe: Device signature = 0x580000
avrdude.exe: Expected signature for ATmega1284P is 1E 97

When I first got the programmer and was completely green with it and its premise I had it hooked up via vcc from the usbasp and external power. Didn't even consider it until today, all that extra power directly connected to the microcontroller... sigh, costs of being a novice. Can someone confirm my fears?
Re: Feel my pain, usbasp not found
June 28, 2014 03:22AM
A factory fresh ATmega ignores the external clock and runs on the internal R/C oscillator instead (else you couldn't upload something without external oscillator). As the 1/8 clock divider is turned on, too, this means the ATmega runs at just 1 MHz.

And for an ATmega running at 1 MHz, 93750 Hz is very very fast. Likely too fast. Accordingly you get nonsense over the line.

Why the hell is everybody so strongly avoiding instructions? To get more attention with failed attempts?


Generation 7 Electronics Teacup Firmware RepRap DIY
     
Re: Feel my pain, usbasp not found
July 09, 2014 04:51AM
FIX for the boot loader:

I ended up connecting my atmegas (I now have both, P and non P) to a bread board and connected 9 of the pins like wise:

USBASP ATMEGA1284/ATMEGA1284P

GND---------------------PIN 31 (gnd)
GND---------------------PIN 11 (gnd)
RXD---------------------PIN 14
TXD---------------------PIN 15
VCC--------------------PIN 10
MISO-------------------PIN 7
SCK--------------------PIN 8
RST---------------------PIN 9
MOSI-------------------PIN 6 (One of the pins are unmarked on my USBASP's schematic so I ignored it)

Weirdly enough the gen board only has 6 pins. no pins for the RXD and TXD, which seem to be necessary... it could be required by my programmer. Nonetheless, it worked like a charm. I downloaded avrdudess to simplify avrdude into a visual select and click program and voila smiling smiley

Some notes:
-On the programmer I had slow sck and vcc jumped, self prog should NOT be jumped. I had no external power connected, the vcc is all it needs.
-The -F override is not necessary, I downloaded a handy tool TextPad for windows with which I edited the avrdude.conf file (arduino/hardware/tools/avr/etc/avrdude.conf)-it's not necessary, it just made it visually easier for me. The atmega1284P has a signature 0x1e 0x97 0x05 and the atmega1284 0x1e 0x97 0x06. Just the last digit changes.

The rest, ArduinoIDE, .hex files and so forth are all on the wiki page with instructions smiling smiley


Now I have a questions to those smarter then me, I am having trouble loading the firmware tongue sticking out smiley all timeout issues (on breadboard and on gen 7 board both on linux and windows with teacup and sprinter firmwares) It may be that I'm just horrible at following directions, or I might just be having the worst luck. I have tried the setuptext.ino as a test from the wiki, same results. This would lead me to believe that the bootloader isn't present, but it loaded with no errors... I noticed my fuses differ from other peoples posts, here they are:
L 0x62
H 0x99
E 0xFF
LB 0x3f

On wiki it's like:
L 0xF7
H 0xDC
E 0xFC

I know how to change them, should I?
Re: Feel my pain, usbasp not found
July 09, 2014 05:02AM
Quick edit:

I got impatient, took to my gut and did it... It worked. And that people is how you program an Atmega1284 in 3 weeks... wish you all the best of luck tongue sticking out smiley feel free to comment if any questions arrive, I'll be more than happy to help out smiling smiley
Re: Feel my pain, usbasp not found
March 22, 2015 03:40PM
Hi,

Can you tell me how did you do it?

I have the same issue, I bought an USBasp v2 and an Atmega1284-PU, but I don't have connection to it through my Atmel Studio.
Please let me know, what code did you wrote it's EEPROM and how did you made the connection functioning.

Dan
Re: Feel my pain, usbasp not found
March 24, 2015 01:56PM
Treading through my notes and based on My posts and what I remember, it was a while back, the thing that finally got it going was writing the fuses. However you are having connection issues. Wiki is your best friend, approach it with a clear head, the answer is there. Above are important points I had missed or didn't fully understand. I would advise simply checking everything step by step and excluding certain things before getting to the source and fixing it. Search for info about factory fresh atmegas, that may be your problem? I wished I could help more, however I moved on to other projects and cant recall everything. For a 3d printer though the struggle is worth it smiling smiley
Re: Feel my pain, usbasp not found
March 24, 2015 01:57PM
I will add that avrdudess was a huge help, the link is also above.
Re: Feel my pain, usbasp not found
March 27, 2015 02:51PM
Hi,

Maybe help to someone.
I actually use MX-USBISP-V3.00 cheap programer from ebay. Named as USBASP USBISP.
I remember that I had trouble with connection and programming until I download this software on programer: Thomas Fischl

Bad thing is that you need programer to download program on "AVRasp(isp)".

Also see this pages: link

After that I follow steps to burn fuses on Atmega1284P 20MHz: Burn Fuses and Bootloader.

I work without bootloader on my Gen7 1.5 because I have some issue between marlin and pronterface caused by bootloader for ATmega1284P.

Edited 1 time(s). Last edit at 03/27/2015 02:55PM by zayoo.
Sorry, only registered users may post in this forum.

Click here to login