Hi,
I'm trying to program some fuses to the new ATmega32u4 chip using a cheap Chinese USBasp device (EvUSBasp) by using avrdude version 5.10.
avrdude can query the processor (avrdude -c usbasp -p m32u4).
tried to remove CKDIV8 fuse, and ask me "low fuse have changed from 5E to DE", do you want to change back to previous [y/n].
no matter what I select [y] or [n], soon after it just hangs. nothing happens.
I though it must be the programmer, then I burned a latest usbasp firmware.
Still nothing,
After thorough inspection, I realized that my pcb had no capacitors with the crystal
Then I remove the existing crystal and soldered this crystal, which is already having capacitors.
Still no luck, meaning I'm unable to change any fuse bits.
So did I bricked my mcu?
I don't think so. Just add the capacitors.
Thanks for your reply,
Sorry I just updated my original post, saying I did that also.
But still nothing.
pert
June 25, 2021, 4:48am
4
Try running the command again with more -v flags. If you do -v -v -v -v, you will normally get a tremendous level of verbosity. Although the information may be difficult to interpret, it might provide some insight into whether anything is happening, or if AVRDUDE is truly hanging.
Have you tried setting the clock to internal RC and uploading a simple led blink test? This should circumvent any potential issues with your crystal oscillator.
You may need to upload at slow speed which virtually all USBasp programmers support.
@anon35827816 that's the issue I faced initially, I cannot seem to set any fuses.
@pert
C:\>avrdude -c usbasp -p m32u4 -v -v -v -v -v -v
avrdude: Version 5.10, compiled on Jan 19 2010 at 10:45:23
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch
System wide configuration file is "C:\WinAVR-20100110\bin\avrdude.conf"
Using Port : lpt1
Using Programmer : usbasp
avrdude: seen device from vendor ->www.fischl.de<-
avrdude: seen product ->USBasp<-
AVR Part : ATmega32U4
Chip Erase delay : 9000 us
PAGEL : PD7
BS2 : PA0
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 10 8 0 no 1024 8 0 9000 9000 0x00 0x00
Memory Ops:
Oeration Inst Bit Bit Type Bitno Value
----------- -------- -------- ----- -----
READ 31 VALUE 7 1
30 VALUE 6 0
29 VALUE 5 1
28 VALUE 4 0
27 VALUE 3 0
26 VALUE 2 0
25 VALUE 1 0
24 VALUE 0 0
23 IGNORE 7 0
22 IGNORE 6 0
21 IGNORE 5 0
20 IGNORE 4 0
19 IGNORE 3 0
18 ADDRESS 10 0
17 ADDRESS 9 0
16 ADDRESS 8 0
15 ADDRESS 7 0
14 ADDRESS 6 0
13 ADDRESS 5 0
12 ADDRESS 4 0
11 ADDRESS 3 0
10 ADDRESS 2 0
9 ADDRESS 1 0
8 ADDRESS 0 0
7 OUTPUT 7 0
6 OUTPUT 6 0
5 OUTPUT 5 0
4 OUTPUT 4 0
3 OUTPUT 3 0
2 OUTPUT 2 0
1 OUTPUT 1 0
0 OUTPUT 0 0
WRITE 31 VALUE 7 1
30 VALUE 6 1
29 VALUE 5 0
28 VALUE 4 0
27 VALUE 3 0
26 VALUE 2 0
25 VALUE 1 0
24 VALUE 0 0
23 IGNORE 7 0
22 IGNORE 6 0
21 IGNORE 5 0
20 IGNORE 4 0
19 IGNORE 3 0
18 ADDRESS 10 0
17 ADDRESS 9 0
16 ADDRESS 8 0
15 ADDRESS 7 0
14 ADDRESS 6 0
13 ADDRESS 5 0
12 ADDRESS 4 0
11 ADDRESS 3 0
10 ADDRESS 2 0
9 ADDRESS 1 0
8 ADDRESS 0 0
7 INPUT 7 0
6 INPUT 6 0
5 INPUT 5 0
4 INPUT 4 0
3 INPUT 3 0
2 INPUT 2 0
1 INPUT 1 0
0 INPUT 0 0
LOADPAGE_LO 31 VALUE 7 1
30 VALUE 6 1
29 VALUE 5 0
28 VALUE 4 0
27 VALUE 3 0
26 VALUE 2 0
25 VALUE 1 0
24 VALUE 0 1
23 VALUE 7 0
22 VALUE 6 0
21 VALUE 5 0
20 VALUE 4 0
19 VALUE 3 0
18 VALUE 2 0
17 VALUE 1 0
16 VALUE 0 0
15 VALUE 7 0
14 VALUE 6 0
13 VALUE 5 0
12 VALUE 4 0
11 VALUE 3 0
10 ADDRESS 2 0
9 ADDRESS 1 0
8 ADDRESS 0 0
7 INPUT 7 0
6 INPUT 6 0
5 INPUT 5 0
4 INPUT 4 0
3 INPUT 3 0
2 INPUT 2 0
1 INPUT 1 0
0 INPUT 0 0
WRITEPAGE 31 VALUE 7 1
30 VALUE 6 1
29 VALUE 5 0
28 VALUE 4 0
27 VALUE 3 0
26 VALUE 2 0
25 VALUE 1 1
24 VALUE 0 0
23 VALUE 7 0
22 VALUE 6 0
21 IGNORE 5 0
20 IGNORE 4 0
19 IGNORE 3 0
18 ADDRESS 10 0
17 ADDRESS 9 0
16 ADDRESS 8 0
15 ADDRESS 7 0
14 ADDRESS 6 0
13 ADDRESS 5 0
12 ADDRESS 4 0
11 ADDRESS 3 0
10 VALUE 2 0
9 VALUE 1 0
8 VALUE 0 0
7 IGNORE 7 0
6 IGNORE 6 0
5 IGNORE 5 0
4 IGNORE 4 0
3 IGNORE 3 0
2 IGNORE 2 0
1 IGNORE 1 0
0 IGNORE 0 0
Can you post a photo of your Usbasp device?
pert
June 25, 2021, 4:59am
10
Does it just hang at that point forever?
@pert @anon35827816 this is latest I'm getting out of the avrdude now,
C:\>avrdude -c usbasp -p m32u4
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.01s
avrdude: Device signature = 0x010304
avrdude: Expected signature for ATmega32U4 is 1E 95 87
Double check chip, or use -F to override this check.
avrdude done. Thank you.
Ok, that's a pity; some of those devices come with a jumper (which is often not actually populated) that you can use to force slow speed programming. You may be able to modify this device to include that option but you'd have to check which pin of the Atmega8u you have to connect to either gnd or Vcc. I'd have to dig into the usbasp schematics.
Btw, what does the reset circuit look like on your target uC?
Ok, that looks good.
Try pulling pin 25 on the Atmega8 on your programmer to ground during programming. This should force the USBASP into slow speed mode, preventing timing issues between the USBASP and the target uC.
1 Like
pert
June 25, 2021, 5:27am
16
The default firmware on these Chinese USBasp programmers automatically adjusts the speed. Unfortunately, the spurious message from AVRDUDE about the firmware update causes people to flash the inferior official USBasp firmware, which does not have this capability.
There is no way to get back the proprietary Chinese modified firmware, but there is a nice community version available that is actually superior to both the official and Chinese firmwares:
anon35827816:
Atmega8
@pert this is the exact version which I flashed to my device (usbasp.atmega8.2011-05-28.hex).
So I read, yes. However, on my Chinese USBasp device, I only get the slow clock if I set it in hardware using said jumper. I never looked into it further than that since it works reliably that way. Btw, I never reprogrammed my USBasp; perhaps I should. But then again, if it ain't broken...
@anon35827816 ho wow. with pin 25 pull down to ground, I'm reading the chip.
C:\>avrdude -c usbasp -p m32u4
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.02s
avrdude: Device signature = 0x1e9587
avrdude: safemode: Fuses OK
avrdude done. Thank you.
Now I want to set the low fuse to 0xde.
What should I answer here, Y or N?
it's confusing.
C:\>avrdude -c usbasp -p m32u4 -U lfuse:w:0xde:m -U hfuse:w:0x99:m -U efuse:w:0xf3:m
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.02s
avrdude: Device signature = 0x1e9587
avrdude: reading input file "0xde"
avrdude: writing lfuse (1 bytes):
Writing | | 0% 0.00s ***failed;
Writing | ################################################## | 100% 0.08s
avrdude: 1 bytes of lfuse written
avrdude: verifying lfuse memory against 0xde:
avrdude: load data lfuse data from input file 0xde:
avrdude: input file 0xde contains 1 bytes
avrdude: reading on-chip lfuse data:
Reading | ################################################## | 100% 0.01s
avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0000
0xde != 0x5e
avrdude: verification error; content mismatch
avrdude: safemode: lfuse changed! Was de, and is now 5e
Would you like this fuse to be changed back? [y/n]