roboforum.ru

Технический форум по робототехнике.

Бутлоадер для ATMega128 (ATMega32)

Программирование микроконтроллеров AVR, PIC, ARM.
Разработка и изготовление печатных плат для модулей.

Бутлоадер для ATMega128 (ATMega32)

Сообщение =DeaD= » 20 фев 2010, 09:37

Сейчас пытаюсь освоить бутлоадер http://www.siwawi.arubi.uni-kl.de/avr_p ... rprog_boot для нашего проекта Open Robotics.

Уже продвинулся, avrdude под гуем его уже видит, читает сигнатуру, но прошивку загрузить не может, но загрузка так и не удалась. Гружу через блютуз.

В дефайнах выставлена частота 7.3728, тип МК мега128, второй уарт, тип запуска WAIT, тип который он предъявляет программе на ПК - ISP, время ожидания 10сек (чтобы БТ успевал соединиться), бутлоадер через терминал отвечает на S фразой AVRBOOT.

Вот что я сейчас использую (файл прикреплен). Это под M128-S, под 9600.
Фьюзы выставлены - BOOTSZ=1k, Boot чего-то там Enable, Protect Boot область режим 2.

Еще фишка - avrdude под гуем только не программирует (типа пишет, что бутлоадер не отвечает на команду write byte), а вот если командную строку скопировать и запустить реально как командную строку - он даже фьюзы не читает.

Ни у кого нет мыслей в чем может быть проблема?

Вот что под CLI пишет avrdude:
Код: Выделить всёРазвернуть
C:\Robot>"C:\WinAVR-20080610\bin\avrdude.exe" -p m128 -c avr910 -P com3 -U lfuse
:r:con:r -U hfuse:r:con:r -U lock:r:con:r -U efuse:r:con:r -U signature:r:con:r
-F

Found programmer: Id = "AVRBOOT"; type = S
    Software Version = 0.8; Hardware Version = ?.
Programmer supports auto addr increment.

Programmer supports the following devices:
    Device code: 0x43 = ATMEGA128

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

Reading | ################################################## | 100% 0.03s

avrdude.exe: Device signature = 0x1e9702
avrdude.exe: safemode: Verify error - unable to read hfuse properly. Programmer
may not be reliable.
avrdude.exe: safemode: To protect your AVR the programming will be aborted
avrdude.exe: error: programmer did not respond to command: leave prog mode


Добавлено спустя 17 минут 7 секунд:
Вот на такую команду:
"C:\WinAVR-20080610\bin\avrdude.exe" -p m128 -c avr910 -P com3 -U flash:w:"C:\Robot\orfa-1\orfa-m128-9600.hex":a -U signature:r:con:r -F -v


Под гуем avrdude-gui v0.2.0 отвечает:
avr-dude-answ.png


А под CLI:
Код: Выделить всёРазвернуть
C:\Documents and Settings\dead.DEAD-HOME>"C:\WinAVR-20080610\bin\avrdude.exe" -p
m128 -c avr910 -P com3 -U flash:w:"C:\Robot\orfa-1\orfa-m128-9600.hex":a -U sig
nature:r:con:r -F -v -v

avrdude.exe: Version 5.5, compiled on Jun  9 2008 at 14:32:04
             Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

             System wide configuration file is "C:\WinAVR-20080610\bin\avrdude.c
onf"

             Using Port            : com3
             Using Programmer      : avr910
             AVR Part              : ATMEGA128
             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         4    12    64    0 no       4096    8      0  9000
  9000 0xff 0xff
               flash         33     6   128    0 yes    131072  256    512  4500
  4500 0xff 0xff
               lfuse          0     0     0    0 no          1    0      0  9000
  9000 0x00 0x00
               hfuse          0     0     0    0 no          1    0      0  9000
  9000 0x00 0x00
               efuse          0     0     0    0 no          1    0      0  9000
  9000 0x00 0x00
               lock           0     0     0    0 no          1    0      0  9000
  9000 0x00 0x00
               calibration    0     0     0    0 no          4    0      0     0
     0 0x00 0x00
               signature      0     0     0    0 no          3    0      0     0
     0 0x00 0x00

             Programmer Type : avr910
             Description     : Atmel Low Cost Serial Programmer

Found programmer: Id = "AVRBOOT"; type = S
    Software Version = 0.8; Hardware Version = ?.p
