Shop OBEX P1 Docs P2 Docs Learn Events
RealBasic and Programming Prop — Parallax Forums

RealBasic and Programming Prop

T ChapT Chap Posts: 4,223
edited 2009-11-29 10:34 in Propeller 1
I need to send binaries to clients in cases where there are custom software needs. RealBasic is very easy for me to use to create a standalone app. Can someone point me in a direction of how to figure out a method to program the Prop and a standalone app? I think Brad has something that might work under within Realbasic, bstl or bstc, not sure which. Maybe there are other options? What I want to do is create a custom app that will do the same as an F10 and F11, or just F11. Sending out bst or proptool and source files is not an option. I wouldn't want someone having to do command line type input, this needs to be as simple as running the app, then programming the included binary to the Prop.

Another thought was to simply transfer the bytes from the .eeprom from the app in page writes, then reboot, but if there is a problem then I am back to square one.


Thanks

Post Edited (Todd Chapman) : 11/27/2009 9:57:11 PM GMT

Comments

  • DavidMDavidM Posts: 630
    edited 2009-11-27 22:27
    Hi Todd,

    I need to do the exact same thing!

    Needs to be MAC & PC compatible, (This is where realbasic helps)

    I currently have a real basic app that can read and write user data to a prop device I have.
    Currently the user sends or receives DATA to the prop device, via USB using my Special USB Adaptor ( see the bottom of this post http://forums.parallax.com/forums/default.aspx?f=25&m=392294&g=394835#m394835 )

    I would like the option of e-mailing a file which the user gets so they can use the my realbasic app to upload the firmware.

    looking forward to anyones suggestions.
    regards


    Dave M
  • T ChapT Chap Posts: 4,223
    edited 2009-11-27 22:34
    I am still trying to learn how to use the command line part of the PC to test Propellent. But this is limited to the PC. Brads bstc will probably do the job on PC and MAC, but there is no easily found info on how to implement this. Ideally, the stand alone app would launch, then with a browser you would load the file to program, then hit enter to send to RAM or EEPROM.


    At the moment I can run in command line mode the propellent.exe and identify hardware, write to ram or eeprom on the pc. I think it would be possible to run some command lines from the Realbasic app just as well and have buttons that run the commands. Now to get brads bstl to work on mac and pc. from the REALbasic app.

    Post Edited (Todd Chapman) : 11/27/2009 11:00:54 PM GMT
  • DavidMDavidM Posts: 630
    edited 2009-11-27 23:20
    HI Todd,

    I believe BradC has created this command line tool, I have not tried it yet

    http://www.fnarfbargle.com/bst/bstl/005/

    and this as a compiler

    http://www.fnarfbargle.com/bst/bstc/0153/


    if we can link into this via realbasic it would be nice.

    a plug-in version of this for realbasic would be ideal


    Thanks

    Dave M
  • T ChapT Chap Posts: 4,223
    edited 2009-11-27 23:24
    Yes I am trying to figure this out now. I had assumed that on OSX you could run these with Terminal, but no luck yet getting that to work.

    I will post a simple GUI concept.
  • T ChapT Chap Posts: 4,223
    edited 2009-11-27 23:32
    This is just a crude concept to get started with.

    bstl may or may not allow locating of a device, so maybe a serial routine could be active in the Prop at all times, or some other idea to identify the Prop and get a response that it has been found. It would be a real hassle not to know that there was communication established.


    In RB, I am told you can use a Shell object to run commands.

    Post Edited (Todd Chapman) : 11/27/2009 11:58:51 PM GMT
    507 x 242 - 20K
  • DavidMDavidM Posts: 630
    edited 2009-11-28 00:11
    Yep,

    that's a good start, do you have any serial code developed for your realbasic?

    I have some as far as sending and receiving data and detecting ports, But I believe, writing to the eeprom of the compiled binary file is different.

    I could not work out how brads bstl works either, If we can get that to work , then we just have to work out how real basic links in with running a terminal application, then link this to our GUI
    I believe that realbasic has a TERMINAL APPLICATION CLASS should this should work.

    Dave M
  • T ChapT Chap Posts: 4,223
    edited 2009-11-28 00:19
    You wouldn't need to talk serially to the Prop to use the bstl or Propellent, just need to call those commands from RB from the buttons. Someone on the RB forum said use the Shell objecd to run commands.

    Propellent works fine and does a good job of locating the Prop. In accessories, utilities, "Command Terminal" do cd\ to find the propellent folder containing the .eeprom file and the propellent.exe then type: propellent.exe /id and this will locate the prop for you. Download the propellent in at parallax.com under propeller>downloads. It will allow command lines for F10, F11, and other identical prop tool features. Then once we figure out how to call these command lines from RB, just assign the code to the buttons.
  • DavidMDavidM Posts: 630
    edited 2009-11-28 00:31
    Hi Todd yes you are right,

    I Haven't got time at the moment to try this out, but it looks doable.
    If you have time look at the console class in RB.
    thanks

    Dave M
  • BradCBradC Posts: 2,601
    edited 2009-11-28 00:43
    bstl will do what you want. On OSX it tries to hit the first usb serial port it thinks is likely to have a propeller on it. On Windows, you *need* to specify the com port (although if there is sufficient interest I guess I could implement scanning every port to see if there is a prop attached).

    bstl will run in the terminal on OSX.

    If you have a prop plug connected...
    >bstl.osx propeller.binay

    will load that binary into the propeller RAM.

    >bstl.osx -p3 propeller.binary

    will load that binary into propeller EEPROM and run it.

    bstl.osx -h will give you a list of the command line parameters and tell you what does what.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    If you always do what you always did, you always get what you always got.
  • T ChapT Chap Posts: 4,223
    edited 2009-11-28 00:49
    Thanks Brad for the assistance.

    In terminal this is what I get. I can do a ls and list the directory of the desktop and see bstl.osx in the list, but when I run

    bstl.osx -h

    I get the response 'command not found'
    306 x 49 - 3K
  • BradCBradC Posts: 2,601
    edited 2009-11-28 00:55
    ~/ is not in your path.

    try this
    ./bstl.osx

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    If you always do what you always did, you always get what you always got.
  • T ChapT Chap Posts: 4,223
    edited 2009-11-28 00:58
    Aha! I have never used terminal before. New stuff. Now to get RB to run these commands without having to load terminal on pc and OSX.
  • T ChapT Chap Posts: 4,223
    edited 2009-11-28 01:16
    I am puzzled why on a pc bstl -d 12 or bstl -d COM12 returns unable to open port 12, when BST will locate the prop on COM12 easily.
  • DavidMDavidM Posts: 630
    edited 2009-11-28 01:26
    Hi Brad,

    thanks for tring to help out,

    in mac osx I get this

    Morpheus:~ Morph$ desktop/bstl.osx -p3 XF16CREV12.binary
    Brads SpinTool Loader v0.05 - Copyright 2008,2009 All rights reserved
    Compiled for powerpc Darwin at 09:34:59 on 2009/07/03
    Found a USB Serial Device
    Could not load Binary
    Morpheus:~ Morph$

    I get the "could not load binary" message

    Do you know why this could be?

    thanks

    Dave M
  • T ChapT Chap Posts: 4,223
    edited 2009-11-28 04:23
    In the RB examples folder, under SHELLS, 'Interactive' example, I modified the file to use a button, to start sorting out how to have separate buttons for each command. This is a crude start but at least it proves that Realbasic can run the commands very easily.

    In the lower text field marked Input Cmd, you type in terminal commands, starting with cd desktop then the folder with bstl till you are in the folder. Then type ./bstl.osx -h and it runs the help, and displays the output on the screen.

    Ultimately, you could put whatever set of commands on various buttons and run the commands with a click. A browser needs to be installed to locate the bstl file and the file you want to run so they can be sent to bstl as strings.
  • BradCBradC Posts: 2,601
    edited 2009-11-28 04:31
    Todd Chapman said...
    I am puzzled why on a pc bstl -d 12 or bstl -d COM12 returns unable to open port 12, when BST will locate the prop on COM12 easily.

    Oh yeah.. the currently released versions don't cope with COM > 8 on Windows. Any late bst pre-release will work though as it's a bug I fixed a little while ago but never posted updated command line binaries.

    DavidM, I can't off the top of my head think why. I've recently improved the error reporting, but as above I've not posted any updated binaries. I'll try and get some out today.

    If you run bstl.osx without any command line options, does it tell you it detected a propeller? Do you have any other usb-serial converters connected that don't have propellers on them?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    If you always do what you always did, you always get what you always got.
  • BradCBradC Posts: 2,601
    edited 2009-11-28 04:55
    I've just posted bstl 0.06-pre1

    www.fnarfbargle.com/bst/snapshots

    Todd, this should (hopefully) fix your high COM port number problem.

    DavidM, this *might* help find out why it can't load the prop, although I suspect it's not detecting it at all.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    If you always do what you always did, you always get what you always got.
  • T ChapT Chap Posts: 4,223
    edited 2009-11-28 05:00
    Great Brad, thanks for the help. Will test it first thing tomorrow.
  • T ChapT Chap Posts: 4,223
    edited 2009-11-28 17:18
    This zip contains:

    -an OSX app called Propeller System Updater that will run bstl.osx -p1 update.eeprom or bstl.osx -p3 update.eeprom

    -the Realbasic program so you can modify easily to your own needs

    -a dummy update.eeprom file, I think it is an I2C object from obx, it does nothing actually

    -bstl

    -propeller logo for Realbasic to use in a build if desired


    I don't have a Prop connected to the mac at the moment but it appears to be doing what it should. If someone can test it that would be great. To program a real file, in BST or PropTool, compile a program and save as eeprom or binary, then rename to update.eeprom (or modify the RB app to reflect any name you want it to look for. Place the new update.eeprom inside the the system updater folder.

    The entire folder must be placed in the MAC in the applications folder unless you modift the RB app to look for the folder elsewhere.

    The program runs a SHELL class and sends the basic commands to the osx terminal to change directories to the folder we need, then it runs bstl -p1 or -p2 based on the button you press. These buttons should theoretically duplicate F10 and F11 if I interpreted Brad's instructions correctly.

    The app does not currently allow you to search for a device, but will give an error if it can't find a port connected to a device when trying to program.

    If sending to a remote user, I would think it best to include in the zip an FTDI driver as well.

    Now to try he PC version.

    Post Edited (Todd Chapman) : 11/28/2009 5:31:03 PM GMT
    646 x 454 - 77K
  • DavidMDavidM Posts: 630
    edited 2009-11-28 23:16
    HI Todd,

    That's a good start,

    I have not tried your app yet ( no time at the moment) but I will soon,

    My idea would be to update the prop , but not how any terminal window to the user,

    One idea could be that you include the update binary in the software package, or allow the user to choose a file.

    Thanks

    Dave M
  • T ChapT Chap Posts: 4,223
    edited 2009-11-28 23:34
    I just got the pc working with bstl. I am not sure I understand "but not how any terminal window to the user". If you mean not have a terminal response to the user, then just remove the field and not display it. First of the week I will have the MAC and pc app both identify hardware, choose ports, choose file, feedback on success or failure, etc.
  • T ChapT Chap Posts: 4,223
    edited 2009-11-29 01:28
    pc version zip:

    -a pc app called Propeller System Updater that will run bstl.exe -p1 test.eeprom or bstl.exe -p3 test.eeprom

    -the Realbasic program so you can modify easily to your own needs

    -a dummy test.eeprom file, it does nothing.

    -latest bstl.exe

    -propeller logo for Realbasic to use in a build if desired

    You enter the COM port, and file name. File to load must be in same folder as app.

    There is no reporting in the window back from bstl. If the app actually programs the chip, it will take a few seconds and there will be a delayed response [noparse][[/noparse]completed] in the window only. If the response is immediate, then nothing happened. Future versions may require the init of the program to output a notice that the chip has rebooted, indicating to the app that is had actually received the program and rebooted, possibly even displaying the revision number with the feedback to insure success.

    Post Edited (Todd Chapman) : 11/29/2009 7:28:11 AM GMT
  • BradCBradC Posts: 2,601
    edited 2009-11-29 10:34
    Oh, don't forget if you add -f to the command line it downloads twice as fast [noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    If you always do what you always did, you always get what you always got.
Sign In or Register to comment.