Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
chrislego88
PostPosted: Jul 01, 2010 - 04:18 PM
Newbie


Joined: Jun 23, 2010
Posts: 15


clawson wrote:

If it gets to 0x0000 and there's a JMP there then how could it possibly fail to execute it? Are you saying that if you single step the JMP it doesn't then jump over the vector table to the start of the C pre-amble. That surely could only occur if the JMP was actually a "JMP 0x0000" so just keeps jumping back to itself? So what is the offset of the JMP shown in the disassembler?


Code:
124:               asm("jmp 0"::);
+000104FA:   940C0000    JMP       0x00000000     Jump

That is what the disassembler shows. It jumps to that address. It follows all the commands in the vector and C pre-amble commands. What I am saying is that my program doesn't start running, unless I do a manual reset.
 
 View user's profile Send private message  
Reply with quote Back to top
angelu
PostPosted: Jul 01, 2010 - 07:56 PM
Resident


Joined: May 28, 2006
Posts: 716
Location: Toronto, Canada

It sounds you didn't bring the I/O registers to default state.

Why you don't use software reset instead ?

George.

_________________
www.sofgel.ro bootloader for mega and xmega
www.elsofgel.com XME development board
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
chrislego88
PostPosted: Jul 01, 2010 - 08:28 PM
Newbie


Joined: Jun 23, 2010
Posts: 15


I found out the problem. My bootloader is using interrupts and I forgot that I had to move the ISRs to the boot section, so I had to move them back to the application section before I could use them in my program in application section.
 
 View user's profile Send private message  
Reply with quote Back to top
szaro102
PostPosted: Jul 22, 2010 - 12:28 PM
Newbie


Joined: Feb 17, 2003
Posts: 7


I try to write bootloader to xmega128, but i don't konw how to restore default I/O setings.
I can enter to bootloder and exit using 'asm ("jmp 0");' but after this all I/O have some value (last value from bootloder aplication) it's normal? Please tell me, when bootloader will make jump to aplication section i must do something more than 'asm ("jmp 0");' ?
 
 View user's profile Send private message  
Reply with quote Back to top
clawson
PostPosted: Jul 22, 2010 - 12:35 PM
10k+ Postman


Joined: Jul 18, 2005
Posts: 62345
Location: (using avr-gcc in) Finchingfield, Essex, England

You force a watchdog reset and then when it restarts you recognize that the reset reason was watchdog and then enter the app (this is complicated a little further if the app itself may use the watchdog!). This, amongst many things is explained in the bootloader FAQ in the Tutorial Forum.

(BTW why did you hijack an xmega thread - your question has nothing to do with xmega. If you were determined to hijack a thread then why not at least pick one that mentioned both "bootloader" and "atmega128"? (rhetorical))

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits