<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=big5">
<META content="MSHTML 6.00.2800.1141" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=795235012-19042003>Hi
Danny,</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=795235012-19042003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=795235012-19042003>I
added some code in the beginning of the bootloader to check the reset vector of
thr NUT. Depending on the state of the MCUSR register the program either
starts the bootloader or jumps to addres 0x0000.</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=795235012-19042003>I
noticed that in case of a regular power down of the ethernut both bit one and
two will be set, while using the reset button only bit two is set, as
expected.</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=795235012-19042003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=795235012-19042003>Happy
Hacking !</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=795235012-19042003>/Lars</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=795235012-19042003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=795235012-19042003>#define RESET_VECTOR 2<BR></SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=795235012-19042003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=795235012-19042003>int
main(void)<BR>{<BR> u_char mode;</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=795235012-19042003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN class=795235012-19042003>
/*<BR> * Reset vector is stored and reset. <BR>
*/<BR> mode = inp( MCUSR );<BR> outp( 0 , MCUSR );<BR>
<BR> /*<BR> * If MCUSR corresponds to what is
defined, the bootloading<BR> * proces is continued. Otherwise
jump to the applicaton.<BR> */<BR> if((mode != RESET_VECTOR)
&& (mode != 0))<BR> asm volatile("jmp
0");</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=795235012-19042003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=795235012-19042003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=795235012-19042003>....</SPAN></FONT></DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=795235012-19042003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=795235012-19042003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=795235012-19042003></SPAN></FONT> </DIV>
<DIV><FONT face=Arial color=#0000ff size=2><SPAN
class=795235012-19042003>}</SPAN></FONT></DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B> danny-pouyuen
[mailto:danny.lu@pouyuen.com.tw]<BR><B>Sent:</B> den 16 april 2003
11:07<BR><B>To:</B> en-nut-discussion@egnite.de<BR><B>Subject:</B>
[En-Nut-Discussion] bootloader?<BR><BR></FONT></DIV>
<DIV><FONT size=2>I have study ethernut bootloader and want to make sure if it
have to download firmware every time while ethernut power up? or it is
determined by user when he want to remote update the firmware?</FONT></DIV>
<DIV><FONT size=2>Best Regard<BR>Danny Lu <BR>Pou-Yuen Tech. Inc.<BR>TEL:
886-4-23580345 #310<BR>FAX: 886-4-23580333<BR><A
href="mailto:danny.lu@pouyuen.com.tw"><FONT
color=#000000>danny.lu@pouyuen.com.tw</FONT></A></FONT></DIV></BLOCKQUOTE></BODY></HTML>