Shop OBEX P1 Docs P2 Docs Learn Events
propeller-load Does Not Return Control to Shell — Parallax Forums

propeller-load Does Not Return Control to Shell

LombardLombard Posts: 30
edited 2014-05-12 03:38 in Propeller 1
I'm just getting started with the Propeller on Kubuntu 13.10. I've been setting up my workflow with propeller-elf-gcc and propeller-load, and everything is great (!) except for one thing. When I run propeller-load with the -t option so I can watch the printf's, etc, come back from the board, I cannot return control to my shell. I'm using zsh and bash.

When propeller-load starts, it says ...

[ Entering terminal mode. Type ESC or Control-C to exit. ]

... before executing the program. Unfortunately, this does not work for me. There seems to be no way to get back to my shell after executing a program. Do I need to do something in my C++ code to help propeller-load exit cleanly?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2014-05-11 07:56
    You're correct. When you use terminal mode to "watch the printf's come back from the board", propeller-load will not exit back to the shell until you type an ESC or Control-C from the keyboard. This is by design. How else would the propeller-tool's terminal mode "know" when you're done watching the output from your board?

    Terminal mode is intended to be used interactively, not from a shell. You'll find similar behavior in other terminal emulators. You'll have to leave out the -t option. There are other ways to look at debugging information. For example, you could invest in a small 2x16 serial LCD and hook that to a spare I/O pin to display the output of printf's directed to that I/O pin. I tend to program mostly in Spin and there's a nice 1-pin Video Text display driver in the OBEX that only uses 1 I/O pin to display up to 80x25 on a TV attached to a single I/O pin. I don't know if that's been ported to the Propeller C library yet.
  • LombardLombard Posts: 30
    edited 2014-05-11 08:11
    Oh, I see. So is there a way to ever return to the shell prompt after running propller-load with -t? Crtl-C and <ESC> will halt execution of the program on the chip, but then propeller-load hangs (or waits for more serial traffic, perhaps?).
  • SRLMSRLM Posts: 5,045
    edited 2014-05-11 08:11
    Mike Green wrote: »
    Terminal mode is intended to be used interactively, not from a shell. You'll find similar behavior in other terminal emulators. You'll have to leave out the -t option.

    Actually, propeller-load has an option to allow for non-interactive mode: -q. From the --help:
    [ -q ]            quit on the exit sequence (0xff, 0x00, status)
    

    libpropeller uses this feature to allow automatic running of unit tests.

    It sounds like Lombard is having the problem of hitting CTRL+C, and nothing happening. I've never had this problem: propeller-load always exits cleanly on CTRL+C for me.
  • SRLMSRLM Posts: 5,045
    edited 2014-05-11 08:12
    Lombard wrote: »
    Oh, I see. So is there a way to ever return to the shell prompt after running propller-load with -t? Crtl-C and <ESC> will halt execution of the program on the chip, but then propeller-load hangs (or waits for more serial traffic, perhaps?).

    Just to be clear, CTRL+C does not halt execution on the chip. It just closes the terminal.
  • LombardLombard Posts: 30
    edited 2014-05-11 08:22
    SRLM wrote: »
    Just to be clear, CTRL+C does not halt execution on the chip. It just closes the terminal.

    Ah, ok. So Ctrl-C is actually just freezing propeller-load for me. That seems like a reasonable diagnostic. I guess I will look into having a separate serial listener program for this job. I don't really need the interactivity (although it is a nicety).
  • David BetzDavid Betz Posts: 14,516
    edited 2014-05-11 19:47
    Lombard wrote: »
    I'm just getting started with the Propeller on Kubuntu 13.10. I've been setting up my workflow with propeller-elf-gcc and propeller-load, and everything is great (!) except for one thing. When I run propeller-load with the -t option so I can watch the printf's, etc, come back from the board, I cannot return control to my shell. I'm using zsh and bash.

    When propeller-load starts, it says ...

    [ Entering terminal mode. Type ESC or Control-C to exit. ]

    ... before executing the program. Unfortunately, this does not work for me. There seems to be no way to get back to my shell after executing a program. Do I need to do something in my C++ code to help propeller-load exit cleanly?
    propeller-load is (of course) not supposed to hang if you type ^C or ESC to exit terminal mode. What platform are you running on (Windows, Mac, Linux)? To be honest, I almost always use ESC to exit from terminal mode so if there is a bug with ^C I may have missed it. Could you tell me exactly what you are doing so I can track this down?

    Thanks,
    David
  • LombardLombard Posts: 30
    edited 2014-05-12 03:38
    I'm using Kubuntu 13.10. I've tried zsh and bash as my shell, in Konsole. Propeller processor is P8X32A-Q44 on the ASC+ board.

    And now that you mention it, if I do ESC first, it exits fine. If I type Ctrl-C first then ESC (and all other keystrokes) are ineffective. Thanks for taking interest!
Sign In or Register to comment.