MiniMaestro 12: Code example suddenly getting stuck at read

Hi there,

I hope you can provide some tips on my problem. My debugger gets stuck on line 27 when I try to run the example from:
pololu.com/docs/0J40/5.h.1

The weird part is I had some initial runs where it worked just fine. I split the code up in several classes and when I wanted to test it, it didn’t do. So I tried to go back to the example which I couldn’t get running any more.

Context:

  • Ubuntu 12.04
  • Maestro Control Center does just fine
  • /dev/ttyACM0 and /dev/ttyACM1 are there
  • standard servos are connected on channels 0 and 1
  • just swapped comments on lines 53 and 54
  • tried some reboots/reconnects without success

The debugger passes the write command without problems and completely freezes at the read command. No errors, seg faults or return values.
The main question: Is this a known issue or does anybody have an idea what might cause that kind of behavior?

Thank you for your help
Sönke

Hi, Sönke.

I am sorry you are having problems running the Cross-platform C example on your Maestro. What serial mode do you have the Maestro set to? Could you post your settings file? To save a settings file you can open the Maestro Control Center and then select “Save settings file” under the File menu.

-Claire

Hey Claire,

thanks for your time - I will answer the question as soon as I’m back in my “Lab” in 2 to 3 days. :slight_smile:

Best regards
Sönke

Hey again,

sorry for the late reply. This is the configuration that runs fine - any ideas?
I also tried running the example code once more resulting in the same error.
The Micro Maestro I’ve got at hand shows the same behavior.

Sönke

<!--Pololu Maestro servo controller settings file, https://www.pololu.com/catalog/product/1350-->
<UscSettings version="1">
  <NeverSuspend>true</NeverSuspend>
  <SerialMode>UART_FIXED_BAUD_RATE</SerialMode>
  <FixedBaudRate>9600</FixedBaudRate>
  <SerialTimeout>0</SerialTimeout>
  <EnableCrc>false</EnableCrc>
  <SerialDeviceNumber>12</SerialDeviceNumber>
  <SerialMiniSscOffset>0</SerialMiniSscOffset>
  <Channels MiniMaestroServoPeriod="80000" ServoMultiplier="1">
    <!--Period = 20 ms-->
    <!--Channel 0-->
    <Channel name="HS85-MG" mode="Servo" min="3968" max="8000" homemode="Off" home="3968" speed="0" acceleration="0" neutral="6000" range="1905" />
    <!--Channel 1-->
    <Channel name="MC-396DMH" mode="Servo" min="3968" max="8000" homemode="Off" home="3968" speed="0" acceleration="0" neutral="6000" range="1905" />
    <!--Channel 2-->
    <Channel name="" mode="Servo" min="3968" max="8000" homemode="Off" home="3968" speed="0" acceleration="0" neutral="6000" range="1905" />
    <!--Channel 3-->
    <Channel name="" mode="Servo" min="3968" max="8000" homemode="Off" home="3968" speed="0" acceleration="0" neutral="6000" range="1905" />
    <!--Channel 4-->
    <Channel name="" mode="Servo" min="3968" max="8000" homemode="Off" home="3968" speed="0" acceleration="0" neutral="6000" range="1905" />
    <!--Channel 5-->
    <Channel name="" mode="Servo" min="3968" max="8000" homemode="Off" home="3968" speed="0" acceleration="0" neutral="6000" range="1905" />
    <!--Channel 6-->
    <Channel name="" mode="Servo" min="3968" max="8000" homemode="Off" home="3968" speed="0" acceleration="0" neutral="6000" range="1905" />
    <!--Channel 7-->
    <Channel name="" mode="Servo" min="3968" max="8000" homemode="Off" home="3968" speed="0" acceleration="0" neutral="6000" range="1905" />
    <!--Channel 8-->
    <Channel name="" mode="Output" min="3968" max="8000" homemode="Off" home="3968" speed="0" acceleration="0" neutral="6000" range="1905" />
    <!--Channel 9-->
    <Channel name="" mode="Servo" min="3968" max="8000" homemode="Off" home="3968" speed="0" acceleration="0" neutral="6000" range="1905" />
    <!--Channel 10-->
    <Channel name="" mode="Servo" min="3968" max="8000" homemode="Off" home="3968" speed="0" acceleration="0" neutral="6000" range="1905" />
    <!--Channel 11-->
    <Channel name="" mode="Servo" min="3968" max="8000" homemode="Off" home="3968" speed="0" acceleration="0" neutral="6000" range="1905" />
  </Channels>
  <Sequences>
    <Sequence name="Sequence 0">
      <Frame name="Frame 0" duration="500">8000 0 0 0 0 0 0 0 6957 0 0 0</Frame>
    </Sequence>
  </Sequences>
  <Script ScriptDone="true" />
</UscSettings>

The Maestro’s Cross-platform C example specifies that the Maestro’s serial mode must be set to “USB Dual Port” to use it. Could you try changing the serial mode your Maestros are in, and see if that solves the problem?

-Claire

Well, being incapable to read those two lines of introduction pretty much makes me a moron. Gonna try that - thanks.

P.S.: Ever thought about adding a donation button/tool in here? I think you might get me into paying a little “moron fee” :unamused:.

Thanks - that did the trick.