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

I think I bricked my CM5.

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

I think I bricked my CM5.

Post by billyzelsnack » Tue Feb 06, 2007 5:19 am

Post by billyzelsnack
Tue Feb 06, 2007 5:19 am

Geez. I have not had any opportunity to work on this stuff for a week. Not 2 minutes in tonight and I think I bricked my CM5.

I uploaded a new hex program I quickly wrote to test some stuff and when I hit reset after I uploaded the hex, it printed out something like..

Jumped to 0x00000

What's that all about?

I tried to reset with #'s and resets, but nothing.

Here's the program..

Code: Select all
while(1)
   {
      for( ii=0; ii<18; ii++ )
      {
         if( ii!=5 ){continue;}
         if( ( ii==4 ) || (ii==6) ){continue;}
         
         bID=ii;
         
         gbpParameter[0] = 0; //Reading Address
         gbpParameter[1] = 49; //Read Length
         bTxPacketLength = TxPacket(bID,INST_READ,2);
         bRxPacketLength = RxPacket(DEFAULT_RETURN_PACKET_SIZE+gbpParameter[1]);         
   
         if(rawPacketLength!=0)
         {
            writeRawPacketToPC(bRxPacketLength, gbpRxBuffer);
         }
      }
   }



After looking at the code I notice the obvious bug that it will never write any data to PC, so it basically just sits in a tight loop getting data from servo 5. Still, I should be able to access the bootloader shouldn't I?

Any ideas on solutions to fix this? I really wanted to get it working without having to add any extra hardware, but I highly doubt that I will throw out $50 on another CM5. I'll just go ahead, build an interface cable, and talk to the servos directly now I guess.
Geez. I have not had any opportunity to work on this stuff for a week. Not 2 minutes in tonight and I think I bricked my CM5.

I uploaded a new hex program I quickly wrote to test some stuff and when I hit reset after I uploaded the hex, it printed out something like..

Jumped to 0x00000

What's that all about?

I tried to reset with #'s and resets, but nothing.

Here's the program..

Code: Select all
while(1)
   {
      for( ii=0; ii<18; ii++ )
      {
         if( ii!=5 ){continue;}
         if( ( ii==4 ) || (ii==6) ){continue;}
         
         bID=ii;
         
         gbpParameter[0] = 0; //Reading Address
         gbpParameter[1] = 49; //Read Length
         bTxPacketLength = TxPacket(bID,INST_READ,2);
         bRxPacketLength = RxPacket(DEFAULT_RETURN_PACKET_SIZE+gbpParameter[1]);         
   
         if(rawPacketLength!=0)
         {
            writeRawPacketToPC(bRxPacketLength, gbpRxBuffer);
         }
      }
   }



After looking at the code I notice the obvious bug that it will never write any data to PC, so it basically just sits in a tight loop getting data from servo 5. Still, I should be able to access the bootloader shouldn't I?

Any ideas on solutions to fix this? I really wanted to get it working without having to add any extra hardware, but I highly doubt that I will throw out $50 on another CM5. I'll just go ahead, build an interface cable, and talk to the servos directly now I guess.
billyzelsnack
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 618
Joined: Sat Dec 30, 2006 1:00 am

Post by billyzelsnack » Tue Feb 06, 2007 5:33 am

Post by billyzelsnack
Tue Feb 06, 2007 5:33 am

Turns out I forgot that I had up'd the baud rate to 115k, but I didn't connect at that in the robot terminal. Thought the checksum did match when I uploaded the hex. (probably just a local checksum.)

So now that I have robot terminal connect at 115k I get a continuous stream of..

[Error:RxD Timeout]

With still no success on a reset.

Next I wrote a little program to spit '#' writes at the serial port. I have it print them out as is goes. When I hit the reset button on the CM5 it does block the write and my printing pauses, so something is going on, but still... I can't get into the bootloader. doh.

btw. That [Error:RxD Timeout] is coming from the RxPacket call in the example.c that I am using.
Turns out I forgot that I had up'd the baud rate to 115k, but I didn't connect at that in the robot terminal. Thought the checksum did match when I uploaded the hex. (probably just a local checksum.)

So now that I have robot terminal connect at 115k I get a continuous stream of..

[Error:RxD Timeout]

With still no success on a reset.

Next I wrote a little program to spit '#' writes at the serial port. I have it print them out as is goes. When I hit the reset button on the CM5 it does block the write and my printing pauses, so something is going on, but still... I can't get into the bootloader. doh.

btw. That [Error:RxD Timeout] is coming from the RxPacket call in the example.c that I am using.
billyzelsnack
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 618
Joined: Sat Dec 30, 2006 1:00 am

Post by billyzelsnack » Tue Feb 06, 2007 6:05 am

Post by billyzelsnack
Tue Feb 06, 2007 6:05 am

I noticed that I didn't even have servo 5 plugged into the CM5. I plug it in and I start getting responses back. They even change as I move the servo. I bet if I read out the packets they could be actual packets.

Too bad I still can't get it to reset. I guess the loop is too tight?

I also tried the update CM5 option from the behavior tool, but it won't even connect.

It seems like there is hope, it's alive, just too alive!

How's everyone liking the play-by-play. haha.
I noticed that I didn't even have servo 5 plugged into the CM5. I plug it in and I start getting responses back. They even change as I move the servo. I bet if I read out the packets they could be actual packets.

Too bad I still can't get it to reset. I guess the loop is too tight?

I also tried the update CM5 option from the behavior tool, but it won't even connect.

It seems like there is hope, it's alive, just too alive!

How's everyone liking the play-by-play. haha.
billyzelsnack
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 618
Joined: Sat Dec 30, 2006 1:00 am

