<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
<link rel="self" type="application/atom+xml" href="http://forum.robosavvy.com/feed.php?f=5&amp;t=1213" />

<title>RoboSavvy Forum</title>
<subtitle>Robosavvy Forum: The largest online community of Humanoid Robot Builders</subtitle>
<link href="http://forum.robosavvy.com/index.php" />
<updated>2007-12-30T23:39:26+01:00</updated>

<author><name><![CDATA[RoboSavvy Forum]]></name></author>
<id>http://forum.robosavvy.com/feed.php?f=5&amp;t=1213</id>
<entry>
<author><name><![CDATA[limor]]></name></author>
<updated>2007-12-30T23:39:26+01:00</updated>
<published>2007-12-30T23:39:26+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=1213&amp;p=13116#p13116</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=1213&amp;p=13116#p13116"/>
<title type="html"><![CDATA[CM-5 Hello world in C]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=1213&amp;p=13116#p13116"><![CDATA[
There are a couple of C libraries for bioloid that have sanitized the original example.c from Robotis.<br /><br /><!-- m --><a class="postlink" href="http://robosavvy.com/site/index.php?option=com_openwiki&amp;Itemid=&amp;id=robotis_bioloid">http://robosavvy.com/site/index.php?opt ... is_bioloid</a><!-- m --><p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=2">limor</a> — Sun Dec 30, 2007 11:39 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[siempre.aprendiendo]]></name></author>
<updated>2007-12-29T14:05:10+01:00</updated>
<published>2007-12-29T14:05:10+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=1213&amp;p=13094#p13094</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=1213&amp;p=13094#p13094"/>
<title type="html"><![CDATA[CM-5 Hello world in C]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=1213&amp;p=13094#p13094"><![CDATA[
<blockquote><div><cite>Igga wrote:</cite><br />Hi,<br /><br />USB2dynamixel is working perfectly under Linux. <br />The program BRLTTY didnt allow the driver to work properly. <br />It is explained here: <br /><!-- m --><a class="postlink" href="http://www.ladyada.net/learn/arduino/lesson0-lin.html">http://www.ladyada.net/learn/arduino/lesson0-lin.html</a><!-- m --><br /></div></blockquote><br />Thanks!<br /><br />Which Linux distribution do you use?<br /><br /><blockquote><div><cite>Igga wrote:</cite><br />However my example.hex program is not working if i program the CM-5 under linux.<br /><br />Cheers!<br /></div></blockquote><br /><br />Humm, it's strange... which compiler/environment do you use? <a href="http://www.avrfreaks.net/wiki/index.php/Documentation:AVR_GCC" class="postlink">AVR GCC</a>?<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=698">siempre.aprendiendo</a> — Sat Dec 29, 2007 2:05 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Igga]]></name></author>
<updated>2007-12-29T12:16:02+01:00</updated>
<published>2007-12-29T12:16:02+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=1213&amp;p=13093#p13093</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=1213&amp;p=13093#p13093"/>
<title type="html"><![CDATA[CM-5 Hello world in C]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=1213&amp;p=13093#p13093"><![CDATA[
Hi,<br /><br />USB2dynamixel is working perfectly under Linux. <br />The program BRLTTY didnt allow the driver to work properly. <br />It is explained here: <br /><!-- m --><a class="postlink" href="http://www.ladyada.net/learn/arduino/lesson0-lin.html">http://www.ladyada.net/learn/arduino/lesson0-lin.html</a><!-- m --><br /><br />However my example.hex program is not working if i program the CM-5 under linux.<br /><br />Cheers!<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=791">Igga</a> — Sat Dec 29, 2007 12:16 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[siempre.aprendiendo]]></name></author>
<updated>2007-12-28T17:37:27+01:00</updated>
<published>2007-12-28T17:37:27+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=1213&amp;p=13083#p13083</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=1213&amp;p=13083#p13083"/>
<title type="html"><![CDATA[CM-5 Hello world in C]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=1213&amp;p=13083#p13083"><![CDATA[
<blockquote><div><cite>Igga wrote:</cite><br />Thank you friend,<br /><br />I understood my mistake. <br /><br />Could you help with two  more question:<br /><br />1) Did you change the rs232 interface part in the example program.<br />I tried to compile it as you suggested, but it showed many errors<br />related to interface. Linux has different communication procedure with the interface, right?<br /><br />Could you send the whole C code of your project?<br /><br />2) Is there a linux driver for usb2dynamixel?<br /><br /><br />Thank you and best wishes for the New Year!!<br /></div></blockquote><br /><br />There is no &quot;official&quot; linux driver for usb2dynamixel, but browsing the zip file contents I've found this URL:<br /><br /><a href="http://www.ftdichip.com/Documents/InstallGuides.htm" class="postlink">ftdichip InstallGuides.htm</a><br /><br />among other FTDI files, so I suppose the linux drivers from <a href="http://www.ftdichip.com/FTDrivers.htm" class="postlink">FTDI</a> should work...<br /><br />I don't have the usb2dynamixel, could you post your results? <img src="http://forum.robosavvy.com/images/smilies/icon_smile.gif" alt=":)" title="Smile" /><p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=698">siempre.aprendiendo</a> — Fri Dec 28, 2007 5:37 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Igga]]></name></author>
<updated>2007-12-28T16:23:27+01:00</updated>
<published>2007-12-28T16:23:27+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=1213&amp;p=13079#p13079</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=1213&amp;p=13079#p13079"/>
<title type="html"><![CDATA[CM-5 Hello world in C]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=1213&amp;p=13079#p13079"><![CDATA[
Thank you friend,<br /><br />I understood my mistake. <br /><br />Could you help with two  more question:<br /><br />1) Did you change the rs232 interface part in the example program.<br />I tried to compile it as you suggested, but it showed many errors<br />related to interface. Linux has different communication procedure with the interface, right?<br /><br />Could you send the whole C code of your project?<br /><br />2) Is there a linux driver for usb2dynamixel?<br /><br /><br />Thank you and best wishes for the New Year!!<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=791">Igga</a> — Fri Dec 28, 2007 4:23 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Marmakoide]]></name></author>
<updated>2007-12-28T15:41:41+01:00</updated>
<published>2007-12-28T15:41:41+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=1213&amp;p=13077#p13077</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=1213&amp;p=13077#p13077"/>
<title type="html"><![CDATA[CM-5 Hello world in C]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=1213&amp;p=13077#p13077"><![CDATA[
If by <span style="font-style: italic">terminal</span> you mean the <span style="font-style: italic">gtkterm</span> program, you're wrong. But if you mean a  Unix shell then you're right. The Unix terminal allow to run commands, and <span style="font-style: italic">gtkterm</span> is used to send and receive data from a serial port.<br /><br />Using the Makefile I posted should help too.[/i]<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=544">Marmakoide</a> — Fri Dec 28, 2007 3:41 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Igga]]></name></author>
<updated>2007-12-26T11:34:09+01:00</updated>
<published>2007-12-26T11:34:09+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=1213&amp;p=13042#p13042</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=1213&amp;p=13042#p13042"/>
<title type="html"><![CDATA[compilation]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=1213&amp;p=13042#p13042"><![CDATA[
Hi,<br /><br />How do you compile your project?<br />From the terminal?<br /><br />Thanks.<br /><br /><br /><blockquote><div><cite>Marmakoide wrote:</cite><br />Problem solved, seems to be a compiler flag order issue <img src="http://forum.robosavvy.com/images/smilies/icon_eek.gif" alt=":shock:" title="Shocked" /> <br /><br />Here it is the script I made to build my Linux/GCC cross-compiler<br /><dl class="codebox"><dt>Code: </dt><dd><code>#!/bin/bash<br /><br /># ----------------------------------------------------------------------------<br /># build-toolchain.sh $1<br />#<br /># $1 Where to install the tools<br />#<br /># Build a toolchain for the AVR Atmel GCC C compiler<br />#<br /># Based on the following docs :<br />#   http://lists.gnu.org/archive/html/avr-gcc-list/2006-08/msg00098.html<br /># ----------------------------------------------------------------------------<br /><br /><br />function download &#123;<br />  if &#91; ! -f $2 &#93;; then<br />    wget $1/$2<br /><br />    if &#91; &quot;$?&quot; -ne &quot;0&quot; &#93;; then<br />      echo &quot;Fail to download&quot; $2 &quot;at&quot; $1<br />      return 1<br />    fi<br />  fi<br />&#125;<br /><br /><br /># --- Init ---<br />BUILD_TMP=/tmp/<br />ORIGIN=`pwd`<br /><br />if &#91; &quot;$#&quot; -lt 1 &#93;; then<br />  echo &quot;No installation path specified&quot;<br />  return 1<br />fi<br /><br />INSTALL_PATH=$1<br /><br /><br /><br /># --- Get the packages to install from the net ---<br />download ftp://sourceware.org/pub/binutils/releases binutils-2.17.tar.bz2<br />download ftp://ftp.gnu.org/gnu/gcc/gcc-4.1.1 gcc-core-4.1.1.tar.bz2<br />download http://download.savannah.gnu.org/releases/avr-libc avr-libc-1.4.5.tar.bz2<br /><br /><br /><br /># --- Build the binutils ---<br />if &#91; ! -f $&#123;INSTALL_PATH&#125;/bin/avr-as &#93;; then<br />  cd $&#123;BUILD_TMP&#125;<br />  tar xjf $&#123;ORIGIN&#125;/binutils-2.17.tar.bz2<br />  cd binutils-2.17<br />  ./configure --target=avr \<br />              --prefix=$&#123;INSTALL_PATH&#125; \<br />              --disable-nls<br />  make<br />  make install<br />  cd $&#123;ORIGIN&#125;<br />  rm -rf $&#123;BUILD_TMP&#125;/binutils-2.17<br />fi<br /><br /><br /><br /># --- Build gcc ---<br />export PATH=$&#123;INSTALL_PATH&#125;/bin:$PATH<br /><br />if &#91; ! -f $&#123;INSTALL_PATH&#125;/bin/avr-gcc-4.1.1 &#93;; then<br />  cd $&#123;BUILD_TMP&#125;<br />  tar xjf $&#123;ORIGIN&#125;/gcc-core-4.1.1.tar.bz2<br />  cd gcc-4.1.1<br />  ./configure  --target=avr \<br />               --prefix=$&#123;INSTALL_PATH&#125; \<br />               --enable-languages=&quot;c&quot; \<br />               --disable-libssp \<br />               --disable-nls \<br />               --enable-clocale=gnu<br /><br />  #./configure  --target=avr \<br />  #             --prefix=$&#123;INSTALL_PATH&#125; \<br />  #             --enable-languages=c \<br />  #             --disable-libssp \<br />  #             --enable-__cxa_atexit \<br />  #             --enable-clocale=gnu \<br />  #             --disable-nls<br /><br />  make<br />  make check<br />  make install<br />  cd $&#123;ORIGIN&#125;<br />  rm -rf $&#123;BUILD_TMP&#125;/gcc-4.1.1<br />fi<br /><br /><br /><br /># --- Build the libc ---<br />if &#91; ! -f $&#123;INSTALL_PATH&#125;/avr/include/stdio.h &#93;; then<br />  cd $&#123;BUILD_TMP&#125;<br />  tar xjf $&#123;ORIGIN&#125;/avr-libc-1.4.5.tar.bz2<br />  cd avr-libc-1.4.5<br /><br />  ./configure --host=avr --prefix=$&#123;INSTALL_PATH&#125; CC=&quot;$INSTALL_PATH/bin/avr-gcc&quot;<br />  #./configure --build=`./config.guess` --host=avr --prefix=$&#123;INSTALL_PATH&#125;<br />  <br />  make<br />  make install<br />  cd $&#123;ORIGIN&#125;<br />  rm -rf $&#123;BUILD_TMP&#125;/avr-libc-1.4.5<br />fi<br /></code></dd></dl><br /><br />Here it is the Makefile that works<br /><dl class="codebox"><dt>Code: </dt><dd><code>TARGET=example<br /><br />GNU_AVR_PATH = /home/xxx/Bioloid/tools<br /><br />CC = $&#40;GNU_AVR_PATH&#41;/bin/avr-gcc<br />OBJCOPY = $&#40;GNU_AVR_PATH&#41;/bin/avr-objcopy<br /><br />OPTIM_LEVEL = s<br /><br />#<br /># Compiler flags<br />#<br />CFLAGS  = -g<br />CFLAGS += -O$&#40;OPTIM_LEVEL&#41;<br />CFLAGS += -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums<br />CFLAGS += -Wall -Wstrict-prototypes<br />CFLAGS += -std=gnu99<br /><br />OBJECTS =\<br />./Example.o<br /><br />LDFLAGS = <br /><br /><br />all: $&#40;TARGET&#41;.hex $&#40;TARGET&#41;.bin<br /><br />$&#40;TARGET&#41;.elf: $&#40;OBJECTS&#41;<br />   $&#40;CC&#41; -mmcu=atmega128 $&#40;LDFLAGS&#41; -o $@ $&#40;OBJECTS&#41;<br /><br />%.hex:%.elf<br />   $&#40;OBJCOPY&#41; -O ihex -R .eeprom $&lt; $@<br /><br />%.bin:%.elf<br />   $&#40;OBJCOPY&#41; -O binary -R .eeprom $&lt; $@<br />%.o:%.c<br />   $&#40;CC&#41; -mmcu=atmega128 $&#40;CFLAGS&#41; -o $@ -c $&lt;<br /><br />clean:<br />   rm -f $&#40;OBJECTS&#41;<br /><br />cleaner: clean<br />   rm -f $&#40;TARGET&#41;.elf \<br />                $&#40;TARGET&#41;.hex \<br />                $&#40;TARGET&#41;.bin<br /></code></dd></dl><br /><br />My procedure to upload a .bin executable to the CM-5 :<br />* lauching <span style="font-style: italic">gtkterm</span> (As minicom but with a more handy user interface)<br />* setting the connection to 57600 bauds, 1 stop bit, no parity bits, no stream control<br />* doing the <span style="font-style: italic">#-and-red-button</span> trick to enter in the bootloader (Matrix, here we come  <img src="http://forum.robosavvy.com/images/smilies/icon_lol.gif" alt=":lol:" title="Laughing" /> )<br />* typing <span style="font-style: italic">load</span> in the <span style="font-style: italic">gtkterm</span> shell<br />* sending my .bin file with the <span style="font-style: italic">gtkterm</span> ASCII file send functionality<br />* it's done, don't care about the CM-5 checksum complaints<br /></div></blockquote><p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=791">Igga</a> — Wed Dec 26, 2007 11:34 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Marmakoide]]></name></author>
<updated>2007-03-20T10:52:12+01:00</updated>
<published>2007-03-20T10:52:12+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=1213&amp;p=8127#p8127</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=1213&amp;p=8127#p8127"/>
<title type="html"><![CDATA[CM-5 Hello world in C]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=1213&amp;p=8127#p8127"><![CDATA[
Problem solved, seems to be a compiler flag order issue <img src="http://forum.robosavvy.com/images/smilies/icon_eek.gif" alt=":shock:" title="Shocked" /> <br /><br />Here it is the script I made to build my Linux/GCC cross-compiler<br /><dl class="codebox"><dt>Code: </dt><dd><code>#!/bin/bash<br /><br /># ----------------------------------------------------------------------------<br /># build-toolchain.sh $1<br />#<br /># $1 Where to install the tools<br />#<br /># Build a toolchain for the AVR Atmel GCC C compiler<br />#<br /># Based on the following docs :<br />#   http://lists.gnu.org/archive/html/avr-gcc-list/2006-08/msg00098.html<br /># ----------------------------------------------------------------------------<br /><br /><br />function download &#123;<br />  if &#91; ! -f $2 &#93;; then<br />    wget $1/$2<br /><br />    if &#91; &quot;$?&quot; -ne &quot;0&quot; &#93;; then<br />      echo &quot;Fail to download&quot; $2 &quot;at&quot; $1<br />      return 1<br />    fi<br />  fi<br />&#125;<br /><br /><br /># --- Init ---<br />BUILD_TMP=/tmp/<br />ORIGIN=`pwd`<br /><br />if &#91; &quot;$#&quot; -lt 1 &#93;; then<br />  echo &quot;No installation path specified&quot;<br />  return 1<br />fi<br /><br />INSTALL_PATH=$1<br /><br /><br /><br /># --- Get the packages to install from the net ---<br />download ftp://sourceware.org/pub/binutils/releases binutils-2.17.tar.bz2<br />download ftp://ftp.gnu.org/gnu/gcc/gcc-4.1.1 gcc-core-4.1.1.tar.bz2<br />download http://download.savannah.gnu.org/releases/avr-libc avr-libc-1.4.5.tar.bz2<br /><br /><br /><br /># --- Build the binutils ---<br />if &#91; ! -f $&#123;INSTALL_PATH&#125;/bin/avr-as &#93;; then<br />  cd $&#123;BUILD_TMP&#125;<br />  tar xjf $&#123;ORIGIN&#125;/binutils-2.17.tar.bz2<br />  cd binutils-2.17<br />  ./configure --target=avr \<br />              --prefix=$&#123;INSTALL_PATH&#125; \<br />              --disable-nls<br />  make<br />  make install<br />  cd $&#123;ORIGIN&#125;<br />  rm -rf $&#123;BUILD_TMP&#125;/binutils-2.17<br />fi<br /><br /><br /><br /># --- Build gcc ---<br />export PATH=$&#123;INSTALL_PATH&#125;/bin:$PATH<br /><br />if &#91; ! -f $&#123;INSTALL_PATH&#125;/bin/avr-gcc-4.1.1 &#93;; then<br />  cd $&#123;BUILD_TMP&#125;<br />  tar xjf $&#123;ORIGIN&#125;/gcc-core-4.1.1.tar.bz2<br />  cd gcc-4.1.1<br />  ./configure  --target=avr \<br />               --prefix=$&#123;INSTALL_PATH&#125; \<br />               --enable-languages=&quot;c&quot; \<br />               --disable-libssp \<br />               --disable-nls \<br />               --enable-clocale=gnu<br /><br />  #./configure  --target=avr \<br />  #             --prefix=$&#123;INSTALL_PATH&#125; \<br />  #             --enable-languages=c \<br />  #             --disable-libssp \<br />  #             --enable-__cxa_atexit \<br />  #             --enable-clocale=gnu \<br />  #             --disable-nls<br /><br />  make<br />  make check<br />  make install<br />  cd $&#123;ORIGIN&#125;<br />  rm -rf $&#123;BUILD_TMP&#125;/gcc-4.1.1<br />fi<br /><br /><br /><br /># --- Build the libc ---<br />if &#91; ! -f $&#123;INSTALL_PATH&#125;/avr/include/stdio.h &#93;; then<br />  cd $&#123;BUILD_TMP&#125;<br />  tar xjf $&#123;ORIGIN&#125;/avr-libc-1.4.5.tar.bz2<br />  cd avr-libc-1.4.5<br /><br />  ./configure --host=avr --prefix=$&#123;INSTALL_PATH&#125; CC=&quot;$INSTALL_PATH/bin/avr-gcc&quot;<br />  #./configure --build=`./config.guess` --host=avr --prefix=$&#123;INSTALL_PATH&#125;<br />  <br />  make<br />  make install<br />  cd $&#123;ORIGIN&#125;<br />  rm -rf $&#123;BUILD_TMP&#125;/avr-libc-1.4.5<br />fi<br /></code></dd></dl><br /><br />Here it is the Makefile that works<br /><dl class="codebox"><dt>Code: </dt><dd><code>TARGET=example<br /><br />GNU_AVR_PATH = /home/xxx/Bioloid/tools<br /><br />CC = $&#40;GNU_AVR_PATH&#41;/bin/avr-gcc<br />OBJCOPY = $&#40;GNU_AVR_PATH&#41;/bin/avr-objcopy<br /><br />OPTIM_LEVEL = s<br /><br />#<br /># Compiler flags<br />#<br />CFLAGS  = -g<br />CFLAGS += -O$&#40;OPTIM_LEVEL&#41;<br />CFLAGS += -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums<br />CFLAGS += -Wall -Wstrict-prototypes<br />CFLAGS += -std=gnu99<br /><br />OBJECTS =\<br />./Example.o<br /><br />LDFLAGS = <br /><br /><br />all: $&#40;TARGET&#41;.hex $&#40;TARGET&#41;.bin<br /><br />$&#40;TARGET&#41;.elf: $&#40;OBJECTS&#41;<br />   $&#40;CC&#41; -mmcu=atmega128 $&#40;LDFLAGS&#41; -o $@ $&#40;OBJECTS&#41;<br /><br />%.hex:%.elf<br />   $&#40;OBJCOPY&#41; -O ihex -R .eeprom $&lt; $@<br /><br />%.bin:%.elf<br />   $&#40;OBJCOPY&#41; -O binary -R .eeprom $&lt; $@<br />%.o:%.c<br />   $&#40;CC&#41; -mmcu=atmega128 $&#40;CFLAGS&#41; -o $@ -c $&lt;<br /><br />clean:<br />   rm -f $&#40;OBJECTS&#41;<br /><br />cleaner: clean<br />   rm -f $&#40;TARGET&#41;.elf \<br />                $&#40;TARGET&#41;.hex \<br />                $&#40;TARGET&#41;.bin<br /></code></dd></dl><br /><br />My procedure to upload a .bin executable to the CM-5 :<br />* lauching <span style="font-style: italic">gtkterm</span> (As minicom but with a more handy user interface)<br />* setting the connection to 57600 bauds, 1 stop bit, no parity bits, no stream control<br />* doing the <span style="font-style: italic">#-and-red-button</span> trick to enter in the bootloader (Matrix, here we come  <img src="http://forum.robosavvy.com/images/smilies/icon_lol.gif" alt=":lol:" title="Laughing" /> )<br />* typing <span style="font-style: italic">load</span> in the <span style="font-style: italic">gtkterm</span> shell<br />* sending my .bin file with the <span style="font-style: italic">gtkterm</span> ASCII file send functionality<br />* it's done, don't care about the CM-5 checksum complaints<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=544">Marmakoide</a> — Tue Mar 20, 2007 10:52 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Marmakoide]]></name></author>
<updated>2007-03-16T17:49:27+01:00</updated>
<published>2007-03-16T17:49:27+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=1213&amp;p=8082#p8082</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=1213&amp;p=8082#p8082"/>
<title type="html"><![CDATA[CM-5 Hello world in C]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=1213&amp;p=8082#p8082"><![CDATA[
I'am trying to program the CM- in C, with a Linux environment.<br /><br />I was able to compile a GCC toolchain for ATMega128 with :<br />  * binutils-2.17<br />  * avr-libc-1.4.4<br />  * gcc-4.1.1<br /><br />I was able to compile the <span style="font-style: italic">Example.c</span> from Robotis, uploading it, and playing it. It works fine.<br /><br />Now, I'am trying to remove as much I can from <span style="font-style: italic">Example.c</span> to just put a 'Hello world' on the RobotTerminal. My main function is simply the following code<br /><dl class="codebox"><dt>Code: </dt><dd><code>int main&#40;void&#41;<br />&#123; <br />  byte bCount,bID, bTxPacketLength,bRxPacketLength;<br />  <br />  PortInitialize&#40;&#41;; //Port In/Out Direction Definition<br />  RS485_RXD; //Set RS485 Direction to Input State.<br />  SerialInitialize&#40;SERIAL_PORT0,1,RX_INTERRUPT&#41;;//RS485 Initializing&#40;RxInterrupt&#41;<br />  SerialInitialize&#40;SERIAL_PORT1,DEFAULT_BAUD_RATE,0&#41;; //RS232 Initializing&#40;None Interrupt&#41;<br />  <br />  gbRxBufferReadPointer = gbRxBufferWritePointer = 0;  //RS485 RxBuffer Clearing.<br /><br />  sei&#40;&#41;;  //Enable Interrupt -- Compiler Function<br />  TxDString&#40;&quot;\r\n Hello from the CM-5 !\r\n&quot;&#41;; <br />  while&#40;1&#41;;<br />&#125;<br /></code></dd></dl><br /><br />No suprises, it works. But if I remove the function <span style="font-style: italic">void PrintBaudrate(void)</span> or <span style="font-style: italic">[void PrintBuffer(byte *bpPrintBuffer, byte bLength)/i], that are not used by [i]main()</span>, then the programm doesn't display &quot;Hello from the CM-5 !&quot;.<br />Removing <span style="font-style: italic">void PrintBaudrate(void)</span> -&gt; Just &quot;o&quot; is displayed<br />Removing [i][void PrintBuffer(byte *bpPrintBuffer, byte bLength)/i] -&gt; Just &quot;o from the CM-5 !&quot; is displayed<br /><br />Here it my Makefile<br /><dl class="codebox"><dt>Code: </dt><dd><code>GNU_AVR_PATH=/home/marmakoide/Bioloid/tools<br /><br />CC=$&#40;GNU_AVR_PATH&#41;/bin/avr-gcc<br />OBJCOPY=$&#40;GNU_AVR_PATH&#41;/bin/avr-objcopy<br />CFLAGS=-O2 -mmcu=atmega128 -Wall<br /><br />OBJECTS=\<br />./Example.o<br /><br />TARGET=example<br /><br /><br />all: $&#40;TARGET&#41;.hex $&#40;TARGET&#41;.bin<br /><br />$&#40;TARGET&#41;.elf: $&#40;OBJECTS&#41;<br />   $&#40;CC&#41; -o $@ $&#40;OBJECTS&#41;<br /><br />%.hex:%.elf<br />   $&#40;OBJCOPY&#41; --output-target ihex -R .eeprom $&lt; $@<br /><br />%.bin:%.elf<br />   $&#40;OBJCOPY&#41; --output-target binary -R .eeprom $&lt; $@<br />%.o:%.c<br />   $&#40;CC&#41; $&#40;CFLAGS&#41; $&#40;INCLUDES&#41; -o $@ -c $&lt;<br /><br />clean:<br />   rm -f $&#40;OBJECTS&#41;<br /><br />cleaner: clean<br />   rm -f $&#40;TARGET&#41;.elf $&#40;TARGET&#41;.hex $&#40;TARGET&#41;.bin<br /></code></dd></dl><br /><br />Is it because the new program is shorther than the older, and when uploading, the new is written over the older ?<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=544">Marmakoide</a> — Fri Mar 16, 2007 5:49 pm</p><hr />
]]></content>
</entry>
</feed>