nastavení fuses ATmega2560 pomocí AVRDUDE

Odpovědět
circuit
Příspěvky: 6
Registrován: 18 čer 2020, 17:24
Reputation: 0

nastavení fuses ATmega2560 pomocí AVRDUDE

Příspěvek od circuit » 24 čer 2020, 17:47

jak se vám daří nastavování fuses pomocí Avrdude 6.3 u procesoru ATmega 2560?

toto mi nechodí:
avrdude.exe -p m2560 -c wiring -P COM5 -b 115200 -u -v -U lfuse:w:0xFF:m -U hfuse:w:0xD0:m -U efuse:w:0xFF:m

lze úspěšně použít i parametr -e pro vymazání čipu?

AstroMiK
Příspěvky: 592
Registrován: 08 pro 2017, 19:05
Reputation: 0

Re: nastavení fuses ATmega2560 pomocí AVRDUDE

Příspěvek od AstroMiK » 24 čer 2020, 19:29

Já teda s tímto konkrétním případem neporadím, protože ten ATmega2560 nemám,
ale možná pomůže, když sem hodíš i ten výstup, co AVRDUDE píše.

Případně můžeš doplnit i víc parametrů "-v" pro detailnější výpis.

circuit
Příspěvky: 6
Registrován: 18 čer 2020, 17:24
Reputation: 0

Re: nastavení fuses ATmega2560 pomocí AVRDUDE

Příspěvek od circuit » 11 črc 2020, 20:59

omlouvám se za zpožděnou odpověď, tady to je: hfuses nastavuji z D0 na D8

C:\avrdude 6.3>avrdude.exe -p m2560 -c wiring -P COM4 -b 115200 -u -v -v -v -U lfuse:w:0xFF:m -U hfuse:w:0xD8:m -U efuse:w:0xFF:m

avrdude.exe: Version 6.3, compiled on Feb 17 2016 at 09:25:53
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch

System wide configuration file is "C:\avrdude 6.3\avrdude.conf"

Using Port : COM4
Using Programmer : wiring
Overriding Baud Rate : 115200
avrdude.exe: wiring_open(): releasing DTR/RTS
avrdude.exe: wiring_open(): asserting DTR/RTS
avrdude.exe: stk500v2_getsync(): found AVRISP programmer
AVR Part : ATmega2560
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 4096 8 0 9000 9000 0x00 0x00
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
flash 65 10 256 0 yes 262144 256 1024 4500 4500 0x00 0x00
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
lfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
hfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
efuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
lock 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
Block Poll Page Polled
Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00

Programmer Type : Wiring
Description : Wiring
Programmer Model: AVRISP
Hardware Version: 15
Firmware Version Master : 2.10
Vtarget : 0.0 V
SCK period : 0.1 us

avrdude.exe: AVR device initialized and ready to accept instructions

Reading | | 0% 0.00savrdude.exe: stk500isp_read_byte(.., signature, 0x0, ...)
avrdude.exe: stk500isp_read_byte(): Sending read memory command: avrdude.exe: stk500isp_read_byte(.., signature, 0x1, ...)
Reading | ################# | 33% 0.05savrdude.exe: stk500isp_read_byte(.., signature, 0x2, ...)
Reading | ################################################## | 100% 0.07s

avrdude.exe: Device signature = 0x1e9801 (probably m2560)
avrdude.exe: reading input file "0xFF"
avrdude.exe: writing lfuse (1 bytes):

Writing | | 0% 0.00savrdude.exe: stk500isp_write_byte(.., lfuse, 0x0, ...)
avrdude.exe: stk500isp_write_byte(): Sending write memory command: avrdude.exe: stk500v2_command(): command failed
avrdude.exe: stk500isp_write_byte(): timeout/error communicating with programmer
***failed;
Writing | ################################################## | 100% 0.05s