Post by pepperm » Tue Feb 06, 2007 9:19 am

Post by pepperm
Tue Feb 06, 2007 9:19 am

The play by play is fun to watch, not the least because I know exactly how you feel and have done the same myself.

2 points though. Firstly, the bootloader should still be there, it's hard to overwrite (I hope) and secondly, no loop is too tight for a reset. Reset is a hardware function and will stop anything, unless you disable the pin. Power cycling does a reset.

I can't remember the process for getting back into the boot loader off of the top of my head but it does work and is in the manual, somewhere.

Mark
The play by play is fun to watch, not the least because I know exactly how you feel and have done the same myself.

2 points though. Firstly, the bootloader should still be there, it's hard to overwrite (I hope) and secondly, no loop is too tight for a reset. Reset is a hardware function and will stop anything, unless you disable the pin. Power cycling does a reset.

I can't remember the process for getting back into the boot loader off of the top of my head but it does work and is in the manual, somewhere.

Mark
pepperm
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 190
Joined: Sat Jul 01, 2006 1:00 am

Post by billyzelsnack » Tue Feb 06, 2007 2:44 pm

Post by billyzelsnack
Tue Feb 06, 2007 2:44 pm

I've been able to enter the bootloader many, many times in the past with the '#' sequence + reset. That not working now is what worries me.
I've been able to enter the bootloader many, many times in the past with the '#' sequence + reset. That not working now is what worries me.
billyzelsnack
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 618
Joined: Sat Dec 30, 2006 1:00 am

Post by Bullit » Tue Feb 06, 2007 11:42 pm

Post by Bullit
Tue Feb 06, 2007 11:42 pm

Make sure you set you baud rate in the robot terminal to 56k, then hold the # and click the reset. The bootloader always operates at 56k. You have to use spi to overwrite the bootloader.
Make sure you set you baud rate in the robot terminal to 56k, then hold the # and click the reset. The bootloader always operates at 56k. You have to use spi to overwrite the bootloader.
Bullit
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 291
Joined: Wed May 31, 2006 1:00 am
Location: Near robot

Post by billyzelsnack » Wed Feb 07, 2007 3:48 am

Post by billyzelsnack
Wed Feb 07, 2007 3:48 am

I tried messing with the baud rate. I think the bootloader will work at 56k or 115k because I'm pretty sure I've uploaded many hex files since I switched to 115k.

Anyway. I did try again with other baud rates. Same thing. I'm guessing I'll have to program it via some sort of hardware programmer route. Robotis didn't disable that capability did they?

I wonder if I can talk to the bootloader over the zigbee ttl port.
I tried messing with the baud rate. I think the bootloader will work at 56k or 115k because I'm pretty sure I've uploaded many hex files since I switched to 115k.

Anyway. I did try again with other baud rates. Same thing. I'm guessing I'll have to program it via some sort of hardware programmer route. Robotis didn't disable that capability did they?

I wonder if I can talk to the bootloader over the zigbee ttl port.
billyzelsnack
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 618
Joined: Sat Dec 30, 2006 1:00 am

Post by Bullit » Wed Feb 07, 2007 5:42 am

Post by Bullit
Wed Feb 07, 2007 5:42 am

I've disassembled the bootloader. USART1H is set to 0 and USART1L is set to 0x22 which is 57.6k baud. The only way you could program at another baud rate is if you have a bluetooth connection then the bluetooth would take care of the baud rate translation and the CM5 would only see the baud rate set at the bluetooth module on the CM5 side which would have to be 57.6k. To get into the boot loader the # must be sent at 57.6k baud otherwise if eeprom address 0xfff is not 0xff it will just jump to the application reset vector.

The boot block is protected from accidental erasure by fuse bits which are set to only allow the boot block to be reprogrammed via SPI. The boot block cannot be overwritten via serial port and the fuse bits cannot be changed via the serial port.

I hope this helps.
I've disassembled the bootloader. USART1H is set to 0 and USART1L is set to 0x22 which is 57.6k baud. The only way you could program at another baud rate is if you have a bluetooth connection then the bluetooth would take care of the baud rate translation and the CM5 would only see the baud rate set at the bluetooth module on the CM5 side which would have to be 57.6k. To get into the boot loader the # must be sent at 57.6k baud otherwise if eeprom address 0xfff is not 0xff it will just jump to the application reset vector.

The boot block is protected from accidental erasure by fuse bits which are set to only allow the boot block to be reprogrammed via SPI. The boot block cannot be overwritten via serial port and the fuse bits cannot be changed via the serial port.

I hope this helps.
Bullit
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 291
Joined: Wed May 31, 2006 1:00 am
Location: Near robot

Post by billyzelsnack » Wed Feb 07, 2007 5:59 am

Post by billyzelsnack
Wed Feb 07, 2007 5:59 am

Ok. I'll try a bit more.

btw. It doesn't beep anymore when I turn it on. I think it always beeped before even with my custom programs.
Ok. I'll try a bit more.

btw. It doesn't beep anymore when I turn it on. I think it always beeped before even with my custom programs.
billyzelsnack
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 618
Joined: Sat Dec 30, 2006 1:00 am

Post by billyzelsnack » Sun Feb 11, 2007 6:29 pm

Post by billyzelsnack
Sun Feb 11, 2007 6:29 pm

So that not beeping thing was a.. didn't have my sx1 plugged in thing. haha.
So that not beeping thing was a.. didn't have my sx1 plugged in thing. haha.
billyzelsnack
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 618
Joined: Sat Dec 30, 2006 1:00 am


10 postsPage 1 of 1
10 postsPage 1 of 1