Legacy Forum: Preserving Nearly 20 Years of Community History - A Time Capsule of Discussions, Memories, and Shared Experiences.

Entering into the bootloader

Bioloid robot kit from Korean company Robotis; CM5 controller block, AX12 servos..
7 postsPage 1 of 1
7 postsPage 1 of 1

Entering into the bootloader

Post by billyzelsnack » Sun Jan 21, 2007 12:04 am

Post by billyzelsnack
Sun Jan 21, 2007 12:04 am

For a little bit I thought that my serial code was broke as I was not getting what I expected from the sniff I did last week..

http://robosavvy.com/modules.php?name=F ... 9&start=21

I was expecting to receive 02 02 02 back from my *** send, but I was getting 0's.

I figured out what was going on. In response to a *** send you wil receive back the current mode of the CM5.

00 00 00 = manage
01 01 01 = program
02 02 02 = play

After I realized that I was able to send the sequence of 50 #'s. If you keep sending them and you send them fast enough you will finally enter int bootloader.

Woo.. Great. Now I can make send my programs an not require the user to hit reset.

Nope.

I put one of my programs on the CM5 and I could not get it to go to the
bootloader. I also don't get back a response to the *** sequence. That's not so bad and kinda expected, but I really want to be able to enter the bootloader without hitting reset.
For a little bit I thought that my serial code was broke as I was not getting what I expected from the sniff I did last week..

http://robosavvy.com/modules.php?name=F ... 9&start=21

I was expecting to receive 02 02 02 back from my *** send, but I was getting 0's.

I figured out what was going on. In response to a *** send you wil receive back the current mode of the CM5.

00 00 00 = manage
01 01 01 = program
02 02 02 = play

After I realized that I was able to send the sequence of 50 #'s. If you keep sending them and you send them fast enough you will finally enter int bootloader.

Woo.. Great. Now I can make send my programs an not require the user to hit reset.

Nope.

I put one of my programs on the CM5 and I could not get it to go to the
bootloader. I also don't get back a response to the *** sequence. That's not so bad and kinda expected, but I really want to be able to enter the bootloader without hitting reset.
billyzelsnack
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 618
Joined: Sat Dec 30, 2006 1:00 am

Post by billyzelsnack » Sun Jan 21, 2007 5:16 am

Post by billyzelsnack
Sun Jan 21, 2007 5:16 am

Well.. I think I am stuck now. I am thinking that the default firmware has some special way to enter the bootloader. I have no way of snooping on that.

So I guess I am going to have to live with a semi-automatic process. One that keeps sending the '#' and then asks you to go hit the reset button.

Kinda lame, but it'll work for now.
Well.. I think I am stuck now. I am thinking that the default firmware has some special way to enter the bootloader. I have no way of snooping on that.

So I guess I am going to have to live with a semi-automatic process. One that keeps sending the '#' and then asks you to go hit the reset button.

Kinda lame, but it'll work for now.
billyzelsnack
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 618
Joined: Sat Dec 30, 2006 1:00 am

Post by billyzelsnack » Sun Jan 21, 2007 5:35 am

Post by billyzelsnack
Sun Jan 21, 2007 5:35 am

hmm.. Maybe I could use the watchdog reset timer. I need to read up more on it though.
hmm.. Maybe I could use the watchdog reset timer. I need to read up more on it though.
billyzelsnack
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 618
Joined: Sat Dec 30, 2006 1:00 am

Post by billyzelsnack » Sun Jan 21, 2007 6:13 pm

Post by billyzelsnack
Sun Jan 21, 2007 6:13 pm

Anyone know of a better way to programatically reset an Atmega? I'm a little weary of enabling the watchdog. Seems like a good way to maybe brick my CM5.

Here's what I am thinking.

Pretty much before I do anything I call wdt_disable() to make sure it is off and that I don't get into a loop that I can't get out off. Maybe it's off by default after a reset, but why risk that.

Then when I want to reset I call I function like this..

void reset()
{
wdt_enable(WDTO_250MS);
while(1)
{
}
}

Now the big question is if this will pop me into the bootloader if I've already been sending a lot #'s or if it'll just reset completely.
Anyone know of a better way to programatically reset an Atmega? I'm a little weary of enabling the watchdog. Seems like a good way to maybe brick my CM5.

Here's what I am thinking.

Pretty much before I do anything I call wdt_disable() to make sure it is off and that I don't get into a loop that I can't get out off. Maybe it's off by default after a reset, but why risk that.

Then when I want to reset I call I function like this..

void reset()
{
wdt_enable(WDTO_250MS);
while(1)
{
}
}

Now the big question is if this will pop me into the bootloader if I've already been sending a lot #'s or if it'll just reset completely.
billyzelsnack
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 618
Joined: Sat Dec 30, 2006 1:00 am

Post by billyzelsnack » Tue Jan 23, 2007 6:40 am

Post by billyzelsnack
Tue Jan 23, 2007 6:40 am

I just gave up on this for now. I didn't want to risk bricking my CM5.

I also gave up on my debugging message protocol from the CM5. It was turning more complicated than what I wanted to debug!

So I went back to what I was doing before and I appear to have it working. The API is still what I posted in a previous thread.

Over the next few days I'll play around with it and if it is behaving I'll post what I have.
I just gave up on this for now. I didn't want to risk bricking my CM5.

I also gave up on my debugging message protocol from the CM5. It was turning more complicated than what I wanted to debug!

So I went back to what I was doing before and I appear to have it working. The API is still what I posted in a previous thread.

Over the next few days I'll play around with it and if it is behaving I'll post what I have.
billyzelsnack
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 618
Joined: Sat Dec 30, 2006 1:00 am

Post by i-Bot » Tue Jan 23, 2007 12:35 pm

Post by i-Bot
Tue Jan 23, 2007 12:35 pm

I still do not know much about the CM5

Can you not just jump to location 0xF000 where the bootloader is located ?
I still do not know much about the CM5

Can you not just jump to location 0xF000 where the bootloader is located ?
i-Bot
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 1142
Joined: Wed May 17, 2006 1:00 am

Post by billyzelsnack » Tue Jan 23, 2007 3:15 pm

Post by billyzelsnack
Tue Jan 23, 2007 3:15 pm

I have no idea. I don't know much at all about micro-controllers in general. I have plenty of ideas of how things 'could' work, but that doesn't usually match reality. haha.

I also am terrible at searching for help with micro-controller questions. I just don't have the required niche keyword vocabulary for it yet to find ever find what I want.
I have no idea. I don't know much at all about micro-controllers in general. I have plenty of ideas of how things 'could' work, but that doesn't usually match reality. haha.

I also am terrible at searching for help with micro-controller questions. I just don't have the required niche keyword vocabulary for it yet to find ever find what I want.
billyzelsnack
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 618
Joined: Sat Dec 30, 2006 1:00 am


7 postsPage 1 of 1
7 postsPage 1 of 1