Shop OBEX P1 Docs P2 Docs Learn Events
Simple IDE Linux Question — Parallax Forums

Simple IDE Linux Question

linuxbikeriderlinuxbikerider Posts: 7
edited 2013-11-04 10:13 in Learn with BlocklyProp
I have SimpleIDE installed and working under Windows. I'm having trouble with Linux. First thing I had to do was to export LD_LIBRARY_PATH to the directory where Simple_IDE was installed to. Next thing I had to do was to run the IDE as root.

Under Linux the board is set up as /dev/ttyUSB0, which I chose based upon the output from the terminal dmesg command

Now when I compile a simple program ("Welcome.c") it obviously interacts with the board, as there are lights flashing on the propeller board and the compiler message indicates that bytes are sent to the board. It fails with the message saying, "load failed. timeout error". I went under the menu tools/properties/general and increased the loader delay. First I tried 2. Same error. Next I tried 10. Still get the error.

Does anybody have some hints on how the problem might get fixed? Also, is this the right forum to post the question, or is there a bug tracker that I should be using?

Thanks

Comments

  • SRLMSRLM Posts: 5,045
    edited 2013-09-15 14:20
    Have you tried different serial ports?

    Have you tried using the propeller-load command by itself (from the terminal)?

    This doesn't seem like the solution, but have you added your user to the "dialout" group? If you haven't that you might not be able to access the USB.
    sudo adduser $USER dialout
    
  • jazzedjazzed Posts: 11,803
    edited 2013-09-15 15:07
    Hi.

    Sorry you're having trouble.

    Just FYI, Parallax removed the little script that makes SimpleIDE easier to use on Linux because of security concerns. They have promised an acceptable Parallax solution in the very near future.

    Meanwhile, I see you've gotten past those issues and seem to be having a loader timeout problem.

    Please answer these two questions:

    1) Can you please describe your Propeller hardware?
    2) What kind of Linux box and OS are you using?

    Thanks,
    --Steve
  • linuxbikeriderlinuxbikerider Posts: 7
    edited 2013-09-16 04:03
    jazzed wrote: »
    Hi.

    Sorry you're having trouble.

    Just FYI, Parallax removed the little script that makes SimpleIDE easier to use on Linux because of security concerns. They have promised an acceptable Parallax solution in the very near future.

    Meanwhile, I see you've gotten past those issues and seem to be having a loader timeout problem.

    Please answer these two questions:

    1) Can you please describe your Propeller hardware?
    2) What kind of Linux box and OS are you using?

    Thanks,
    --Steve

    1. It's a Parallax Propeller quickstart board, connected to the computer with a USB cable.
    2. I'm running on a Toshiba L505D laptop with the latest version of Xubuntu -- downloaded it on Sat 9/14
  • linuxbikeriderlinuxbikerider Posts: 7
    edited 2013-09-16 04:07
    Serial port is automatically assigned when I connect through USB. How can this be changed? For what it's worth, the Arduino works fine through this port.

    I'll try the propeller-load command and adding user to the 'dialout' group, although in my case since I'm running as root I'll add root to the dialout group.

    Thanks for your suggestions.
  • jazzedjazzed Posts: 11,803
    edited 2013-09-16 09:03
    Hi.

    Please set the load delay back to 0.

    When you get the timeout with SimpleIDE, can you please Right-Click in the Build Status,
    click Select All, then copy and paste to a post here?

    When you get the timeout with SimpleIDE, does it happen when using all program methods?
    I.E. F8 Run with Terminal, F10 Load RAM & Run, and F11 Load EEPROM & Run (shown below).


    attachment.php?attachmentid=103945&d=1379347307
    333 x 146 - 22K
  • linuxbikeriderlinuxbikerider Posts: 7
    edited 2013-09-16 17:57
    Have you tried different serial ports? Don't know how to do this, USB connection selects serial port for me.

    Have you tried using the propeller-load command by itself (from the terminal)? I did. Error message: error writing port, load failed

    This doesn't seem like the solution, but have you added your user to the "dialout" group? If you haven't that you might not be able to access the USB.
    I issued this command, both for me as user and for root. Both times I get the message adduser: The group 'dialout' already exists. However, at least once when I did this, I no longer get the 'load failed' error, but the system just hangs and doesn't do anything.

    When you get the timeout with SimpleIDE, can you please Right-Click in the Build Status,
    click Select All, then copy and paste to a post here? See the text below:

    Project Directory:/home/jay/Documents/SimpleIDE/My Projects/
    propeller-elf-gcc -v GCC 4.6.1(propellergcc_v1_0_0_2090)
    propeller-elf-gcc -I . -L . -I/home/jay/simpleide/Learn/Simple Libraries/Utility/libsimpletools -L/home/jay/simpleide/Learn/SimpleLibraries/Utility/libsimpletools/cmm/ -I/home/jay/simpleide/Learn/Simple Libraries/Text Devices/libsimpletext-L /home/jay/simpleide/Learn/Simple Libraries/TextDevices/libsimpletext/cmm/ -I /home/jay/simpleide/Learn/SimpleLibraries/Protocol/libsimplei2c -L /home/jay/simpleide/Learn/SimpleLibraries/Protocol/libsimplei2c/cmm/ -o cmm/Welcome.elf -Os -mcmm-m32bit-doubles -fno-exceptions -std=c99 Welcome.c -lm -lsimpletools-lsimpletext -lsimplei2c -lm -lsimpletools -lsimpletext -lm-lsimpletools -lm
    propeller-load -s cmm/Welcome.elf
    propeller-elf-objdump -hcmm/Welcome.elf
    Done. Build Succeeded!
    propeller-load -Dreset=dtr -I/home/jay/SimpleIDE-0-9-40/parallax/propeller-load/ -b ACTIVITYBOARDcmm/Welcome.elf -r -p /dev/ttyUSB0Propeller Version 1 on /dev/ttyUSB0
    Loading cmm/Welcome.elf to hub memory
    6588 bytes sent
    Verifying RAM ...
    Timeout Error!
    error: load failed
    error: load failed

    When you get the timeout with SimpleIDE, does it happen when using all program methods? Yes


    I have SimpleIDE installed and working under Windows. I'm having trouble with Linux. First thing I had to do was to export LD_LIBRARY_PATH to the directory where Simple_IDE was installed to. Next thing I had to do was to run the IDE as root.

    Under Linux the board is set up as /dev/ttyUSB0, which I chose based upon the output from the terminal dmesg command

    Now when I compile a simple program ("Welcome.c") it obviously interacts with the board, as there are lights flashing on the propeller board and the compiler message indicates that bytes are sent to the board. It fails with the message saying, "load failed. timeout error". I went under the menu tools/properties/general and increased the loader delay. First I tried 2. Same error. Next I tried 10. Still get the error.

    Does anybody have some hints on how the problem might get fixed? Also, is this the right forum to post the question, or is there a bug tracker that I should be using?

    Thanks
  • jazzedjazzed Posts: 11,803
    edited 2013-09-17 21:30
    I'm not sure what to make of this situation. It may be useful to exchange the Quickstart board.

    There is a test you can do first though.

    The SimpleIDE package comes with a program called bstc.
    It is /opt/parallax/bin/bstc ... if you don't mind a little command-line work ....
    $ cd ~/Documents/SimpleIDE/My Projects
    
    $ cat > blink.spin
    pub main
      DIRA |= $ff0000
      repeat
        OUTA ^= DIRA
        waitcnt(CLKFREQ+CNT)
    CTRL+D
    
    $ bstc -d /dev/ttyUSB0 -p0 blink.spin
    

    Spaces in the blink.spin file are very important.

    If this loads and blinks all 8 of the blue Quickstart LEDs, then we can try something more complicated.
    If it does not work, definitely exchange the Quickstart board.
  • linuxbikeriderlinuxbikerider Posts: 7
    edited 2013-09-18 19:19
    I tried a modified version of the suggested test. Here is the command I entered:

    sudo ./bstc.linux -d /dev/ttyUSB0 -p0 blink.spin

    I got the following messages back:
    Compiled 5 lines of code in 0.001 seconds
    We found a Propeller Version 1
    Ram Verify Timeout
    Propeller Load took 5.712 seconds.

    no blinking lights observed on the quickstart board

    So the problem could be hardware. I have another propeller quickstart board that I will try this out with. I am puzzled because both of my quickstart boards work fine under Microsoft Windows. Why should they fail under Linux? My second board is deployed right now so it will take a few days to verify it against this code.


    jazzed wrote: »
    I'm not sure what to make of this situation. It may be useful to exchange the Quickstart board.

    There is a test you can do first though.

    The SimpleIDE package comes with a program called bstc.
    It is /opt/parallax/bin/bstc ... if you don't mind a little command-line work ....
    $ cd ~/Documents/SimpleIDE/My Projects
    
    $ cat > blink.spin
    pub main
      DIRA |= $ff0000
      repeat
        OUTA ^= DIRA
        waitcnt(CLKFREQ+CNT)
    CTRL+D
    
    $ bstc -d /dev/ttyUSB0 -p0 blink.spin
    

    Spaces in the blink.spin file are very important.

    If this loads and blinks all 8 of the blue Quickstart LEDs, then we can try something more complicated.
    If it does not work, definitely exchange the Quickstart board.
  • jazzedjazzed Posts: 11,803
    edited 2013-09-18 20:09
    Interesting :) Good to have a situation where is does work, but it is a little confusing.
    I've never seen Windows work and Linux not work (except for under a VM for a certain board).

    Is it possible your USB port power is weak or noisy?
  • linuxbikeriderlinuxbikerider Posts: 7
    edited 2013-09-21 11:55
    I swapped the boards and neither board works under Linux on the Toshiba L505D laptop. Based upon your advice I next tried to switch Linux computers, supposing that there was a problem with the USB port. Good news is that I can get blink.spin working using the bstc.linux command on my second Linux computer, so at this point I'm suspecting something's wrong with the Toshiba laptop USB port. Now I'm struggling with Simple IDE on the second Linux computer. I suspect this is just a setup problem. When I try and execute hello.c, I get the error message shown below:

    propeller-elf-gcc: error trying to exec 'cc1': execvp: No such file or directory

    I'm guessing that Simple IDE is looking for the cc1 executable located under SimpleIDE-0-9-40/parallax/libexec/gcc/propeller-elf/4.6.1. There is a cc1 file in this location, don't know why it isn't being found. Got any ideas? Thanks



    jazzed wrote: »
    Interesting :) Good to have a situation where is does work, but it is a little confusing.
    I've never seen Windows work and Linux not work (except for under a VM for a certain board).

    Is it possible your USB port power is weak or noisy?
  • jazzedjazzed Posts: 11,803
    edited 2013-09-23 09:50
    Hi,

    I have not tested the package that Parallax re-posted. I assumed a few things including "that some instructions would be added for the solution that was tested"; I don't see anything though.

    The Linux package has been removed for the time being until we have a working and documented solution that is acceptable to Parallax (and me).

    I'm guessing that Simple IDE is looking for the cc1 executable located under SimpleIDE-0-9-40/parallax/libexec/gcc/propeller-elf/4.6.1. There is a cc1 file in this location, don't know why it isn't being found. Got any ideas? Thanks

    Meanwhile ....

    Not sure why that isn't working. We have done all of our testing with the parallax folder in /opt/parallax ...

    You should try moving the parallax folder assuming /opt exists
    $ sudo mv SimpleIDE-0-9-40/parallax /opt

    I recommend shutting down simpleide, then removing ~/.config/ParallaxInc
    SimpleIDE first startup depends on files being in /opt/parallax in Linux/Mac

    Remove or rename ~/Documents/SimpleIDE if it exists.

    Then restart SimpleIDE, but first ...
    You must set LD_LIBRARY_PATH to include the SimpleIDE-0-9-40/bin folder before running SimpleIDE.
    I noticed there is a template.sh file in SimpleIDE-0-9-40/bin ... you can use that (rename, etc...) to start SimpleIDE.
  • linuxbikeriderlinuxbikerider Posts: 7
    edited 2013-09-23 19:28
    It worked! Thanks for your help. One additional thing I needed to do -- when the files copied on to my computer they were not marked as being executable. I had to go into opt/parallax directory and issue the command chmod -R a+rwx *


    jazzed wrote: »
    Hi,

    I have not tested the package that Parallax re-posted. I assumed a few things including "that some instructions would be added for the solution that was tested"; I don't see anything though.

    The Linux package has been removed for the time being until we have a working and documented solution that is acceptable to Parallax (and me).




    Meanwhile ....

    Not sure why that isn't working. We have done all of our testing with the parallax folder in /opt/parallax ...

    You should try moving the parallax folder assuming /opt exists
    $ sudo mv SimpleIDE-0-9-40/parallax /opt

    I recommend shutting down simpleide, then removing ~/.config/ParallaxInc
    SimpleIDE first startup depends on files being in /opt/parallax in Linux/Mac

    Remove or rename ~/Documents/SimpleIDE if it exists.

    Then restart SimpleIDE, but first ...
    You must set LD_LIBRARY_PATH to include the SimpleIDE-0-9-40/bin folder before running SimpleIDE.
    I noticed there is a template.sh file in SimpleIDE-0-9-40/bin ... you can use that (rename, etc...) to start SimpleIDE.
  • David CarrierDavid Carrier Posts: 294
    edited 2013-10-02 15:47
    We have a computer that is giving the same "Timeout Error!" from propeller-load that your Toshiba L505D did. We'll look in to the cause and keep you up to date.

    — David Carrier
    Parallax Inc.
  • markhumarkhu Posts: 1
    edited 2013-10-04 18:45
    On my Mac, I had to do this:
    $ sudo chmod a+rx /opt/
    

    because the permissions were wrong. There was nothing else in that dir aside from the parallax subdirectory, so I presume it was created by the SimpleIDE installation.

    The incorrect permissions caused the initial "Select folders..." dialog to have several wrong paths that I had to correct.
  • David CarrierDavid Carrier Posts: 294
    edited 2013-11-04 10:13
    It appears that upgrading Ubuntu to version 13.10 eliminates the "Timeout Error!" in propeller-load.
Sign In or Register to comment.