Results 1 to 4 of 4

Thread: Open CM9.04 - Anyone had luck programming using the Arduno IDE?

  1. #1

    Open CM9.04 - Anyone had luck programming using the Arduno IDE?

    I was wondering if anyone has been using the current versions of Arduino (1.8.5) to program their OpenCM9.04 controllers.

    I followed the instructions given in: https://github.com/ROBOTIS-GIT/OpenC..._Setup_Windows

    And I have successfully built a program (example blink) for the board, but it errors out trying to write to the board. Note: I have successfully been able to use their private IDE to upload the board. Note: I have tried it on a couple of boards now.

    I also installed the Arduino build on my UP board running Ubuntu following the similar instructions in:
    https://github.com/ROBOTIS-GIT/OpenC...no_Setup_Linux

    With the same failure to upload. Wondering if it is expecting a different bootloader or?

    Just wondering if I am missing something obvious. I tried it with an older B version I had, plus an C version I received today from Trossen and an A I also received today from Robotis.

    Anyone tried this? Suggestions?

    Thanks

  2. #2

    Re: Open CM9.04 - Anyone had luck programming using the Arduno IDE?

    Quick update: Sort-of answer for myself.

    Was able to get the Arduino to download, by using the firmware recovery method.

    That is you unplug all power, and while holding in the little button, plug it into usb and then release. The green light stays on and then able to download the program...

  3. #3

    Re: Open CM9.04 - Anyone had luck programming using the Arduno IDE?

    In case anyone is following.... On the above, worked on the new boards (at least the 2 out of 3 I have tried). It still does not work on my original board. Maybe it has a different firmware...

    Will soon create new thread about making a version of the Phantom_Phoenix code base for the OpenCM board. I do have a working version of my AX12_Test program, that was converted to use the DynamixelSDK code. It currently defaults to working with servos on Serial3, but can switch to Serial1. I will probably make the version of the Phoenix code work with servos on either.

    Probably more of a comment for other thread, but I soldered together one of the 904a boards with the normal AX servo headers and have it plugged into the 485 board... The servos don't work yet as no Servo power is brought back from 485 board to 904 board. Need to setup some form of jumper...

    Next question/observation: The Arduino core files installed with the Arduino setup (from #1), do not install the actual core source files, they only install the header files... So I am assuming the build uses some form of pre-built archive in their builds. I found this out when some of my core hung (trying to initialize XBee).
    Code:
     while (Serial2.read() != -1) ;
    Note: I believe this code works for the USB serial (change Serial2 to Serial)

    When I looked in where Arduino was installed:
    C:\Users\kurte\AppData\Local\Arduino15\packages\Op enCM904\hardware\OpenCM904\1.0.0\cores\arduino

    There were only header files...

    I looked up on github and I believe found the sources and releases at: https://github.com/ROBOTIS-GIT/OpenCM9.04

    I believe their code is wrong:
    The UARTClass.cpp code for read is:
    Code:
    int UARTClass::read( void )
    {
      rx_cnt++;
      return drv_uart_read(_uart_num);
    }
    And the drv... code:
    Code:
    int drv_uart_read(uint8_t uart_num)
    {
        int ret = -1;
        int index;
    
        index = drv_uart_rx_buf_tail[uart_num];
    
        ret = drv_uart_rx_buf[uart_num][index];
    
        drv_uart_rx_buf_tail[uart_num] = (drv_uart_rx_buf_tail[uart_num] + 1) % DRV_UART_RX_BUF_LENGTH;
    
        return ret;
    }
    No where does the code check for queue being empty...

    I obviously can/will work around this by doing something like:
    Code:
    while (Serial2.available()) Serial2.read();
    But thought I would post this, in case anyone else was interested where source files are, or runs into a hang like this.

    Edit: Also found that this causes code like:
    Code:
       XBeeSerial.print(F("+++")); 
        XBeeSerial.flush();
        XBeeSerial.setTimeout(20);  // give a little extra time
        if (XBeeSerial.readBytesUntil('\r', ab, 10) > 0) {
    To fail as the read buffer type commands in stream.cpp called timedRead which
    Code:
    int Stream::timedRead()
    {
      int c;
      _startMillis = millis();
      do {
        c = read();
        if (c >= 0) return c;
      } while(millis() - _startMillis < _timeout);
      return -1;     // -1 indicates timeout
    }
    When the queue is empty will always return something. Whatever happened to be leftover in the queue from the previous usage of that queue (or 0 if first time through)
    Last edited by KurtEck; 12-18-2017 at 12:31 PM.

  4. #4

    Re: Open CM9.04 - Anyone had luck programming using the Arduno IDE?

    I thought I put in an update... But maybe not.

    I put this problem up on their github project as an issue and they have since then resolved it. Should be in the next release whenever that is released. Or you can grab the updated stuff from the development branch.

    So far the IDE is working. There are some minor issues that I run into including:
    a) All of my openCM 9.04 boards show up as the same COM port (10) on my windows Machine.
    b) The compiler does not always appear to give me the right line number for error messages
    c) Serial Monitor window does not appear to want to reconnect to the serial port if I do an upload. I have to close it and reopen it...

    Any way I now have a version of the Phoenix code working using the OpenCM9.04 with the installed libraries. I also have it setup to be able to use the XBee or the Robotis Remote control that connects using the Robotis BlueTooth module...

    With the Robotis RC100 controller,



    the interaction currently is really primitive as the controller does not have any Axis like controls, but instead has 10 buttons. The Serial messages are really basic: 0xff 0x55 <low byte> <~low byte><high byte><~high byte>
    And you only receive messages when the user presses something and it continues to send messages about 18 per second and finishes when the user releases the buttons...

    Probably something I should detail on a different thread.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Question(s) Open CM IDE problem on Mac OS
    By jomo in forum Software and Programming
    Replies: 4
    Last Post: 05-17-2016, 02:40 AM
  2. Replies: 6
    Last Post: 12-31-2015, 12:24 PM
  3. Question(s) Bad luck with Dynamixels?
    By tigakub in forum Arbotix, Microcontrollers, Arduino
    Replies: 4
    Last Post: 05-30-2015, 08:35 PM
  4. Good luck next week!
    By robokoi in forum Mech Warfare
    Replies: 10
    Last Post: 06-08-2009, 03:22 PM
  5. OOpic now open source
    By jes1510 in forum Robot Computers
    Replies: 0
    Last Post: 12-08-2008, 05:38 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •