Arduino/M4 Programming issues

Discussion in 'UDOO NEO' started by Doug LaMaster, Aug 9, 2017.

  1. Doug LaMaster

    Doug LaMaster New Member

    Joined:
    Jul 5, 2017
    Messages:
    3
    Likes Received:
    0
    I love the idea behind the Udoo. However, I'm having some issues that make it difficult to use. I've got an Udoo Neo Extended with the latest and greatest Udoobuntu (2.1.4 desktop). However, when uploading a sketch, I frequently get the dreaded "uploading input firmware failed" message. The only way I've discovered to fix this is to "sudo rm /var/opt/m4/m4last.fw" and reboot. Major headache to perform any programming this way.
    Are there any fixes for this problem?

    Second, the Arduino Reset pin does not appear to work. Is there any way I can reset the arduino sketch from a terminal command or from an internal pin? Is a reboot my only option? I want to trigger a reset from python, any ideas how this can be accomplished?

    Thanks in advance!
     
  2. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
    Uploading issue are mostly related to not able to stop the running sketch. That is often related to invalid use of sketch features. Compiling goes well but the sketch is not compatible with the Neo. See the documentation and the known issues topic (in my signature).

    Also the use of serial.write() or serial.print() can give issues.
     
  3. Doug LaMaster

    Doug LaMaster New Member

    Joined:
    Jul 5, 2017
    Messages:
    3
    Likes Received:
    0
    My sketch does contain a lot of serial.read() and serial.print() statements.
    I've looked over the documentation and the known issues. The only relevant statement I could find was the following:
    "When you have a sketch that sends data to the serial device (/dev/ttyMCC) it has to be read by the A9 part otherwise it will slow down the execution: it will time out every Serial.println()"
    Looking into using minicom or a basic python script to essentially flush out the serial buffer.
     
    Last edited: Aug 17, 2017
  4. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
    What also helps us to wait or skip with sending data from Arduino to A9 until you are sure you are reading the data on the A9 side. Then there is no need to flush buffers as there is no data to flush.

    You can do that by for example first send a command string through serial that is read by the Arduino. Only after receiving the command string it starts to send data to serial.
     

Share This Page