avrdude.exe: 1 bytes of lfuse written
avrdude.exe: verifying lfuse memory against 0xFF:
avrdude.exe: load data lfuse data from input file 0xFF:
avrdude.exe: input file 0xFF contains 1 bytes
avrdude.exe: reading on-chip lfuse data:

Reading | | 0% 0.00savrdude.exe: stk500isp_read_byte(.., lfuse, 0x0, ...)
Reading | ################################################## | 100% 0.02s

avrdude.exe: verifying ...
avrdude.exe: 1 bytes of lfuse verified
avrdude.exe: reading input file "0xD8"
avrdude.exe: writing hfuse (1 bytes):

Writing | | 0% 0.00savrdude.exe: stk500isp_write_byte(.., hfuse, 0x0, ...)
avrdude.exe: stk500isp_write_byte(): Sending write memory command: avrdude.exe: stk500v2_command(): command failed
avrdude.exe: stk500isp_write_byte(): timeout/error communicating with programmer
***failed;
Writing | ################################################## | 100% 0.05s

avrdude.exe: 1 bytes of hfuse written
avrdude.exe: verifying hfuse memory against 0xD8:
avrdude.exe: load data hfuse data from input file 0xD8:
avrdude.exe: input file 0xD8 contains 1 bytes
avrdude.exe: reading on-chip hfuse data:

Reading | | 0% 0.00savrdude.exe: stk500isp_read_byte(.., hfuse, 0x0, ...)
Reading | ################################################## | 100% 0.03s

avrdude.exe: verifying ...
avrdude.exe: verification error, first mismatch at byte 0x0000
0xd0 != 0xd8
avrdude.exe: verification error; content mismatch

avrdude.exe done. Thank you.

AstroMiK
Příspěvky: 592
Registrován: 08 pro 2017, 19:05
Reputation: 0

Re: nastavení fuses ATmega2560 pomocí AVRDUDE

Příspěvek od AstroMiK » 11 črc 2020, 21:35

Jak jsem psal, vyzkoušet to nemohu, ale není ta rychlost (-b 115200) moc velká?
Z výpisu je vidět, že čtení funguje (signaturu čipu to zjistí správně):

Kód: Vybrat vše

avrdude.exe: Device signature = 0x1e9801 (probably m2560)

Při pokusu o zápis hned za tím to hází chybu:

Kód: Vybrat vše

avrdude.exe: stk500isp_write_byte(): Sending write memory command: avrdude.exe: stk500v2_command(): command failed
V zapojení tedy problém nebude, programátor i čip fungují.
Takže jediný, co mě napadá, je ta rychlost.

circuit
Příspěvky: 6
Registrován: 18 čer 2020, 17:24
Reputation: 0

Re: nastavení fuses ATmega2560 pomocí AVRDUDE

Příspěvek od circuit » 11 črc 2020, 22:50

Zkusil jsem vynechat parametr rychlosti a chyba při zápisu je stejná, ale komunikuje to.
Když jsem zadal poloviční rychlost, vůbec to s Arduinem nekomunikovalo. Takže soudím, že 115200 baud je v pořádku. Fuse CLKdiv8 mám pro mou aplikaci nastaven na neaktivní a nechci to měnit.

Jestli není zapotřebí něco nastavit v avrdude.conf pro "m2560" nebo u programátoru "wiring"? Protože podle toho chybového výpisu výše to nerozumí nebo neumí "write" příkaz:
Writing | | 0% 0.00savrdude.exe: stk500isp_write_byte(.., lfuse, 0x0, ...)
avrdude.exe: stk500isp_write_byte(): Sending write memory command: avrdude.exe: stk500v2_command(): command failed
avrdude.exe: stk500isp_write_byte(): timeout/error communicating with programmer
***failed;
Writing | ################################################## | 100% 0.05s

Nebo změnit druh programátoru?

Odpovědět

Kdo je online

Uživatelé prohlížející si toto fórum: Žádní registrovaní uživatelé a 2 hosti