Не заливается скетч в arduino pro mini
- Войдите на сайт для отправки комментариев
Сб, 16/02/2019 - 22:01
Плата Arduino Pro Mini 5V/16Mhz с алика, программатор Arduino UNO (оригинальный) as ISP
В ардуино новичок если что. Плата перестала отправлять сигналы на адресную ленту. танцы с бубном и гуглом вывели меня на сдохший бутлоадер и слетевшие фьюзы. avrdude показал значение всех фьюзов и лок-бит в 0x00 (неопределено). Выставил согласно boards.txt
pro.menu.cpu.16MHzatmega328.bootloader.low_fuses=0xFF pro.menu.cpu.16MHzatmega328.bootloader.high_fuses=0xDA pro.menu.cpu.16MHzatmega328.bootloader.extended_fuses=0xFD
лок-бит в 0xFF

Бутлоадер не шился через Arduino IDE 1.8.3, просил force опции (-F). Прошил его через консоль:
C:\Users\siarhei>C:\Users\siarhei\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino14/bin/avrdude -CC:\Users\siarhei\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino14/etc/avrdude.conf -F
no -PCOM7 -b19200 -e -Ulock:w:0x3F:m -Uefuse:w:0xFD:m -Uhfuse:w:0xDA:m -Ulfuse:w:0xFF:m
avrdude: Version 6.3-20171130
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "C:\Users\siarhei\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino14/etc/avrdude.conf"
Using Port : COM7
Using Programmer : arduino
Overriding Baud Rate : 19200
AVR Part : ATmega328P
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 : Arduino
Description : Arduino
Hardware Version: 2
Firmware Version: 1.18
Topcard : Unknown
Vtarget : 0.0 V
Varef : 0.0 V
Oscillator : Off
SCK period : 0.1 us
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.01s
avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as DA
avrdude: safemode: efuse reads as FD
avrdude: erasing chip
avrdude: reading input file "0x3F"
avrdude: writing lock (1 bytes):
Writing | ################################################## | 100% 0.02s
avrdude: 1 bytes of lock written
avrdude: verifying lock memory against 0x3F:
avrdude: load data lock data from input file 0x3F:
avrdude: input file 0x3F contains 1 bytes
avrdude: reading on-chip lock data:
Reading | ################################################## | 100% 0.02s
avrdude: verifying ...
avrdude: 1 bytes of lock verified
avrdude: reading input file "0xFD"
avrdude: writing efuse (1 bytes):
Writing | ################################################## | 100% 0.02s
avrdude: 1 bytes of efuse written
avrdude: verifying efuse memory against 0xFD:
avrdude: load data efuse data from input file 0xFD:
avrdude: input file 0xFD contains 1 bytes
avrdude: reading on-chip efuse data:
Reading | ################################################## | 100% 0.01s
avrdude: verifying ...
avrdude: 1 bytes of efuse verified
avrdude: reading input file "0xDA"
avrdude: writing hfuse (1 bytes):
Writing | ################################################## | 100% 0.02s
avrdude: 1 bytes of hfuse written
avrdude: verifying hfuse memory against 0xDA:
avrdude: load data hfuse data from input file 0xDA:
avrdude: input file 0xDA contains 1 bytes
avrdude: reading on-chip hfuse data:
Reading | ################################################## | 100% 0.02s
avrdude: verifying ...
avrdude: 1 bytes of hfuse verified
avrdude: reading input file "0xFF"
avrdude: writing lfuse (1 bytes):
Writing | ################################################## | 100% 0.02s
avrdude: 1 bytes of lfuse written
avrdude: verifying lfuse memory against 0xFF:
avrdude: load data lfuse data from input file 0xFF:
avrdude: input file 0xFF contains 1 bytes
avrdude: reading on-chip lfuse data:
Reading | ################################################## | 100% 0.02s
avrdude: verifying ...
avrdude: 1 bytes of lfuse verified
avrdude: safemode: lfuse reads as FF
avrdude: safemode: hfuse reads as DA
avrdude: safemode: efuse reads as FD
avrdude: safemode: Fuses OK (E:FD, H:DA, L:FF)
avrdude done. Thank you.
Вроде бы должно быть все ок, но при попытке загрузить скетч через ISP:
avrdude: Version 6.3-20171130
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "C:\Users\siarhei\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino14/etc/avrdude.conf"
Using Port : COM7
Using Programmer : arduino
Overriding Baud Rate : 19200
AVR Part : ATmega328P
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 : Arduino
Description : Arduino
Hardware Version: 2
Firmware Version: 1.18
Topcard : Unknown
Vtarget : 0.0 V
Varef : 0.0 V
Oscillator : Off
SCK period : 0.1 us
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.01s
avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "C:\Users\siarhei\AppData\Local\Temp\arduino_build_382872/colorMusic_v2.8.ino.hex"
avrdude: writing flash (18202 bytes):
Writing | ################################################## | 100% 19.93s
avrdude: 18202 bytes of flash written
avrdude: verifying flash memory against C:\Users\siarhei\AppData\Local\Temp\arduino_build_382872/colorMusic_v2.8.ino.hex:
avrdude: load data flash data from input file C:\Users\siarhei\AppData\Local\Temp\arduino_build_382872/colorMusic_v2.8.ino.hex:
avrdude: input file C:\Users\siarhei\AppData\Local\Temp\arduino_build_382872/colorMusic_v2.8.ino.hex contains 18202 bytes
avrdude: reading on-chip flash data:
Reading | ################################################## | 100% 11.13s
avrdude: verifying ...
Произошла ошибка при загрузке скетча
avrdude: verification error, first mismatch at byte 0x0000
0xff != 0x0c
avrdude: verification error; content mismatch
avrdude done. Thank you.
Через USB-TTL плата ребутается (видно по диоду), но тоже не шьётся:
avrdude: Version 6.3-20171130
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch
System wide configuration file is "C:\Users\siarhei\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino14/etc/avrdude.conf"
Using Port : COM5
Using Programmer : arduino
Overriding Baud Rate : 57600
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x7e
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x7e
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x7e
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x7e
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x7e
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x7e
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x7e
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x7e
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x7e
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x7e
avrdude done. Thank you.
Проблема загрузки в плату. Помощь по загрузке: http://www.arduino.cc/en/Guide/Troubleshooting#upload
Так через ICSP (программатор) бутлоадер снести можно, потом ничего шиться через UART и не будет. Лучше остановиться на чём-то одном.
Изначально все шилось через UART, но после сбоя (плата перестала отправлять сигналы на адресную ленту) прошиваться через UART перестала, отчего и начались танцы с бубном. Собственно скетч так и не шьётся (ни через UART, ни через ISP - логи выше), хотя фьюзы выставлены как в boards.txt, и залит бутлоадер от ATMega328p (команду взял из IDE и добавил опцию -F, как просило).
Ну дак я чего пишу: бутлоадер восстановили, а потом, поди, снесли его прошивкой через ICSP.
команду взял из IDE и добавил опцию -F, как просило).
Ничего оно не просило. На английском плохо читаете? там было написано буквально следующее:
avrdude: Yikes! Invalid device signature. Double check connections and try again, or use -F to override this check.В переводе оно значит - сначала дважды (а реально - тысячу раз) проверьте все остальное, а только потом можете попробовать опцию "-F". Но если б вы еще и в гугле поискали по этому тексту - то узнали бы, что на самом деле даже после всех проверок опция "-F" не выход - на самом деле НИКОГДА НЕ СЛЕДУЕТ использовать "-F" в аврдудке.
Появление этой ошибки означает, что вы сделали что-то не так - не так соединили, перепутали чип, не подали на него частоту с кварца и тд и тп Если у вас не читается сигнатура - надо искать ошибку, а не насильно пихать в чип фьюзы. Чип, у которого не та сигнатура - все равно нормально не прошить, опцией -F вы его можете только залочить, так что потом оживить его можно будет только высоковольтным программатором - что у вас и произошло, видимо.
насколько я понимаю в залоченном чипе уже фьюзы не читаются и не пишутся через ISP. У меня пока с этим проблем нет, на сигнатуру ругается если контакт плохой - сейчас не ругается. Пробовал перешить без -F или optiboot ругается
ATmegaBOOT_168_atmega328.hex: 1 950 / 32 768 Bytes (5,95%) optiboot_atmega328.hex: 478 / 32 768 Bytes (1,46%) ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ avrdude.exe: AVR device initialized and ready to accept instructions Reading | ################################################## | 100% 0.01s avrdude.exe: Device signature = 0x1e950f (probably m328p) avrdude.exe: erasing chip avrdude.exe: reading input file "C:\optiboot_atmega328.hex" avrdude.exe: input file C:\optiboot_atmega328.hex auto detected as Intel Hex avrdude.exe: writing flash (32768 bytes): Writing | ################################################## | 100% 0.00s avrdude.exe: 32768 bytes of flash written avrdude.exe: verifying flash memory against C:\optiboot_atmega328.hex: avrdude.exe: load data flash data from input file C:\optiboot_atmega328.hex: avrdude.exe: input file C:\optiboot_atmega328.hex auto detected as Intel Hex avrdude.exe: input file C:\optiboot_atmega328.hex contains 32768 bytes avrdude.exe: reading on-chip flash data: Reading | ################################################## | 100% -0.00s avrdude.exe: verifying ... avrdude.exe: verification error, first mismatch at byte 0x7e00 0x6e != 0x01 avrdude.exe: verification error; content mismatch avrdude.exe done. Thank you.Сейчас либо криво прошивается, либо криво считывается после прошивки. Пишет, что во время проверки уже загруженной прошивки она не совпала с оригинальной.
Что за провода и какой длины для прошивки через ISP?
дюпонт 20см, может быть проблема в них?
Три метра USB удлиннитель из-под стола,
USBASP,
потом полтора метра серый плоский шлейф.
А вы продолжайте свой дюпон микрометром мерять.....
дюпонт 20см, может быть проблема в них?
Такие? Да, у них контакт периодически может пропадать из-за плохого качества изготовления. Уже встречалось на этом форуме, что у людей были "плавающие" глюки, пока не поменяли dupont-провода на нормальные.
да, такие. спаял шлейфом от компа 2 платы - теперь фьюзы не пишутся (читаются все как 0х00) и скорость работы вдруг стала 115200. прям мистика какая-то, видимо все-таки плата сдохла.
C:\Users\siarhei>C:\Users\siarhei\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino14/bin/avrdude -CC:\Users\siarhei\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino14/etc/avrdude.conf -v -PCOM9 -b115200 -e -Ulock:w:0x3F:m -Uefuse:w:0xFD:m -Uhfuse:w:0xDA:m -Ulfuse:w:0xFF:m avrdude: Version 6.3-20171130 Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/ Copyright (c) 2007-2014 Joerg Wunsch System wide configuration file is "C:\Users\siarhei\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino14/etc/avrdude.conf" Using Port : COM9 Using Programmer : arduino Overriding Baud Rate : 115200 AVR Part : ATmega328P 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 : Arduino Description : Arduino Hardware Version: 3 Firmware Version: 4.4 Vtarget : 0.3 V Varef : 0.3 V Oscillator : 28.800 kHz SCK period : 3.3 us avrdude: AVR device initialized and ready to accept instructions Reading | ################################################## | 100% 0.00s avrdude: Device signature = 0x1e950f (probably m328p) avrdude: safemode: lfuse reads as 0 avrdude: safemode: hfuse reads as 0 avrdude: safemode: efuse reads as 0 avrdude: erasing chip avrdude: reading input file "0x3F" avrdude: writing lock (1 bytes): Writing | | 0% 0.00s ***failed; Writing | ################################################## | 100% 0.11s avrdude: 1 bytes of lock written avrdude: verifying lock memory against 0x3F: avrdude: load data lock data from input file 0x3F: avrdude: input file 0x3F contains 1 bytes avrdude: reading on-chip lock data: Reading | ################################################## | 100% 0.02s avrdude: verifying ... avrdude: verification error, first mismatch at byte 0x0000 0x00 != 0x3f avrdude: verification error; content mismatch avrdude: safemode: lfuse reads as 0 avrdude: safemode: hfuse reads as 0 avrdude: safemode: efuse reads as 0 avrdude: safemode: Fuses OK (E:00, H:00, L:00) avrdude done. Thank you.просто интересно было разобраться, но, вероятно, проще дождаться пары новых плат, чем с этой возится. спасибо
1. Если считалась сигнатура- значит живой.
avrdude: Device signature = 0x1e950f (probably m328p)
2. Вы действительно именно такой файл в неё записываете?
avrdude: reading input file "0x3F"
3. Пишите загрузчик снова.
Только без всяких -F
Если не станет писать- поправьте сигнатуру в конфиге аврдуды
черным- 12вольтовый разлочиватель , красным ISPS прошиватель для ISPusb
разъём для тиньки, но дюпонами можно к бреду цеплят. Например разлочивать 328.
если брать команду из IDE я так понимаю загрузчик определяется пао конфигу, hex файл в папке присутствует (тот что указан в boards.txt), напрямую в команде ссылки на hex нет.
Пробовал задать ссылку, результат такой:
avrdude: AVR device initialized and ready to accept instructions Reading | ################################################## | 100% 0.01s avrdude: Device signature = 0x1e950f (probably m328p) avrdude: safemode: lfuse reads as 0 avrdude: safemode: hfuse reads as 0 avrdude: safemode: efuse reads as 0 avrdude: erasing chip avrdude: reading input file "C:\optiboot_atmega328.hex" avrdude: input file C:\optiboot_atmega328.hex auto detected as Intel Hex avrdude: writing flash (32768 bytes): Writing | ################################################## | 100% 0.03s avrdude: 32768 bytes of flash written avrdude: verifying flash memory against C:\optiboot_atmega328.hex: avrdude: load data flash data from input file C:\optiboot_atmega328.hex: avrdude: input file C:\optiboot_atmega328.hex auto detected as Intel Hex avrdude: input file C:\optiboot_atmega328.hex contains 32768 bytes avrdude: reading on-chip flash data: Reading | ################################################## | 100% 0.03s avrdude: verifying ... avrdude: verification error, first mismatch at byte 0x7e00 0x11 != 0x01 avrdude: verification error; content mismatch avrdude: safemode: lfuse reads as 0 avrdude: safemode: hfuse reads as 0 avrdude: safemode: efuse reads as 0 avrdude: safemode: Fuses OK (E:00, H:00, L:00) avrdude done. Thank you.скорость работы вдруг стала 115200. прям мистика какая-то, видимо все-таки плата сдохла.
скорость задана в конфиге, от проводов или "дохлости платы" она никак не зависит - так что ищите, что вы поменяли в настройках или опциях дудки