OpenServo.com Forum Index OpenServo.com
Discussion of the OpenServo project
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

OpenServo v2.1 Bootloader Problem

 
Post new topic   Reply to topic    OpenServo.com Forum Index -> Software
View previous topic :: View next topic  
Author Message
mpthompson



Joined: 02 Jan 2006
Posts: 650
Location: San Carlos, CA

PostPosted: Thu May 11, 2006 6:32 am    Post subject: OpenServo v2.1 Bootloader Problem Reply with quote

I needed to update the bootloader on my OpenServo v2.1 PCB and ran smack into a problem. It appears that the ATmega168, unlike the ATtiny45, differentiates what code executing in different parts of the Flash memory can do. It appears the ATmega168 only allows self programming the flash via the SPM instruction when executing from the Boot Loader Section -- currently set by fuse bits to the upper 1024 words in memory. Code executing in the application portion of Flash cannot update the contents of the Flash.

Hmmm. This defeats my current mechanism of updating the bootloader by creating a special version of the bootloader that runs as an application to update the bootloader portion of Flash memory. I really don't want to have to disassemble a servo to update the bootloader.

The solution I'm going to try to attempt is to take advantage of the fact that the MCU thinks the bootloader occupies the upper 2048 bytes (1024 words) of Flash memory, but my bootloader actually only occupies the upper 1024 bytes. I should be able to squeeze in a temporary bootloader into the lower 1024 bytes that can program the actual bootloader Flash memory.

I'll cross my fingers and hope this strategy works.

-Mike
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
mpthompson



Joined: 02 Jan 2006
Posts: 650
Location: San Carlos, CA

PostPosted: Thu May 11, 2006 7:58 am    Post subject: Reply with quote

OK, I stayed up late and resolved the bootloader issues along the lines described. The new ATmegaX bootloader code is checked into CVS. I noticed I don't have documentation on how to compile a special version of the bootloader so that it can update itself on the servo.

-Mike
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    OpenServo.com Forum Index -> Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group