<?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=970" />

<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>2008-10-10T15:26:08+01:00</updated>

<author><name><![CDATA[RoboSavvy Forum]]></name></author>
<id>http://forum.robosavvy.com/feed.php?f=5&amp;t=970</id>
<entry>
<author><name><![CDATA[bootstrap]]></name></author>
<updated>2008-10-10T15:26:08+01:00</updated>
<published>2008-10-10T15:26:08+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=970&amp;p=17850#p17850</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=970&amp;p=17850#p17850"/>
<title type="html"><![CDATA[Avrdude problems...]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=970&amp;p=17850#p17850"><![CDATA[
<blockquote><div><cite>StuartL wrote:</cite><br />Have you ever wondered where the line is when you say &quot;Do you know what, I should stop messing with things I don't understand?&quot;<br /></div></blockquote><br /><br />I completely agree with you,it is my mistake.I am sincerely sorry about it<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=1153">bootstrap</a> — Fri Oct 10, 2008 3:26 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[StuartL]]></name></author>
<updated>2008-10-10T09:39:08+01:00</updated>
<published>2008-10-10T09:39:08+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=970&amp;p=17844#p17844</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=970&amp;p=17844#p17844"/>
<title type="html"><![CDATA[Avrdude problems...]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=970&amp;p=17844#p17844"><![CDATA[
<blockquote><div><cite>bootstrap wrote:</cite><br /><blockquote><div><cite>StuartL wrote:</cite>http://robosavvy.com/forum/viewtopic.php?p=17416&amp;highlight=rom<br /></div></blockquote><br />Before dumping in ,I first tried to tune some of my Atmega8 to 16Mhz,I ended up messing with the fuse bits and both the Atmega8 stopped responding.Could you please tell me the exact fuse settings (lfuse and fuse) for the Atmega8</div></blockquote><br /><br />Have you ever wondered where the line is when you say &quot;Do you know what, I should stop messing with things I don't understand?&quot;<br /><br />I think you crossed this line a few weeks ago.<br /><br />By reading the ATmega8 PDF we got the fuse bits right first time.  I don't doubt that anyone can make mistakes, even a few in a row (just look at some of my posts for evidence), but it's becoming apparent that you're disassembling, tinkering and breaking things you don't fully understand.  My patience in helping you out in the forums and via PM is severely limited when you're demonstrating a severe unwillingness to read read read like the rest of us have done to get it right.<br /><br />The documentation is there.  The fuse bits are there.  If you don't understand the brown out detector, the difference between a low power oscillator and a full swing oscillator then it's time to read more PDFs, google a bit and maybe even build a test circuit on some veroboard to check your fuse bit settings and firmware before you break more AX12s.<br /><br />I'm sure myself, and most other people here, would be much more willing (and able!) to help if instead of breaking something you said:<br /><br /><blockquote class="uncited"><div><br />I've found this link on the net which has these fuse bits for an AX12 with a 16MHz oscillator and they look right but they've got these bits for the brown out detector and it doesn't look right for a 5v part.  When I tested these bits on my development board this happened and then I found this link which showed that bit number 1 was wrong.  I don't understand why, can anyone help?<br /></div></blockquote><br /><br />To recover your AX12s you'll need to either write or recover the bootloader, program the bootloader and application, set the fuse bits to boot from bootloader with a 16MHz external crystal and you probably want the brown out detector enabled.  And all of this from the SPI pins.<br /><br />If you've installed the fuse bits so wrong that the SPI programming pins no longer work you're screwed unless you want to strip the chip off the board and build a parallel programmer.  I know this because we had to do it.<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=645">StuartL</a> — Fri Oct 10, 2008 9:39 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[bootstrap]]></name></author>
<updated>2008-10-09T08:52:43+01:00</updated>
<published>2008-10-09T08:52:43+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=970&amp;p=17832#p17832</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=970&amp;p=17832#p17832"/>
<title type="html"><![CDATA[Avrdude problems...]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=970&amp;p=17832#p17832"><![CDATA[
<blockquote><div><cite>StuartL wrote:</cite><br />http://robosavvy.com/forum/viewtopic.php?p=17416&amp;highlight=rom<br /></div></blockquote><br />Before dumping in ,I first tried to tune some of my Atmega8 to 16Mhz,I ended up messing with the fuse bits and both the Atmega8 stopped responding.Could you please tell me the exact fuse settings (lfuse and fuse) for the Atmega8<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=1153">bootstrap</a> — Thu Oct 09, 2008 8:52 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[StuartL]]></name></author>
<updated>2008-10-09T07:54:24+01:00</updated>
<published>2008-10-09T07:54:24+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=970&amp;p=17830#p17830</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=970&amp;p=17830#p17830"/>
<title type="html"><![CDATA[Avrdude problems...]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=970&amp;p=17830#p17830"><![CDATA[
<!-- m --><a class="postlink" href="http://robosavvy.com/forum/viewtopic.php?p=17416&amp;highlight=rom">http://robosavvy.com/forum/viewtopic.ph ... hlight=rom</a><!-- m --><p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=645">StuartL</a> — Thu Oct 09, 2008 7:54 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[bootstrap]]></name></author>
<updated>2008-10-08T05:42:26+01:00</updated>
<published>2008-10-08T05:42:26+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=970&amp;p=17820#p17820</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=970&amp;p=17820#p17820"/>
<title type="html"><![CDATA[Avrdude problems...]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=970&amp;p=17820#p17820"><![CDATA[
<blockquote><div><cite>Bullit wrote:</cite><br />Just send the hex file as text.  Its not XModem or ZModem.  Its not compressed at all its just a text file.  If you want to use avrdude you need to replace the bootloader which requires adding wires to the cm-5 to access the spi port to erase the ATMega128 (bootloader fuse is write locked).  Bear in mind the bioloid application uses the bootloader to save poses to the flash so changing the bootloader will break the boiloid application as well.<br /></div></blockquote><br /><br />I have a AX-12 ,I dint buy a CM-5.In my experimentation I erased the code in the AX-12.After that the power LED was always on (like here ,where the CM-5 was stuck in the bootloader).I copied the hex from another AX-12 which was working and tried dumping it using the STK500v2 USB programmer.But it dint work.Now the other working AX-12 got damaged (I wired it up the reverse way and fumes came from it).<br /><br />Is there a way that I can dump this firmware for AX-12 <br />(given here:<br /><a href="http://www.tribotix.info/Downloads/Robotis/Dynamixels/DXL_AX12_REV0x16_20060518_LD.rom" class="postlink">http://www.tribotix.info/Downloads/Robotis/Dynamixels/DXL_AX12_REV0x16_20060518_LD.rom</a> and get the AX-12 working back?<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=1153">bootstrap</a> — Wed Oct 08, 2008 5:42 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Marmakoide]]></name></author>
<updated>2007-08-14T02:23:17+01:00</updated>
<published>2007-08-14T02:23:17+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=970&amp;p=10374#p10374</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=970&amp;p=10374#p10374"/>
<title type="html"><![CDATA[Avrdude problems...]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=970&amp;p=10374#p10374"><![CDATA[
Well, <span style="font-style: italic">gtkterm</span> does the same job as <span style="font-style: italic">minicom</span>, but with a better graphical interface, maybe you could try it. In my case, I made a my own CM5 uploader (Linux, but should work with OSX) because I was fed up of the '#' stuff, you just have to type <span style="font-style: italic">CM5-upload -i foo.bin</span>, then to press the red button and it upload. <br /><br />Here it is the way I setup the serial port and I trigger the bootloader :<br /><br /><dl class="codebox"><dt>Code: </dt><dd><code>#include &lt;stdlib&gt;<br />#include &lt;termios&gt;<br />#include &lt;unistd&gt;<br />#include &lt;errno&gt;<br />#include &lt;sys&gt;<br />#include &lt;sys&gt;<br />#include &lt;fcntl&gt;<br />#include &lt;string&gt;<br />#include &lt;stdio&gt;<br /><br /><br /><br />typedef struct &#123;<br />  struct termios previousState;<br />  int fileId;<br />&#125; SerialPort;<br /><br /><br /><br />int<br />SerialPort_init&#40;SerialPort* inPort, const char* inName&#41; &#123;<br />  struct termios lNewState;<br /><br />  /* Open the serial port */<br />  inPort-&gt;fileId = open&#40;inName, O_RDWR | O_NOCTTY | O_NDELAY&#41;;<br />  if &#40;inPort-&gt;fileId &lt;0&gt;fileId, &amp;&#40;inPort-&gt;previousState&#41;&#41;;<br /><br />  /* Set the state needed to perform a com with the CM5<br />   * 57600 bauds<br />   * 8 bits per word<br />   * 1 stop bit<br />   * no parity bits<br />   * no stream control<br />   */<br />  memset&#40;&amp;lNewState, 0, sizeof&#40;struct termios&#41;&#41;;<br /><br />  lNewState.c_cflag = B57600 | CS8 | CLOCAL | CREAD;<br />  lNewState.c_iflag = IGNPAR | ICRNL;<br />  lNewState.c_oflag = 0;<br />  lNewState.c_lflag = 0;<br />  lNewState.c_cc&#91;VTIME&#93; = 0;<br />  lNewState.c_cc&#91;VMIN&#93; = 1;<br /><br />  /* Set the port to our state */<br />  tcsetattr&#40;inPort-&gt;fileId, TCSANOW, &amp;lNewState&#41;;<br />  tcflush&#40;inPort-&gt;fileId, TCOFLUSH&#41;;<br />  tcflush&#40;inPort-&gt;fileId, TCIFLUSH&#41;;<br /><br />  /* Job done */<br />  return 1;<br />&#125;<br /><br /><br />void<br />SerialPort_dispose&#40;SerialPort* inPort&#41; &#123;<br />  if &#40;inPort-&gt;fileId != -1&#41; &#123;<br />    /* Set the port to previous state */<br />    tcsetattr&#40;inPort-&gt;fileId, TCSANOW, &amp;&#40;inPort-&gt;previousState&#41;&#41;;<br />    tcflush&#40;inPort-&gt;fileId, TCOFLUSH&#41;;<br />    tcflush&#40;inPort-&gt;fileId, TCIFLUSH&#41;;<br /><br />    /* Close the port */<br />    close&#40;inPort-&gt;fileId&#41;;<br />    inPort-&gt;fileId = -1;<br />  &#125;<br />&#125;<br /><br /><br /><br />#define BUFFER_SIZE 256<br /><br /><br /><br />void<br />SerialPort_enterCM5Bootloader&#40;SerialPort* inPort&#41; &#123;<br />  int lNbBytesRead, lNbBytesWrite;<br />  char lBuffer&#91;BUFFER_SIZE&#93;;<br />  int lEntered;<br /><br />  lEntered = 0;<br />  lNbBytesWrite = 0;<br />  while&#40;!lEntered&#41; &#123;<br />    memset&#40;lBuffer, '\0', BUFFER_SIZE&#41;;<br />    lBuffer&#91;0&#93; = '#';<br /><br />    lNbBytesWrite = 0;<br />    do &#123;<br />      lNbBytesWrite = SerialPort_write&#40;inPort, lBuffer, 1&#41;;<br />    &#125; while&#40;errno != EAGAIN&#41;;<br />    usleep&#40;10000&#41;;<br /><br />    lNbBytesRead = SerialPort_read&#40;inPort, lBuffer, BUFFER_SIZE - 1&#41;;<br />    if &#40;lNbBytesRead &gt; 0&#41; &#123;<br />      if &#40;strncmp&#40;lBuffer, &quot;\n\n\n SYSTEM O.K. &#40;CM5 Boot loader&quot;, 24&#41; == 0&#41;<br />        lEntered = 1;<br />    &#125;<br />  &#125;<br />&#125;<br /></code></dd></dl><p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=544">Marmakoide</a> — Tue Aug 14, 2007 2:23 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Sascha77]]></name></author>
<updated>2007-08-13T15:08:48+01:00</updated>
<published>2007-08-13T15:08:48+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=970&amp;p=10367#p10367</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=970&amp;p=10367#p10367"/>
<title type="html"><![CDATA[Download using minicom on Mac OS X  / Linux]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=970&amp;p=10367#p10367"><![CDATA[
I've tried using minicom on Mac OS X to download c-programs as described above. Whereas it is no problem to activate and use the bootloader, I have not managed to transfer the binaries correctly. I hope,  someone can help me with this problem (should be the same problem using Linux): <br /><br />I've used minicom -s to setup the serial port as described by the user guide and Marmakoide above: 57600 Baud, 8N1, no hardware flow control, no software flow control.<br /><br />The problems occured when I tried to download the <span style="font-weight: bold">binary</span> program (e.g. example.bin): using the ascii protocol the minicom reported only 1.1 KB of the 3.3 KB to be transfered. I've tried several settings of ascii-xfr (use minicom -s to change settings of &quot;file transfer protocols&quot;): with or without line-end translation (option -n) and with control-d or control-z as end-of-file character (option -e / -d). Nothing worked correctly. When I use ascii-xfr to pipe the original binary into another file (ascii-xfr -sv[dne] example.bin &gt; copy.bin) I noticed that the files actually are different.<br /><br />I then tried my own &quot;transfer protocol&quot;. I added the following short program to minicom's transfer protocols:<br /><br /><dl class="codebox"><dt>Code: </dt><dd><code>#include &lt;stdio&gt;<br /><br />int main&#40;int argc, char *argv&#91;&#93;&#41; &#123;<br />  FILE* in;<br />  in = fopen&#40;argv&#91;1&#93;, &quot;r&quot;&#41;;<br />  <br />  fprintf&#40;stderr, &quot;Start transfering %s. &quot;, argv&#91;1&#93;&#41;;<br />  char c;<br />  int count = 1;<br />  while &#40;fread&#40;&amp;c, sizeof&#40;char&#41;, 1, in&#41;&#41; &#123;<br />    printf&#40;&quot;%c&quot;,c&#41;;<br />    usleep&#40;2000&#41;;<br />    if &#40;count++%1024==0&#41; fprintf&#40;stderr, &quot;.&quot;&#41;; // print a dot every kb <br />  &#125;<br />  <br />  fclose&#40;in&#41;;<br />  fprintf&#40;stderr,&quot;Done.&quot;&#41;;<br />  return 1;<br />&#125;<br /></code></dd></dl><br /><br />I've verified &quot;bcat example.bin &gt; copy.bin&quot; to produce an exact copy of the original file. When I use this program to load the example.bin into the CM-5 with the minicom, the bootlader just hangs after the transmission. Pressing any keys does not help. After disconnecting and reconnecting to the Bioloid and entering the bootloader again (#+red button), I had a look at the contents of the flash memory. Actually, the program was partially uploaded (actually the file-end is there, but in the wrong place)but not in the correct order. The download seems to start correctly, but always something wents wrong later on: either the CM-5 misses some big parts between the correct file start and the correct file ending or already transfered content gets overwritten with the end of the program.<br /><br />I've played around a little bit with the usleep after each character: the delay makes a difference. With some settings the first 400 or so bytes are correct and than there is a discontinuity (several hundred bytes missing), with other settings there are only 3 bytes in the correct order. Repeating with the same delay always produces the same memory content in the CM-5. But longer delays do not result in a later disconitinuity.<br /><br />Does someone have a clue, how to resolve this problem or where to look at next? For me, it would be really great to understand what's going wrong here exactly and to have minicom working.<br /><br />But for the time being I have a workaround:<br /><br />1. Use minicom to enter the boot loader and start the file transfer by entering &quot;load&quot;<br />2. Without quitting minicom simply cat the binary file directly to the device using another console. For me this is &quot;cat example.bin &gt; /dev/tty.KeySerial1   (using a Keyspan USA-19QW).<br /><br />In the minicom the CM-5 reports the correct file size and the example.bin works as expected. Simple!<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=703">Sascha77</a> — Mon Aug 13, 2007 3:08 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Marmakoide]]></name></author>
<updated>2007-03-20T07:37:09+01:00</updated>
<published>2007-03-20T07:37:09+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=970&amp;p=8125#p8125</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=970&amp;p=8125#p8125"/>
<title type="html"><![CDATA[Avrdude problems...]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=970&amp;p=8125#p8125"><![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 7:37 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[billyzelsnack]]></name></author>
<updated>2007-03-20T04:52:59+01:00</updated>
<published>2007-03-20T04:52:59+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=970&amp;p=8124#p8124</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=970&amp;p=8124#p8124"/>
<title type="html"><![CDATA[Avrdude problems...]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=970&amp;p=8124#p8124"><![CDATA[
Does it print anything out at all?<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=459">billyzelsnack</a> — Tue Mar 20, 2007 4:52 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[billyzelsnack]]></name></author>
<updated>2007-03-20T04:40:55+01:00</updated>
<published>2007-03-20T04:40:55+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=970&amp;p=8123#p8123</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=970&amp;p=8123#p8123"/>
<title type="html"><![CDATA[Avrdude problems...]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=970&amp;p=8123#p8123"><![CDATA[
Does it print anything out at all?<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=459">billyzelsnack</a> — Tue Mar 20, 2007 4:40 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Marmakoide]]></name></author>
<updated>2007-03-19T17:40:45+01:00</updated>
<published>2007-03-19T17:40:45+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=970&amp;p=8117#p8117</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=970&amp;p=8117#p8117"/>
<title type="html"><![CDATA[Avrdude problems...]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=970&amp;p=8117#p8117"><![CDATA[
Hi all<br /><br />I'am trying to upload a program into the CM-5 from Linux. What I'am doing now :<br />   * Compiling the C program (The Robotis Example.c) into binary file<br />   * Using <span style="font-style: italic">gtkterm</span>, similar to <span style="font-style: italic">minicom</span>. I set the connection to 57600 bauds, 8 bits, no parity bit, one control bit, no stream control.<br />   * Entering in the bootloader with the <span style="font-style: italic">#-and-red-button</span> trick.<br />   * Sending the <span style="font-style: italic">load</span> command<br />   * Sending my binary file.<br /><br />When I do that, the program is stuck after my first keypress. The orignal Robotis binary works fine, but not mine. Here it is my make file :<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 />What's wrong ?<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=544">Marmakoide</a> — Mon Mar 19, 2007 5:40 pm</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[billyzelsnack]]></name></author>
<updated>2007-01-19T05:54:58+01:00</updated>
<published>2007-01-19T05:54:58+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=970&amp;p=6304#p6304</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=970&amp;p=6304#p6304"/>
<title type="html"><![CDATA[Avrdude problems...]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=970&amp;p=6304#p6304"><![CDATA[
Ok. I got something hacked together. I've transferred back and forth between my .hex files and the bioloid .hex file. I still am using robot terminal get it into bootloader mode. I'll add that in a little bit as well as clean up my code. Here's the function I have so far..<br /><br /><dl class="codebox"><dt>Code: </dt><dd><code>bool hex2cm5&#40;FILE* fp,FILE* fpout&#41;<br />&#123;<br />   unsigned char totalChecksum=0;<br /><br />   while&#40;!feof&#40;fp&#41;&#41;<br />   &#123;<br />      unsigned char lineChecksum=0;<br />   <br />      int numPairs;<br />      int addressHi;<br />      int addressLo;<br />      int recordType;<br />            if&#40;fscanf&#40;fp,&quot;:%02x%02x%02x%02x&quot;,&amp;numPairs,&amp;addressHi,&amp;addressLo,&amp;recordType&#41;!=4&#41;<br />      &#123;<br />         return false;<br />      &#125;<br />      lineChecksum+=numPairs;<br />      lineChecksum+=addressHi;<br />      lineChecksum+=addressLo;<br />      lineChecksum+=recordType;<br />      <br />      //printf&#40;&quot;%d %d %d %d\n&quot;, numPairs, addressHi, addressLo, recordType&#41;;<br />      <br />      for&#40; int ii=0; ii&lt;numPairs; ii++ &#41;<br />      &#123;<br />         int value;<br />         if&#40;fscanf&#40;fp,&quot;%02x&quot;,&amp;value&#41;!=1&#41;<br />         &#123;<br />            return false;<br />         &#125;<br />         if&#40;recordType==0&#41;<br />         &#123;<br />            fprintf&#40;fpout,&quot;%c&quot;,value&#41;;<br />            <br />            unsigned char buffer&#91;1&#93;=&#123;unsigned char&#40;value&#41;&#125;;<br />            if&#40;serial_write&#40;1,buffer&#41;!=1&#41;<br />            &#123;<br />               return false;<br />            &#125;<br />            totalChecksum+=value;<br />         &#125;<br />         lineChecksum+=value;<br />      &#125;<br />      lineChecksum=&#40;~lineChecksum&#41;+1;<br />      <br />      int checksum;<br />      if&#40;fscanf&#40;fp,&quot;%02x\n&quot;,&amp;checksum&#41;!=1&#41;<br />      &#123;<br />         return false;<br />      &#125;<br />      <br />      //printf&#40;&quot;%02x %02x&quot;,checksum, lineChecksum&#41;;<br />      <br />      if&#40;checksum!=lineChecksum&#41;<br />      &#123;<br />         return false;<br />      &#125;<br /><br />   &#125;<br />   <br />   //printf&#40;&quot;%02x\n&quot;,totalChecksum&#41;;<br />         <br />   return true;<br />&#125;<br /></code></dd></dl><br /><br />fpout is just a file to save out the binary version of the hex file so I could diff it against the intel hex2bin output. It will go away.<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=459">billyzelsnack</a> — Fri Jan 19, 2007 5:54 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[Bullit]]></name></author>
<updated>2007-01-19T02:59:14+01:00</updated>
<published>2007-01-19T02:59:14+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=970&amp;p=6300#p6300</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=970&amp;p=6300#p6300"/>
<title type="html"><![CDATA[Avrdude problems...]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=970&amp;p=6300#p6300"><![CDATA[
My appologies, the robot terminal converts the hex file to binary and then sends it.  Its a simple conversion to binary.<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=173">Bullit</a> — Fri Jan 19, 2007 2:59 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[billyzelsnack]]></name></author>
<updated>2007-01-19T00:30:51+01:00</updated>
<published>2007-01-19T00:30:51+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=970&amp;p=6296#p6296</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=970&amp;p=6296#p6296"/>
<title type="html"><![CDATA[Avrdude problems...]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=970&amp;p=6296#p6296"><![CDATA[
<blockquote class="uncited"><div><br />Ok.<br />Now I just need to figure out how to tell the CM5 to reset AND without disturbing the newly uploaded program.<br /></div></blockquote><br /><br />Oh that's just for my own program. I don't like hitting the reset button manually.<br /><br />Yes.. Hit it right after you transmit and there is no feedback. <br /><br />The example.c program needs you to be connected with a terminal to hit return for each of the little tests.<br /><br />Maybe try transmitting the original hex file and see if you can talk to that from the terminal.<br />[/quote]<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=459">billyzelsnack</a> — Fri Jan 19, 2007 12:30 am</p><hr />
]]></content>
</entry>
<entry>
<author><name><![CDATA[jocke]]></name></author>
<updated>2007-01-18T23:42:16+01:00</updated>
<published>2007-01-18T23:42:16+01:00</published>
<id>http://forum.robosavvy.com/viewtopic.php?t=970&amp;p=6293#p6293</id>
<link href="http://forum.robosavvy.com/viewtopic.php?t=970&amp;p=6293#p6293"/>
<title type="html"><![CDATA[Avrdude problems...]]></title>

<content type="html" xml:base="http://forum.robosavvy.com/viewtopic.php?t=970&amp;p=6293#p6293"><![CDATA[
I think that the hex file isn't downloaded completely, I get an error and the checksum isn't right...<p>Statistics: Posted by <a href="http://forum.robosavvy.com/memberlist.php?mode=viewprofile&amp;u=480">jocke</a> — Thu Jan 18, 2007 11:42 pm</p><hr />
]]></content>
</entry>
</feed>