Using this bootloader in atmega168

172 views
Skip to first unread message

Sompse

unread,
Jun 10, 2009, 1:36:56 AM6/10/09
to avrub
Hello

I have try and try to load this bootloader to atmega 168 but cannot
get it working like it should.

Problem is when is configure avr studio memory segment ""flash .text
0x1c00"" now when loading bootloader code into chip atmega is not
doing anything but if i configure memory segment ""flash .bootloader
0x1c00"" then i get that status led blinking (#define
LEDPORTNo PB4) but it is blinking all the time and not only
when booting up the chip?

Also question about bootcfg.h setting,is this correct for atmega168?
#define BootStart 2* 0x1C00UL

I'm testing this with int 8mhz clock and stk500


管理员

unread,
Jun 10, 2009, 3:03:40 AM6/10/09
to avrub
Does you set correct fuse bits? If BOOTRST, BOOTSZ fuse bits is not
set, it is will not run correct.

You may try configurate bootcfg.h use "autocde" in avrubd.exe, it will
create parameters automatically, and also creae a batch file
avrub.bat, run avrub.bat it will call winavr to compile avrub.

Default project is configurate for ATmega169(Butterfly), with same
flash size, so it is same for ATmage168.

Yan C T

unread,
Jun 10, 2009, 9:50:59 AM6/10/09
to av...@googlegroups.com
Hi,
I have successfully done it for atmega168 with 16mhz xtal, but that was sometimes ago.
Yes, I have used #define BootStart 2*1C00UL and it works.
I am attaching the bootcfg.h which I have used and hope it will work for you.
I will be happy to help if I can, however, I consider myself a newbie and
my 2 cents' worth may not amount to much.
Do you want the Bootldr.hex?
rgds



--- On Wed, 10/6/09, Sompse <seppo....@netikka.fi> wrote:

> From: Sompse <seppo....@netikka.fi>
> Subject: Using this bootloader in atmega168
> To: "avrub" <av...@googlegroups.com>
> Date: Wednesday, 10 June, 2009, 1:36 PM
>
> Hello
>
> I have try and try to load this bootloader to atmega 168
> but cannot
> get it working like it should.
>
> Problem is when is configure avr studio memory segment
> ""flash .text
> 0x1c00"" now when loading  bootloader code into chip
> atmega is not
> doing anything but if i configure memory
> segment   ""flash .bootloader
> 0x1c00"" then i get that status led blinking (#define
> LEDPORTNo          PB4) but it is
> blinking all the time and not only
> when booting up the chip?
>
> Also question about bootcfg.h setting,is this correct for
> atmega168?
> #define BootStart       
>    2* 0x1C00UL
>
> I'm testing this with int 8mhz clock and stk500
>
>
>
> >
>


Get your new Email address!
Grab the Email name you&#39;ve always wanted before someone else does!
http://mail.promotions.yahoo.com/newdomains/sg/
bootcfg.h
Message has been deleted

Sompse

unread,
Jun 10, 2009, 3:38:53 AM6/10/09
to avrub
Hello

Fuse bits should be correct.

Boot flash size =1024 start address = $1C00 This in my avr studio
settings
BootRST selected.

Is there any specific order when that fuse bit bootRSt should be set i
meen should it be set before loading bootloader.hex or after
bootloader.hex

I have try that auto code and it is creating exactly same code what i
have manually made.
But i think that my AVR studio memory settings are not correct
flash .bootloader 0x1c00 (is this correct or does it matter what is
the name??)
flash .text 0x1c00

Thanks for fast answer.

Seppo

Sompse

unread,
Jun 11, 2009, 3:48:54 AM6/11/09
to avrub
Here is my settings what i have used.

I have try many ways but i cannot get to run.

If i configure avr studio memory segment like it is show in internet
forums
""flash .text 0x1c00"" i cannot get any kind of connection to rs232
and bootloader status led is not blinking on any situation.

but if i configure ""flash .bootloader 0x1c00"" then i get bootloader
status led blinking and i remove from bootcfg.h chipcheck option i
can load with avrub something to chip but it allways stay in
bootloader and never start application.

Is there any other bootloader for atmega168 ??

I will try to include picture of my setting.

Sompse

unread,
Jun 15, 2009, 7:01:32 AM6/15/09
to avrub
I think i found what as the main problem. I was missing avr studio sp1
update there was some boorloader bug fix and now i'm able to get that
bootloader to in my chip but new problem... my application is not
executed after firts reset.

管理员

unread,
Jun 15, 2009, 9:28:21 AM6/15/09
to avrub
I don't dont which version of WinAVR you are using, I feel
WinAVR20071225 is the best stable version, you may try it if
possible.
Reply all
Reply to author
Forward
0 new messages