Shop OBEX P1 Docs P2 Docs Learn Events
Propeller-load strange issue — Parallax Forums

Propeller-load strange issue

photomankcphotomankc Posts: 943
edited 2016-03-07 17:38 in Learn with BlocklyProp
I'm working on getting a propeller programmed via CLI on a Raspberry Pi. So far I've been able to create a script to compile and link the program and create the .elf output by using SimpleIDE on my MAC to get the needed options. Finally got to the point that I could produce a running program that was executed and produced output. Patted myself on the back and wrote that to EEPROM so I could commence wiring the two together tonight without fear of the previous program it was running. That's when I ran into the issue. After programming the EEPROM the terminal will appear and nothing is displayed. Almost like nothing told the Propeller to start. In frustration I tried the "-P" option to identify the port and make sure it was still responding. That worked, the Propeller was found on the serial port, and I expected this meant that the Propeller was also reset. That seemed to be the case as now, I can run "screen /dev/ttyUSB1 115200" and the comforting "Beep" output is displayed once per second.

Reading the command line switches I do see that it says "Program EEPROM" not "Run from EEPROM", so is that just the way it's expected to be? I'd have to initiate a manual reset to get the code running?

Is there something else that's needed to get into the terminal mode after programming the EEPROM? Should I just program it and then use screen instead to get a terminal? Come to think of it I'd swear I see the Propeller IDE load it twice when I program EEPROM and open a terminal, so maybe it programs the EEPROM and then loads it to RAM and runs it?

Here's what I see:

When programmed using the "-r" (Run from RAM) method:
XXXX@prowlerbot04:/robot/src/p8x32a-development/serial-sub-controller $ /opt/parallax/bin/propeller-load -b ssf-104 -r -t ./cmm/serial-sub-controller.elf
Propeller Version 1 on /dev/ttyUSB1
Loading ./cmm/serial-sub-controller.elf to hub memory
8292 bytes sent
Verifying RAM ... OK
[ Entering terminal mode. Type ESC or Control-C to exit. ]
Serial Sub-Controller Frustration v0.01
Beep
Beep
Beep
Beep
Beep


When run with the "-e" (Program EEPROM) method:
XXXX@prowlerbot04:/robot/src/p8x32a-development/serial-sub-controller $ /opt/parallax/bin/propeller-load -b ssf-104 -e -t ./cmm/serial-sub-controller.elf
Propeller Version 1 on /dev/ttyUSB1
Loading ./cmm/serial-sub-controller.elf to EEPROM via hub memory
8292 bytes sent
Verifying RAM ... OK
Programming EEPROM ... OK
Verifying EEPROM ... OK
[ Entering terminal mode. Type ESC or Control-C to exit. ]

There is no output after that. Now If I issue "/opt/parallax/bin/propeller-load -P" and then "screen /dev/ttyUSB1 115200" I will see it start outputting what's expected.

/**
 * This is the main serial-sub-controller program file.
 */

#include <propeller.h>
#include "simpletext.h"
#include "simpletools.h"

int main(void)
{
  pause(1000);
  print("Serial Sub-Controller Frustration v0.01\n");
  int lcount = 0;

  // Main program loop
  while (1)
  {
    if (lcount == 100)
    {
      print("Beep\n");
      lcount = 0;
    }

    lcount++;
    pause(20);
  }

  return 0;
}

