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

CM510 firmware upload with one click for Windows

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

CM510 firmware upload with one click for Windows

Post by Fraser » Tue Nov 30, 2010 3:07 pm

Post by Fraser
Tue Nov 30, 2010 3:07 pm

edit: changed thread title (again)

Hello All,

First of all my compliments to all of your great work on this forum, I really enjoy reading it.:D

I am about to start writing for the CM510 and AX12+ (ATMEGA2561 and ATMEGA8).

Before I start writing in earnest I want to set up my development environment to be as sweet as possible; I will be using VisualStudio2010 for its code complete functions (IMHO: necessary in larger c++ projects) and adding some postbuild commands to do hex2bin and then squirt the new BIN into the CM510. So it will be like AVR studio but with all the cool features of VS2010.

I would really like a wireless connection between my PC and CM510 to negate the need to have a cable to upload new .bin to CM510.

My question is, have any of your good selves looked at doing this, perhaps you could save me a few hours by giving me a heads up. For example:

[1]
Could the ZIG110 module pair supplied in the BioloidPremium kit be used?

[2]
Would it require a new bootloader for the ATMEGA2561?

[3]
Would some minor HW hack be necessary?

edit:
I think I have answered my above questions.
[1]:yes, but it will require a zig2serial board
[2]:no
[3]:no
edit: changed thread title (again)

Hello All,

First of all my compliments to all of your great work on this forum, I really enjoy reading it.:D

I am about to start writing for the CM510 and AX12+ (ATMEGA2561 and ATMEGA8).

Before I start writing in earnest I want to set up my development environment to be as sweet as possible; I will be using VisualStudio2010 for its code complete functions (IMHO: necessary in larger c++ projects) and adding some postbuild commands to do hex2bin and then squirt the new BIN into the CM510. So it will be like AVR studio but with all the cool features of VS2010.

I would really like a wireless connection between my PC and CM510 to negate the need to have a cable to upload new .bin to CM510.

My question is, have any of your good selves looked at doing this, perhaps you could save me a few hours by giving me a heads up. For example:

[1]
Could the ZIG110 module pair supplied in the BioloidPremium kit be used?

[2]
Would it require a new bootloader for the ATMEGA2561?

[3]
Would some minor HW hack be necessary?

edit:
I think I have answered my above questions.
[1]:yes, but it will require a zig2serial board
[2]:no
[3]:no
Last edited by Fraser on Sat Dec 18, 2010 1:09 am, edited 6 times in total.
Fraser
Savvy Roboteer
Savvy Roboteer
Posts: 84
Joined: Tue Nov 30, 2010 2:16 pm

Post by Fraser » Tue Nov 30, 2010 4:55 pm

Post by Fraser
Tue Nov 30, 2010 4:55 pm

OK, after looking at ZIG-100/110 docs:

http://support.robotis.com/en/product/a ... manual.htm

I think it can appear like a bi-dierectional serial line interfacing straight to the ATMEGAs UART. I will try and set the baud rate to max zigbee speed of 250kbps which makes binary upload around 30kB per second, not too painful, less than 10 seconds for full 256kB progmem. Of course I'll need to use a zig2serial board and the USB2Dynamixel as a serial port because my laptop only has USB.

One other thought: with this configuration it would also be possible to upload BIN to any or all attached AX12 as well if a pass through function was written into CM510 which did the necessary # sends and other chars necessary to awaken the ATMEGA8 bootloader before squirting in the BIN. This would require some 2way protocol because ATMEGA2561 RAM couldn't hold all the BIN for ATMEGA8.

Maybe this has all been covered before, but I couldn't find it. Bioloid sure is a versatile system, an ATMEGA8 in each servo is very nice.
OK, after looking at ZIG-100/110 docs:

http://support.robotis.com/en/product/a ... manual.htm

I think it can appear like a bi-dierectional serial line interfacing straight to the ATMEGAs UART. I will try and set the baud rate to max zigbee speed of 250kbps which makes binary upload around 30kB per second, not too painful, less than 10 seconds for full 256kB progmem. Of course I'll need to use a zig2serial board and the USB2Dynamixel as a serial port because my laptop only has USB.

One other thought: with this configuration it would also be possible to upload BIN to any or all attached AX12 as well if a pass through function was written into CM510 which did the necessary # sends and other chars necessary to awaken the ATMEGA8 bootloader before squirting in the BIN. This would require some 2way protocol because ATMEGA2561 RAM couldn't hold all the BIN for ATMEGA8.

Maybe this has all been covered before, but I couldn't find it. Bioloid sure is a versatile system, an ATMEGA8 in each servo is very nice.
Fraser
Savvy Roboteer
Savvy Roboteer
Posts: 84
Joined: Tue Nov 30, 2010 2:16 pm

Post by Fritzoid » Tue Nov 30, 2010 8:44 pm

Post by Fritzoid
Tue Nov 30, 2010 8:44 pm

CM-510 bootloader operates at one speed only, 56 Kbs! Faster ZIGBEE won't be recognized.

AX-12 bootloader operates at same speed.

CM-510 dynamixel bus would have to operate at 56 Kbs to upload firmware to the AX-12. (difficult but not impossible).

Plus I doubt that the CM-510 firmware will get around to sending ##'s in time for the servo bootloader to be satisfied.

I'll stick with the USB2Dynamixel for servo firmware upgrades!
CM-510 bootloader operates at one speed only, 56 Kbs! Faster ZIGBEE won't be recognized.

AX-12 bootloader operates at same speed.

CM-510 dynamixel bus would have to operate at 56 Kbs to upload firmware to the AX-12. (difficult but not impossible).

Plus I doubt that the CM-510 firmware will get around to sending ##'s in time for the servo bootloader to be satisfied.

I'll stick with the USB2Dynamixel for servo firmware upgrades!
Fritzoid
Savvy Roboteer
Savvy Roboteer
User avatar
Posts: 331
Joined: Mon Dec 18, 2006 1:00 am

Post by Fraser » Tue Nov 30, 2010 11:08 pm

Post by Fraser
Tue Nov 30, 2010 11:08 pm

Fritzoid wrote:CM-510 bootloader operates at one speed only, 56 Kbs! Faster ZIGBEE won't be recognized.

AX-12 bootloader operates at same speed.

CM-510 dynamixel bus would have to operate at 56 Kbs to upload firmware to the AX-12. (difficult but not impossible).


Thanks for the info. OK, so bootloader is fixed at same speed as the working bus which is set low so as not to hog clock cycles.

Fritzoid wrote:Plus I doubt that the CM-510 firmware will get around to sending ##'s in time for the servo bootloader to be satisfied.

I'll stick with the USB2Dynamixel for servo firmware upgrades!


So the AX12 has to RX ##'s within a certain time after reset due to poweron and the CM-510 will not have had time to initialise, RX the CMD and send the ##'s. Looks like my WIFI development pipe dreams can go on hold for the time being.

I will drop into your embedded C thread, because that is what I am mainly interested in, writing new CM510 (and probably AX12) firmware.
Fritzoid wrote:CM-510 bootloader operates at one speed only, 56 Kbs! Faster ZIGBEE won't be recognized.

AX-12 bootloader operates at same speed.

CM-510 dynamixel bus would have to operate at 56 Kbs to upload firmware to the AX-12. (difficult but not impossible).


Thanks for the info. OK, so bootloader is fixed at same speed as the working bus which is set low so as not to hog clock cycles.

Fritzoid wrote:Plus I doubt that the CM-510 firmware will get around to sending ##'s in time for the servo bootloader to be satisfied.

I'll stick with the USB2Dynamixel for servo firmware upgrades!


So the AX12 has to RX ##'s within a certain time after reset due to poweron and the CM-510 will not have had time to initialise, RX the CMD and send the ##'s. Looks like my WIFI development pipe dreams can go on hold for the time being.

I will drop into your embedded C thread, because that is what I am mainly interested in, writing new CM510 (and probably AX12) firmware.
Last edited by Fraser on Thu Dec 16, 2010 11:16 pm, edited 1 time in total.
Fraser
Savvy Roboteer
Savvy Roboteer
Posts: 84
Joined: Tue Nov 30, 2010 2:16 pm

Post by Fraser » Thu Dec 16, 2010 11:01 pm

Post by Fraser
Thu Dec 16, 2010 11:01 pm

I have almost finished writing a small windoze app to make firmware dev a little faster.

Once hand configured it can be incorporated into a toolchain using command line arg "-AUTO". The app remembers the last settings in a small ini file in the app directory.

It all works fine:

Loads .hex
Performs Hex2Bin (verified against standard hex2bin)
Opens port at 57600 8N1
Sends # stream
Waits for CM510 "Boot loader" reply
(power cycle CM510 to get here)
Sends "LD" command
Waits for CM510 "Ready.." reply

THEN PROBLEM:
Tries to send the raw BIN and after first byte gets reply:
Error
Rewriting:0X0000
Size:0X00000001 Checksum:00-0A


Anyone been here before and can tell me what I'm doing wrong, if not I'll have to try and spy on the serial line somehow to see what the robotis terminal is actually sending after the CM510 sends "Ready.."

Image
P.S. This app when completed will be free for all to download.
I have almost finished writing a small windoze app to make firmware dev a little faster.

Once hand configured it can be incorporated into a toolchain using command line arg "-AUTO". The app remembers the last settings in a small ini file in the app directory.

It all works fine:

Loads .hex
Performs Hex2Bin (verified against standard hex2bin)
Opens port at 57600 8N1
Sends # stream
Waits for CM510 "Boot loader" reply
(power cycle CM510 to get here)
Sends "LD" command
Waits for CM510 "Ready.." reply

THEN PROBLEM:
Tries to send the raw BIN and after first byte gets reply:
Error
Rewriting:0X0000
Size:0X00000001 Checksum:00-0A


Anyone been here before and can tell me what I'm doing wrong, if not I'll have to try and spy on the serial line somehow to see what the robotis terminal is actually sending after the CM510 sends "Ready.."

Image
P.S. This app when completed will be free for all to download.
Fraser
Savvy Roboteer
Savvy Roboteer
Posts: 84
Joined: Tue Nov 30, 2010 2:16 pm

Post by Fraser » Fri Dec 17, 2010 12:00 am

Post by Fraser
Fri Dec 17, 2010 12:00 am

Sit tight folks, my problem may be answered in this thread:
http://robosavvy.org/forum/viewtopic.php?p=6304

edit:
No it wasn't my problem was different: I ended up sniffing the port while running RoboPlus Terminal.

Things I needed to correct:

Needed to send "\rLD\r", I was sending "LD\r\n"
Added checksum byte onto the end of BIN

It works fine now, also added option to start running code as soon as upload finished using "\rGO\r" command.

I will link to the .exe tomorrow, time to sleep now.
Sit tight folks, my problem may be answered in this thread:
http://robosavvy.org/forum/viewtopic.php?p=6304

edit:
No it wasn't my problem was different: I ended up sniffing the port while running RoboPlus Terminal.

Things I needed to correct:

Needed to send "\rLD\r", I was sending "LD\r\n"
Added checksum byte onto the end of BIN

It works fine now, also added option to start running code as soon as upload finished using "\rGO\r" command.

I will link to the .exe tomorrow, time to sleep now.
Fraser
Savvy Roboteer
Savvy Roboteer
Posts: 84
Joined: Tue Nov 30, 2010 2:16 pm

Post by Fraser » Fri Dec 17, 2010 1:29 pm

Post by Fraser
Fri Dec 17, 2010 1:29 pm

The application can be downloaded here:

http://www.ledset.com/bioloid/apps/FirmUp_V101.zip

Any bugs or suggestions, let me know.

Image
The application can be downloaded here:

http://www.ledset.com/bioloid/apps/FirmUp_V101.zip

Any bugs or suggestions, let me know.

Image
Fraser
Savvy Roboteer
Savvy Roboteer
Posts: 84
Joined: Tue Nov 30, 2010 2:16 pm

Post by Fraser » Fri Dec 17, 2010 7:25 pm

Post by Fraser
Fri Dec 17, 2010 7:25 pm

OK, so now I will set about making a template project for visual Studio by importing an AVRStudio makefile, the project will just be a simple LED chaser for CM510 .

The idea is that using the FirmUp app in auto mode Visual Studio will allow the user to just hit <CTRL> and the code will compile, link and then the user will just have to press the red MODE button and then new firmware will be uploaded and begin execution.

This saves time usually spent with terminal sending #s, selecting file etc.
OK, so now I will set about making a template project for visual Studio by importing an AVRStudio makefile, the project will just be a simple LED chaser for CM510 .

The idea is that using the FirmUp app in auto mode Visual Studio will allow the user to just hit <CTRL> and the code will compile, link and then the user will just have to press the red MODE button and then new firmware will be uploaded and begin execution.

This saves time usually spent with terminal sending #s, selecting file etc.
Fraser
Savvy Roboteer
Savvy Roboteer
Posts: 84
Joined: Tue Nov 30, 2010 2:16 pm


8 postsPage 1 of 1
8 postsPage 1 of 1