AVRUB & Atmega 644P

96 views
Skip to first unread message

jacek....@gmail.com

unread,
Jan 5, 2015, 6:27:57 PM1/5/15
to av...@googlegroups.com
Im trying to start AVRUB with atmega 644P
and getting error like below (already checked connection with test.c):

> Start download
$ Send reset command: [7E ]
> Start connect
$ <1> Send connect key: 64
: 64                                      d
: 77 61 69 74 69 6E 67 20 66 6F 72 20     waiting for
: 64 61 74 61 2E 0D 0A                    data...
$ <2> Send connect key: 64
: 64                                      d
: 43                                      C
$ <3> Send connect key: 64
: 64                                      d
: 43                                      C
V Connect success
  \

  |

  /

  -


X Too many retry!
X Update fail

Clock: 18432000
Port:1
Direction Pin: PC5
Baud rate : 9600 8n1

hex size: 3659 bajts
Fuses:
Low: 0xDE
High: 0xD8
Extended: 0xFF


Config file:


#ifndef _BOOTCFG_H_
#define _BOOTCFG_H_        1

//define uart buffer's length
#define BUFFERSIZE         128

//system clock(Hz)
#ifndef F_CPU
#define F_CPU              18432000UL
#endif

//baudrate
#define BAUDRATE           9600

//Boot section start address(byte)
//define BootStart to 0 will disable this function
#define BootStart          2 * 0x7000UL

//verify flash's data while write
//ChipCheck will only take effect while BootStart enable also
#define ChipCheck          1

//In SafeMode, it will not jump to user application till update successfully
#define SafeMode           1

//In SafeMode, it will set a flag in EEPROM
#define FlagAddr           E2END

//Bootloader launch  0:comport password  1:port level
#define LEVELMODE          0

#define LEVELPORT          D
#define LEVELPIN           PD7
//port level  1:High  0:Low
#define PINLEVEL           0

//max wait password time = TimeOutCnt * timeclk
//timeout count
#define TimeOutCnt         10

//basic timer interval(ms)
#define timeclk            200

//max wait data time = TimeOutCntC * timeclk
//send 'C' command count
#define TimeOutCntC        50

//password length
#define CONNECTCNT         1

//password
#if LEVELMODE == 0
unsigned char ConnectKey[] = {0x64};
#endif

//comport number: 0/1/2..
#define COMPORTNo          1

//enable watchdog
#define WDG_En             0

//enable RS485/RS422 mode
#define RS485              1
//RS485/RS422 send control port
#define RS485PORT          C
#define RS485TXEn          PC5

//enable LED indication
#define LED_En             0
//LED control port
#define LEDPORT            D
#define LEDPORTNo          PD6

//some old kind of AVR need special delay after comport initialization
#define InitDelay          0

//communication checksum method   0:CRC16  1:add up
#define CRCMODE            0

//Verbose mode: display more prompt message
#define VERBOSE            1

//prompt messages
#if VERBOSE
#if LEVELMODE
const char msg6[] = "bootloader mode.";
const char msg7[] = "application mode.";
#else
//waiting for password
const char msg1[] = "waiting for password.";
#endif
//timeout
const char msg2[] = "timeout.";
//waiting for data
const char msg3[] = "waiting for data.";
//update success
const char msg4[] = "update success.";
//update fail
const char msg5[] = "update fail.";
#endif

//enable decrypt buffer
#define Decrypt            0

//crypt algorithm
//PC1_128, PC1 Cipher Algorithm with 128 bits key
#define PC1_128            1
//PC1_256, PC1 Cipher Algorithm with 256 bits key
#define PC1_256            2
//AES_128, AES Cipher Algorithm with 128 bits key
#define AES_128            3
//AES_256, AES Cipher Algorithm with 256 bits key
#define AES_256            4

#define Algorithm          PC1_128

#if Decrypt

#if (Algorithm == PC1_128) || (Algorithm == AES_128)
//Define decrypt key: 128b
unsigned char DecryptKey[16] ={
  0xD0, 0x94, 0x3F, 0x8C, 0x29, 0x76, 0x15, 0xD8,
  0x20, 0x40, 0xE3, 0x27, 0x45, 0xD8, 0x48, 0xAD
};
#elif (Algorithm == PC1_256) || (Algorithm == AES_256)
//Define decrypt key: 256b
unsigned char DecryptKey[32] ={
  0xD0, 0x94, 0x3F, 0x8C, 0x29, 0x76, 0x15, 0xD8,
  0x20, 0x40, 0xE3, 0x27, 0x45, 0xD8, 0x48, 0xAD,
  0xEA, 0x8B, 0x2A, 0x73, 0x16, 0xE9, 0xB0, 0x49,
  0x45, 0xB3, 0x39, 0x28, 0x0A, 0xC3, 0x28, 0x3C
};

#endif

#endif

#endif

//End of file: bootcfg.h

shaoziyang

unread,
Jan 5, 2015, 9:24:15 PM1/5/15
to av...@googlegroups.com
Hi,

Which version of avrub do you using?

Because google can't accessable in China now, I put avrub in sourceforge. You may find last version in http://sourceforge.net/projects/avrub/.

The parameters in bootcfg.h is no problem, but it must same with PC software. You may try import bootcfg.h in AVRUBD.exe's option.


--

Best regard!

Shao ziyang
Shaoz...@126.com

--
You received this message because you are subscribed to the Google Groups "avrub" group.
To unsubscribe from this group and stop receiving emails from it, send an email to avrub+un...@googlegroups.com.
To post to this group, send email to av...@googlegroups.com.
Visit this group at http://groups.google.com/group/avrub.
For more options, visit https://groups.google.com/d/optout.


来自网易手机号码邮箱了解更多

Jacek Bolesta

unread,
Jan 6, 2015, 5:53:19 AM1/6/15
to av...@googlegroups.com
I'm using 5.1, of course i check application settings also try import without success.


--
You received this message because you are subscribed to a topic in the Google Groups "avrub" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/avrub/EOBPC6JlT5E/unsubscribe.
To unsubscribe from this group and all its topics, send an email to avrub+un...@googlegroups.com.

papax...@gmail.com

unread,
Apr 14, 2015, 12:47:18 PM4/14/15
to av...@googlegroups.com, jacek....@gmail.com
Hello!
Did you have any luck?
I am trying to use AVRUB on an atmega328 but I am having the exact same problem.
I think I have tried all possible combinations on the variables!

shaoziyang

unread,
Apr 14, 2015, 10:32:12 PM4/14/15
to av...@googlegroups.com
Hi,

what's the problem do you meet? I try AVRUB in arduino nano and atmega328 xplained mini, both work fine.




--

Best regard!

Shao ziyang
Shaoz...@126.com




来自 网易手机号码邮箱 -- 手机号码就是邮箱帐号,了解详情>

Manuel Costa

unread,
Apr 15, 2015, 5:40:21 AM4/15/15
to av...@googlegroups.com
Many thanks for your reply:)
It was a simple case of not defining the .text=0x3800 on the make file:) now it is working.
Many thanks for your help and for your contribution with this piece of software.

Best regards:
Manuel Costa (Portugal)


Reply all
Reply to author
Forward
0 new messages