Comments

  • You need to add -r if you want the program to run after loading. This is true whether or not you use the -e option to write the program to EEPROM.
  • photomankcphotomankc Posts: 943
    edited 2016-03-07 18:06
    Ok, that makes sense now. Thanks!

    ETA: That's a duh moment too. Reading the --help it clearly says "-r" is "run the program" and nothing about "RAM". I just read that into it on my own.
  • If you're interested at all, I'm working on getting some Raspberry Pi support into PropWare. Are you running a Pi 1 or Pi 2?
  • DavidZemon wrote: »
    If you're interested at all, I'm working on getting some Raspberry Pi support into PropWare. Are you running a Pi 1 or Pi 2?
    Have you converted the ActivityBot code from Simple Libraries to work with PropWare?

  • David Betz wrote: »
    DavidZemon wrote: »
    If you're interested at all, I'm working on getting some Raspberry Pi support into PropWare. Are you running a Pi 1 or Pi 2?
    Have you converted the ActivityBot code from Simple Libraries to work with PropWare

    No one has brought up any errors to me. I haven't made any source code modifications to Simple, and all of the source files from Simple compile with PropWare's build system. To the best of my knowledge, it all works great.
  • DavidZemon wrote: »
    David Betz wrote: »
    DavidZemon wrote: »
    If you're interested at all, I'm working on getting some Raspberry Pi support into PropWare. Are you running a Pi 1 or Pi 2?
    Have you converted the ActivityBot code from Simple Libraries to work with PropWare

    No one has brought up any errors to me. I haven't made any source code modifications to Simple, and all of the source files from Simple compile with PropWare's build system. To the best of my knowledge, it all works great.

    That being said, I don't have an ActivityBot so I haven't tested it. I have an ActivityBoard though, so I could test some individual pieces if you'd like.
  • DavidZemon wrote: »
    DavidZemon wrote: »
    David Betz wrote: »
    DavidZemon wrote: »
    If you're interested at all, I'm working on getting some Raspberry Pi support into PropWare. Are you running a Pi 1 or Pi 2?
    Have you converted the ActivityBot code from Simple Libraries to work with PropWare

    No one has brought up any errors to me. I haven't made any source code modifications to Simple, and all of the source files from Simple compile with PropWare's build system. To the best of my knowledge, it all works great.

    That being said, I don't have an ActivityBot so I haven't tested it. I have an ActivityBoard though, so I could test some individual pieces if you'd like.
    I have an ActivityBot but its batteries won't charge. :-(
    I hate to ask this because I know it has been a sore point but is there any way to use the PropWare library without having to adopt cmake? Can the library itself be built with cmake but then used by a normal Makefile application?

  • DavidZemonDavidZemon Posts: 2,973
    edited 2016-03-07 20:52
    David Betz wrote: »
    I hate to ask this because I know it has been a sore point but is there any way to use the PropWare library without having to adopt cmake? Can the library itself be built with cmake but then used by a normal Makefile application?

    Actually yes, I've been publishing the stand-alone libraries for a while, but only recently published instructions for using those libraries within SimpleIDE (and of course, if you're using your own Makefile, you're on your own). The instructions for SimpleIDE are here. The standalone library archive is PropWare-XYZ-Generic-propware.zip and can be downloaded here for the latest from the develop branch and here for the latest from the release-2.0 branch.
  • David BetzDavid Betz Posts: 14,511
    edited 2016-03-07 21:23
    DavidZemon wrote: »
    David Betz wrote: »
    I hate to ask this because I know it has been a sore point but is there any way to use the PropWare library without having to adopt cmake? Can the library itself be built with cmake but then used by a normal Makefile application?

    Actually yes, I've been publishing the stand-alone libraries for a while, but only recently published instructions for using those libraries within SimpleIDE (and of course, if you're using your own Makefile, you're on your own). The instructions for SimpleIDE are here. The standalone library archive is PropWare-XYZ-Generic-propware.zip and can be downloaded here for the latest from the develop branch and here for the latest from the release-2.0 branch.
    That's very helpful. Thanks! It doesn't look there should be any problem using those from a Makefile.

  • David Betz wrote: »
    DavidZemon wrote: »
    David Betz wrote: »
    I hate to ask this because I know it has been a sore point but is there any way to use the PropWare library without having to adopt cmake? Can the library itself be built with cmake but then used by a normal Makefile application?

    Actually yes, I've been publishing the stand-alone libraries for a while, but only recently published instructions for using those libraries within SimpleIDE (and of course, if you're using your own Makefile, you're on your own). The instructions for SimpleIDE are here. The standalone library archive is PropWare-XYZ-Generic-propware.zip and can be downloaded here for the latest from the develop branch and here for the latest from the release-2.0 branch.
    That's very helpful. Thanks! It doesn't look there should be any problem using those from a Makefile.

    Yep! Should be very simple to include into a Makefile. I deleted an extra bracket in my post btw, which is why your post doesn't look right either. Sorry about that.
  • David,

    Running a B+ which I think is still version 1. Considering grabbing a couple of 3's now that they are out but I have not checked out power consumption figures on the 3's yet.
  • photomankc wrote: »
    David,

    Running a B+ which I think is still version 1. Considering grabbing a couple of 3's now that they are out but I have not checked out power consumption figures on the 3's yet.

    B+ is indeed the old CPU.

    You might well appreciate the libs I linked to in the other post. That will at least let you use the Simple libraries (and PropWare and libpropeller) without having to copy the source code into your projects.

    Because the Pi 2 is so much faster, I'll be running tests on that one first and then I'll add in Pi 1 support afterwards. I don't have any intentions of buying a Pi 3 any time soon so it may not get explicit support. But perhaps since it is just a generation newer, it will keep backward compatibility? If you get yourself a 3, you'll have to test it out for me and let me know :)
Sign In or Register to comment.