Problem getting serial output in Arduino IDE

Discussion in 'General Discussion' started by fmc159, Jan 11, 2014.

  1. fmc159

    fmc159 Member

    Joined:
    Oct 18, 2013
    Messages:
    37
    Likes Received:
    0
    Hi all,

    Was just testing a very simple serial output sketch for the built in Due, but can't get any output to show up on the Arduino IDE's serial monitor. I know the sketch is correct and working as it works with a standard arduino uno I tested with my mac.

    Any ideas as to why it wouldn't work?

    Many thanks!
     
  2. francescomm

    francescomm Member

    Joined:
    Dec 14, 2013
    Messages:
    80
    Likes Received:
    4
    Might be this. There is some problem with some standard C / Arduino libraries, so there are some standard functions that cannot be used.

    viewtopic.php?f=15&t=583

    Just adding some function like string to int conversions to a sketch jams it so that it does not run (no output is shown, even before that function).

    If that is your case, you have two ways+1:

    1 - try removing things from your sketch until it outputs something, so you can find exactly what function causes the problem. Then search on the internet for alternatives to that function (I googled "C atoi sources" and replaced the atoi function with a custom one: myatoi and now my sketch works)

    2 - remove the appropriate pin and connect the due to an external computer via USB. The Arduino IDE on the external computer must be patched as instructed on UDOO website.

    3 - wait for someone to fix it.

    Have fun.
     
  3. EchoWarp

    EchoWarp New Member

    Joined:
    Feb 3, 2014
    Messages:
    11
    Likes Received:
    0
    I want to pile on that atof and strtod do not work either. I even grabbed some c source for the function (renamed it to myStrtod) and it doesn't work either. The external functions or variables I can pick up on in the code are isdigit and isspace. Is that what is missing?

    It just freezes after the function is run.

    I find it kind of hard to believe that this is not a bigger issue for most users. I am using the stock Arduino ide that comes with the latest Linaro Ubuntu 11.10 1.3 (2013-11-12) for an Udoo Quad.
     
  4. francescomm

    francescomm Member

    Joined:
    Dec 14, 2013
    Messages:
    80
    Likes Received:
    4
    As the problem is at compile time, the known workaround is to attach the arduino due to an external computer just to compile the sketch (removing a jumper).
     
  5. EchoWarp

    EchoWarp New Member

    Joined:
    Feb 3, 2014
    Messages:
    11
    Likes Received:
    0
    I am not sure that the problem is, in fact, at compile time. I wonder if it maybe could perhaps be during the upload process.

    I have applied the patch and successfully uploaded to the SAM3X, which fixed most of my problems. I can now use atoi and atol without it freezing, but atof still has trouble. When atof is included anywhere in the program, there is no serial output at all once the sketch is uploaded. However, now, I can use my own atof or strtod functions if I rename them.

    This is a confusing, but satisfactory fix for me. I'm just posting for documentation. The only significant difference that I see is that when I use the atof function, 113 pages are uploaded. Or maybe it has something to do with floats.

    *edit: I may have found a more complete fix here: http://www.udoo.org/forum/viewtopic.php?f=15&t=785&p=6301#p6301
     

Share This Page