Programmer supports auto addr increment.

Programmer supports the following devices:
    Device code: 0x43 = ATMEGA128

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

Reading | ################################################## | 100% 0.03s

avrdude.exe: Device signature = 0x1e9702
avrdude.exe: safemode: lfuse reads as 3F
avrdude.exe: safemode: Verify error - unable to read hfuse properly. Programmer
may not be reliable.
avrdude.exe: safemode: To protect your AVR the programming will be aborted
avrdude.exe: error: programmer did not respond to command: leave prog mode
Вложения
avrprog_boot_v0_85.zip
(87.03 КиБ) Скачиваний: 1
Проект [[Open Robotics]] - Универсальные модули для построения роботов
Аватара пользователя
=DeaD=
 
Сообщения: 24218
Зарегистрирован: 06 окт 2004, 18:01
Откуда: Ебург
прог. языки: C++ / PHP / 1C
ФИО: Антон Ботов

Re: Бутлоадер для ATMega128 (ATMega32)

Сообщение SMT » 20 фев 2010, 09:48

Что такое CLI?
Я прошиваю таким батником
Код: Выделить всёРазвернуть
@echo OFF
@cls
@echo.
@copy %1 tmp.hex
@echo Reset of the microcontroller and during 1 second ...
@pause
@C:\WinAVR\bin\avrdude.exe -p m32 -P com4 -b 9600 -c avr911 -u -U flash:w:tmp.hex
@echo.
@pause
@echo ON


настроил ассоциацию в FAR-e на расширение HEX
SMT
 
Сообщения: 1158
Зарегистрирован: 23 авг 2008, 22:28
Откуда: Санкт-Петербург
ФИО: Сергей

Re: Бутлоадер для ATMega128 (ATMega32)

Сообщение =DeaD= » 20 фев 2010, 09:51

CLI = Command Line Interface

avr911 - хм, а это кто? :)
Проект [[Open Robotics]] - Универсальные модули для построения роботов
Аватара пользователя
=DeaD=
 
Сообщения: 24218
Зарегистрирован: 06 окт 2004, 18:01
Откуда: Ебург
прог. языки: C++ / PHP / 1C
ФИО: Антон Ботов

Re: Бутлоадер для ATMega128 (ATMega32)

Сообщение blindman » 20 фев 2010, 09:52

Software Version = 0.8; Hardware Version = ?.p

Фигня какая-то. Должно быть "Hardware Version = 0.8"
Проект [[Open Robotics]] - универсальные модули для построения роботов
Модули Open Robotics можно приобрести в магазине shop.roboforum.ru

Day OFF? You must be pulling my leg! Stop making humor before someone sees you, fool!

Аватара пользователя
blindman
 
Сообщения: 4130
Зарегистрирован: 29 апр 2008, 21:15
Откуда: Хабаровск
прог. языки: C,C++,Assembler,PHP,Javascript,Ruby, SPIN,Java(?)
ФИО: Андрей Юрьевич

Re: Бутлоадер для ATMega128 (ATMega32)

Сообщение SMT » 20 фев 2010, 09:54

разница
Код: Выделить всёРазвернуть
#define DEVTYPE     DEVTYPE_BOOT


Добавлено спустя 1 минуту 25 секунд:
У меня под avr911 только нормально заработал
SMT
 
Сообщения: 1158
Зарегистрирован: 23 авг 2008, 22:28
Откуда: Санкт-Петербург
ФИО: Сергей

Re: Бутлоадер для ATMega128 (ATMega32)

Сообщение =DeaD= » 20 фев 2010, 10:02

2SMT: Т.е. надо в дефайнах выставить DEVTYPE_BOOT ?
Проект [[Open Robotics]] - Универсальные модули для построения роботов
Аватара пользователя
=DeaD=
 
Сообщения: 24218
Зарегистрирован: 06 окт 2004, 18:01
Откуда: Ебург
прог. языки: C++ / PHP / 1C
ФИО: Антон Ботов

Re: Бутлоадер для ATMega128 (ATMega32)

Сообщение SMT » 20 фев 2010, 10:09

у меня так
SMT
 
Сообщения: 1158
Зарегистрирован: 23 авг 2008, 22:28
Откуда: Санкт-Петербург
ФИО: Сергей

Re: Бутлоадер для ATMega128 (ATMega32)

Сообщение =DeaD= » 20 фев 2010, 10:17

Ок, ща попробуем

Добавлено спустя 6 минут 38 секунд:
Безразмерных масштабов спасибо!!! :beer: :friends: :good:

Код: Выделить всёРазвернуть
C:\Documents and Settings\dead.DEAD-HOME>"C:\WinAVR-20080610\bin\avrdude.exe" -p
m128 -c avr911 -P com3 -U flash:w:"C:\Robot\orfa-1\orfa-m128-9600.hex":a -U sig
nature:r:con:r -F -v

avrdude.exe: Version 5.5, compiled on Jun  9 2008 at 14:32:04
             Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

             System wide configuration file is "C:\WinAVR-20080610\bin\avrdude.c
onf"

             Using Port            : com3
             Using Programmer      : avr911
             AVR Part              : ATMEGA128
             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         4    12    64    0 no       4096    8      0  9000
  9000 0xff 0xff
               flash         33     6   128    0 yes    131072  256    512  4500
  4500 0xff 0xff
               lfuse          0     0     0    0 no          1    0      0  9000
  9000 0x00 0x00
               hfuse          0     0     0    0 no          1    0      0  9000
  9000 0x00 0x00
               efuse          0     0     0    0 no          1    0      0  9000
  9000 0x00 0x00
               lock           0     0     0    0 no          1    0      0  9000
  9000 0x00 0x00
               calibration    0     0     0    0 no          4    0      0     0
     0 0x00 0x00
               signature      0     0     0    0 no          3    0      0     0
     0 0x00 0x00

             Programmer Type : avr910
             Description     : Atmel AppNote AVR911 AVROSP

Connecting to programmer: .
Found programmer: Id = "AVRBOOT"; type = S
    Software Version = 0.8; No Hardware Version given.
Programmer supports auto addr increment.
Programmer supports buffered memory access with buffersize=256 bytes.

Programmer supports the following devices:
    Device code: 0x44

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

Reading | ################################################## | 100% 0.03s

avrdude.exe: Device signature = 0x1e9702
avrdude.exe: safemode: Fuse reading not support by programmer.
              Safemode disabled.
avrdude.exe: NOTE: FLASH memory has been specified, an erase cycle will be perfo
rmed
             To disable this feature, specify the -D option.
avrdude.exe: erasing chip
avrdude.exe: reading input file "C:\Robot\orfa-1\orfa-m128-9600.hex"
avrdude.exe: input file C:\Robot\orfa-1\orfa-m128-9600.hex auto detected as Inte
l Hex
avrdude.exe: writing flash (8332 bytes):

Writing | ################################################## | 100% 10.20s



avrdude.exe: 8332 bytes of flash written
avrdude.exe: verifying flash memory against C:\Robot\orfa-1\orfa-m128-9600.hex:
avrdude.exe: load data flash data from input file C:\Robot\orfa-1\orfa-m128-9600
.hex:
avrdude.exe: input file C:\Robot\orfa-1\orfa-m128-9600.hex auto detected as Inte
l Hex
avrdude.exe: input file C:\Robot\orfa-1\orfa-m128-9600.hex contains 8332 bytes
avrdude.exe: reading on-chip flash data:

Reading | ################################################## | 100% 9.92s



avrdude.exe: verifying ...
avrdude.exe: 8332 bytes of flash verified
avrdude.exe: reading signature memory:

Reading | ################################################## | 100% 0.03s

avrdude.exe: writing output file "con"

avrdude.exe done.  Thank you.
Проект [[Open Robotics]] - Универсальные модули для построения роботов
Аватара пользователя
=DeaD=
 
Сообщения: 24218
Зарегистрирован: 06 окт 2004, 18:01
Откуда: Ебург
прог. языки: C++ / PHP / 1C
ФИО: Антон Ботов

Re: Бутлоадер для ATMega128 (ATMega32)

Сообщение SMT » 20 фев 2010, 10:30

"На здоровье" (с) :beer:

Забавно - в последней строчке avrdude "Thank you" написал - тоже радуется :)
SMT
 
Сообщения: 1158
Зарегистрирован: 23 авг 2008, 22:28
Откуда: Санкт-Петербург
ФИО: Сергей


Вернуться в Микроконтроллеры

Кто сейчас на конференции

Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 0

cron