[En-Nut-Discussion] bootloader?

Lars Andersson laran at ikp.liu.se
Sat Apr 19 15:20:54 CEST 2003

Hi Danny,
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.
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.
Happy Hacking !
#define RESET_VECTOR 2

int main(void)
  u_char mode;
   * Reset vector is stored and reset. 
  mode = inp( MCUSR );
  outp( 0 , MCUSR );
   * If MCUSR corresponds to what is defined, the bootloading
   * proces is continued. Otherwise jump to the applicaton.
  if((mode != RESET_VECTOR) && (mode != 0))
    asm volatile("jmp 0");

-----Original Message-----
From: danny-pouyuen [mailto:danny.lu at pouyuen.com.tw]
Sent: den 16 april 2003 11:07
To: en-nut-discussion at egnite.de
Subject: [En-Nut-Discussion] bootloader?

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?
Best Regard
Danny Lu 
Pou-Yuen Tech. Inc.
TEL: 886-4-23580345 #310
FAX: 886-4-23580333
 <mailto:danny.lu at pouyuen.com.tw> danny.lu at pouyuen.com.tw

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.egnite.de/pipermail/en-nut-discussion/attachments/20030419/14271918/attachment.html>

More information about the En-Nut-Discussion mailing list