Shop OBEX P1 Docs P2 Docs Learn Events
bstl on intel mac, how? — Parallax Forums

bstl on intel mac, how?

Tracy AllenTracy Allen Posts: 6,664
edited 2012-03-15 07:26 in Propeller 1
Trying to run bstl on an intel mac, 10.6.7, from the terminal window.
[SIZE=1][FONT=arial narrow]Thomas-Allens-MacBook-Air:bst thomasallen$ ls
bst.app            bstc.osx
bst_manual_0.04.pdf    bstl.osx
[/FONT][/SIZE]
If it can be done, what is the syntax? I can start the bst gui itself just fine with open bst.app.

I found rumors to the effect that .osx type of files don't work on Intel macs. But bst itself works fine and it seems like it would have the same basis.

Comments

  • avsa242avsa242 Posts: 454
    edited 2012-03-14 03:01
    Tracy,
    I can't say firsthand whether files with an .osx suffix differ, or how, from .app suffix files, but assuming they are both executable, you would just type:
    Thomas-Allens-MacBook-Air:bst thomasallen$ ./bstl.osx
    

    along with whatever parameters bstl.osx requires (try ./bstl.osx -h for help).

    Cheers,
    Jesse
  • dgatelydgately Posts: 1,633
    edited 2012-03-14 08:22
    Trying to run bstl on an intel mac, 10.6.7, from the terminal window.
    [SIZE=1][FONT=arial narrow]Thomas-Allens-MacBook-Air:bst thomasallen$ ls
    bst.app            bstc.osx
    bst_manual_0.04.pdf    bstl.osx
    [/FONT][/SIZE]
    
    If it can be done, what is the syntax? I can start the bst gui itself just fine with open bst.app.

    I found rumors to the effect that .osx type of files don't work on Intel macs. But bst itself works fine and it seems like it would have the same basis.

    ".osx" is just the extension that identified the Mac OS X version of Brad's bstl program. The easiest way to tell if a command-line program will work on your Mac is to use the "file" command in the Terminal app, like this (you'll need to "cd" to the directory that contains "bstl.osx", first:

    [myUser@myMac]$ file bstl.osx
    bstl.osx: Mach-O universal binary with 2 architectures
    bstl.osx (for architecture i386): Mach-O executable i386 <== the executable binary for Intel (32-bit)
    bstl.osx (for architecture ppc): Mach-O executable ppc <== the executable for PPC (32-bit)

    So, looks like bstl.osx will run on Intel and PPC based Macs!

    If you want to know how to use the program, you can get usage data like this (again, you'll need to cd to the directory containing bstl.osx):

    [myUser@myMac]$ ./bstl.osx -h <== "./" helps to execute the file from within it's containing directory!

    For more details on the bstl loader program:

    See page 2 of Brad's Manual for BST gives all of the detail on using bstl: http://www.fnarfbargle.com/bst/manual/



    dgately
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2012-03-14 08:26
    Thanks! joy! It also wants the .osx extension:

    [FONT=arial narrow]Thomas-Allens-MacBook-Air:bst thomasallen$ ./bstl -h
    -bash: ./bstl: No such file or directory
    
    Thomas-Allens-MacBook-Air:bst thomasallen$[COLOR=#020FC0] [B]./bstl.osx -h[/B][/COLOR]
    Brads SpinTool Loader v0.05 - Copyright 2008,2009 All rights reserved
    Compiled for i386 Darwin at 09:34:59 on 2009/07/03
    Program Usage :- bstl (Options) <FileName>
    -d <filename> - Serial device to use (Default /dev/tty.usbserial)
    -p [123] - Program Mode
        1 - Ram only (Default)
        2 - Eeprom and shutdown
        3 - Eeprom and Run
    -f Load at high speed
    -t Test mode (Undocumented)
    -h  - Show this help
    Thomas-Allens-MacBook-Air:bst thomasallen$ [/FONT]
    
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2012-03-14 09:09
    I was thrown off by the documentation in Brad's manual for bst, which suggests the straight syntax...
    [SIZE=1][FONT=arial narrow]brad@bkmac:~$ bstc test.spin[/FONT][/SIZE]
    

    Using the./bstl.osx syntax I was able to load a .eeprom file from the command line, but the binary (created from bst right before the .eeprom file) came back with a checksum error. Is there any advantage to one over the other?
    [SIZE=1][FONT=arial narrow]Thomas-Allens-MacBook-Air:bst thomasallen$ [COLOR=#0000ff]./bstl.osx rgb_led.binary[/COLOR]
    Brads SpinTool Loader v0.05 - Copyright 2008,2009 All rights reserved
    Compiled for i386 Darwin at 09:34:59 on 2009/07/03
    Found a USB Serial Device
    [COLOR=#ff0000]Binary Checksum Invalid![/COLOR]
    
    Thomas-Allens-MacBook-Air:bst thomasallen$ ls
    bst.app            bstc.osx        rgb_led.binary
    bst_manual_0.04.pdf    bstl.osx        rgb_led.eeprom
    
    Thomas-Allens-MacBook-Air:bst thomasallen$ [COLOR=#020FC0]./bstl.osx rgb_led.eeprom[/COLOR]
    Brads SpinTool Loader v0.05 - Copyright 2008,2009 All rights reserved
    Compiled for i386 Darwin at 09:34:59 on 2009/07/03
    Found a USB Serial Device
    [COLOR=#008000]Propeller Version 1 Found![/COLOR]
    Thomas-Allens-MacBook-Air:bst thomasallen$ [/FONT][/SIZE]
    
  • Brian RileyBrian Riley Posts: 626
    edited 2012-03-14 09:14
    Speaking of bST on an iMac. I have a mid-JUly 2011 iMac ( 2.5 GHZ 4 core I5 w 16 GB RAM) running the latest Lion (10.7.3) Does any one have BST running under Lion. I open bST and get the splash screen but no code window. I do a "new" or an 'open' and select a file and still get no code screen.

    ... inquiring (and frustrated) mind wants to know ;-)
  • mindrobotsmindrobots Posts: 6,506
    edited 2012-03-14 09:34
    Brian,

    I've tried BST on my 2011 mac-mini with Lion and it acted strangely. Problems with sizing bars on windows and lost focus on some controls. I need to try it again (from home) so I can post some details. I also need to check if I'm on 10.7.3

    I got distracted since I last tried it. :smile:
  • dgatelydgately Posts: 1,633
    edited 2012-03-14 09:40
    Speaking of bST on an iMac. I have a mid-JUly 2011 iMac ( 2.5 GHZ 4 core I5 w 16 GB RAM) running the latest Lion (10.7.3) Does any one have BST running under Lion. I open bST and get the splash screen but no code window. I do a "new" or an 'open' and select a file and still get no code screen.

    ... inquiring (and frustrated) mind wants to know ;-)

    I use BST on Lion, daily...

    Did you follow the instructions at: http://propeller.wikispaces.com/Propeller+Font ? This is what helped me, the first time I used BST...

    Also, page 12 of the BST manual warns:

    OSX and Linux users must download a modified version of the Propeller font. I can't stress this enough, thefont supplied with the Parallax Propeller Tool is BROKEN on Linux and OSX. If you install it by mistake, it willcause all sorts of horrible things to occur that are hard to debug. Please install the correct font. The locationof the correct font is kept up to date here : http://propeller.wikispaces.com/Propeller+Font.
    OSX users can install the font simply by double clicking on it and clicking the “Install” button.
    Linux users have to figure out where their particular distribution installs the fonts! On an Ubuntu system, theare located in ~/.fonts. The easy install is to copy the modified Propeller.ttf there and to log out and back inagain.




    To debug (a bit) your problem, try launching the application from the command-line in the Terminal app (this example assumes that BST is in the Mac's Applications directory):


    [myUser@myMac]$ /Applications/bst.app/Contents/MacOS/bst.osx

    This should show any errors in launching the app! Else, look in the console application's log window for errors
  • dgatelydgately Posts: 1,633
    edited 2012-03-14 09:50
    I was thrown off by the documentation in Brad's manual for bst, which suggests the straight syntax...
    [SIZE=1][FONT=arial narrow]brad@bkmac:~$ bstc test.spin[/FONT][/SIZE]
    

    Using the./bstl.osx syntax I was able to load a .eeprom file from the command line, but the binary (created from bst right before the .eeprom file) came back with a checksum error. Is there any advantage to one over the other?
    [SIZE=1][FONT=arial narrow]Thomas-Allens-MacBook-Air:bst thomasallen$ [COLOR=#020FC0]./bstl.osx rgb_led.binary[/COLOR]
    Brads SpinTool Loader v0.05 - Copyright 2008,2009 All rights reserved
    Compiled for i386 Darwin at 09:34:59 on 2009/07/03
    Found a USB Serial Device
    [COLOR=#ff0000]Binary Checksum Invalid![/COLOR]
    
    Thomas-Allens-MacBook-Air:bst thomasallen$ ls
    bst.app            bstc.osx        rgb_led.binary
    bst_manual_0.04.pdf    bstl.osx        rgb_led.eeprom
    
    Thomas-Allens-MacBook-Air:bst thomasallen$ [COLOR=#020FC0]./bstl.osx rgb_led.eeprom[/COLOR]
    Brads SpinTool Loader v0.05 - Copyright 2008,2009 All rights reserved
    Compiled for i386 Darwin at 09:34:59 on 2009/07/03
    Found a USB Serial Device
    [COLOR=#008000]Propeller Version 1 Found![/COLOR]
    Thomas-Allens-MacBook-Air:bst thomasallen$ [/FONT][/SIZE]
    

    Not sure, but I notice that the usage info expects a "-p 3" for an Eeprom load and run. Odd that your Eeprom load worked, but your binary (supposed to be the default) did not because of the checksum error. Try "-p 1" when you load the binary version...

    You may want to run the command-line bstc with a "-b" option to compile and create a binary. Then match that to the binary created by the BST app.


    dgately
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2012-03-14 10:45
    The -p2 does not refer to the file to be loaded. It refers to what happens to the file once the propeller has it loaded into RAM. The default is for it to run from RAM, but the -p2 causes it to burn into the Prop EEPROM and then run.

    I did what you suggested and it did compile from the command line, into a binary which then loaded successfully using bstl.
    [SIZE=1]Thomas-Allens-MacBook-Air:bst thomasallen$ [COLOR=#020FC0]./bstc.osx rgb_led.spin -b[/COLOR]
    Brads Spin Tool Compiler v0.15.3 - Copyright 2008,2009 All rights reserved
    Compiled for i386 Darwin at 08:17:49 on 2009/07/20
    Loading Object rgb_led
    Program size is 240 longs
    [COLOR=#008000]Compiled 40 Lines of Code in 0.004 Seconds[/COLOR]
    
    Thomas-Allens-MacBook-Air:bst thomasallen$ [COLOR=#020FC0]ls[/COLOR]
    bst.app            bstl.osx        rgb_led.spin
    bst_manual_0.04.pdf    rgb_led.binary        rgb_led_bst.binary
    bstc.osx        rgb_led.eeprom        rgb_led_bst2.binary
    
    Thomas-Allens-MacBook-Air:bst thomasallen$[COLOR=#020FC0] ./bstl.osx rgb_led.binary[/COLOR]
    Brads SpinTool Loader v0.05 - Copyright 2008,2009 All rights reserved
    Compiled for i386 Darwin at 09:34:59 on 2009/07/03
    Found a USB Serial Device
    [COLOR=#008000]Propeller Version 1 Found![/COLOR]
    
    Thomas-Allens-MacBook-Air:bst thomasallen$ [COLOR=#020FC0]./bstl.osx rgb_led.binary -p2[/COLOR]
    Brads SpinTool Loader v0.05 - Copyright 2008,2009 All rights reserved
    Compiled for i386 Darwin at 09:34:59 on 2009/07/03
    Found a USB Serial Device
    [COLOR=#008000]Propeller Version 1 Found![/COLOR]
    Thomas-Allens-MacBook-Air:bst thomasallen$ [/SIZE]
    

    The last syntax did load successfully to prop EEPROM.

    There must have been some problem with the original binary that I had created from the bst GUI, a fluke in the way I did it, because I went back to the GUI and did it again, and this time it's binary worked fine. Hex dumps of the good and bad file were very different.

    Incidentally, the binary file for this small test program is 244 bytes long, and from $30 to $F0 corresponds exactly to the compiler output. The eeprom file is a full 32kbytes long, most of it filled with $00.
  • dgatelydgately Posts: 1,633
    edited 2012-03-14 10:59

    Incidentally, the binary file for this small test program was 244 bytes long, whereas the eeprom file was a full 32kbytes long, most of it filled with $00.

    Yes, the Eeprom is always created with a size of 32K bytes!
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2012-03-14 11:42
    The goal here is to have a downloader on the Mac (and Linux) that is easy to use for sending firmware, no SD available. Similar to Jon's recent thread. Is there a good way to attach the terminal geekiness to an icon that can be attached to an email for a simple click and run?
  • dgatelydgately Posts: 1,633
    edited 2012-03-14 13:45
    The goal here is to have a downloader on the Mac (and Linux) that is easy to use for sending firmware, no SD available. Similar to Jon's recent thread. Is there a good way to attach the terminal geekiness to an icon that can be attached to an email for a simple click and run?


    Probably many better ways to do this, but here's a simple script (AppleScript) that could help:
    [SIZE=2][FONT=courier new]on run
    
        set theFile to choose file with prompt "Select the Eeprom file to load"
        set theUnixPath to POSIX path of theFile
        do shell script ("'/PathToYourBSTProgramFiles/bstl.osx' -p3 " & theUnixPath)
    
    end run[COLOR=#0433ff]
    [/COLOR][/FONT][/SIZE]
    

    This is an AppleScript. Open the AppleScript Editor, found in the Utilities directory on your Mac and paste the above code into the editor window. Change the "PathToYourBSTProgramFiles" to the path to where you keep the bst programs. Save this as an application or a script. With a bit more time, I'll describe a more automated way to to make this work from an email-attached file, but this is a start...

    I chose this script as a simple-to-explain solution. A much better solution would be to put the script and the Eeprom file into a single bundle that you can double-click to load the file to your prop (I'll work on that!)

    dgately
  • mindrobotsmindrobots Posts: 6,506
    edited 2012-03-14 15:04
    Curiouser and curiouser, I guess I hadn't tried bst since the latest upgrade to 10.7.3

    It starts up and gives me a menu bar...I can open things up, compile them and it works fine....I just NEVER see the main window. It's off hiding to the left someplace.

    The only way to see it is to tell bst to show all windows. It looks great then but as soon as I click anywhere on it, it rushes off to the left to disappear.

    I'll have to play more when I have more time.
  • SRLMSRLM Posts: 5,045
    edited 2012-03-14 15:22
    Just in case it is helpful, here is the script that I use on Ubuntu Linux for compiling, downloading, and opening a terminal:
    #!/bin/bash
    
    #This script will compile, download, and open a terminal
    #If any errors are encountered then it will stop at the appropriate point.
    
    echo
    echo
    
    bstc.linux -f -p0 -L lib  src/source.spin > output.txt
    cat output.txt
    
    grep -q "Error" output.txt
    if [ $? -eq 0 ]; then
       echo Found Error!
    else
       echo ----------------------------------------------------------
       echo No compiler errors...
       
       grep -q "No Propeller detected on" output.txt
       if [ $? -eq 0 ]; then
          echo Could not find Propeller chip...
       else
       
          echo
          echo
          echo To exit picocom, type C-A the C-X
          echo
       
          picocom -b 57600 /dev/ttyUSB0
       fi
    fi
    
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2012-03-14 20:37
    Wow, fun, that applescript did its duty as a app! Double clicking it on the desktop brought up the file selection dialog, and then, upon choosing a Prop binary, it successfully uploaded to the Prop eeprom and ran.

    bst.png


    (I see there is a misprint in the bst documentation where it says the options for -p are 0,1,3, but that should be 1,2,3, from ram/run to ram/eeprom/run.)

    There is this as well as other promising options available. It's nice to get a little handle on the Mac inner workings. I really liked hypercard scripting back in the day, and I was sad when that went away.

    I don't have a Linux machine at the moment but one of the people working on the project will be know more about that.
    465 x 111 - 21K
    bst.png 20.6K
  • dgatelydgately Posts: 1,633
    edited 2012-03-15 07:26
    Wow, fun, that applescript did its duty as a app! Double clicking it on the desktop brought up the file selection dialog, and then, upon choosing a Prop binary, it successfully uploaded to the Prop eeprom and ran.

    There is this as well as other promising options available. It's nice to get a little handle on the Mac inner workings. I really liked hypercard scripting back in the day, and I was sad when that went away.

    Yes, Hypercard was fun. The core of how it worked became AppleScript, but its simplicity was never replaced. I actually got a similar result to the AppleScript above using Automator which is on every Mac as well. It was more difficult to explain, so I decided to use the AppleScript example.

    Something that I did not explore was to create a "smart" folder where any binary or eeprom file dropped on it would be loaded onto the prop. This could be done in either AppleScript or Automator.

    For Linux, I'm a lot less "informed" on the how to do it. But, am fairly certain that a script similar to SRLM's could be created as double-clickable, as well!

    dgately
Sign In or Register to comment.