Brads Spin Tool - BST Solved

highplainsbubbahighplainsbubba Posts: 34
edited 2015-07-24 - 20:27:50 in Propeller 1
installed BST on Linux Mint 17.2 and it ran fine but would not connect to the Proto Board I had attached. Ran this  and it seems to see the serial converter on my USB. $ dmesg | tail[ 9889.989238] usb 2-1: Product: FT232R USB UART[ 9889.989249] usb 2-1: Manufacturer: FTDI[ 9889.989260] usb 2-1: SerialNumber: AE00BT6C[ 9889.997390] ftdi_sio 2-1:1.0: FTDI USB Serial Device converter detected[ 9889.997732] usb 2-1: Detected FT232RL[ 9889.997754] usb 2-1: Number of endpoints 2[ 9889.997773] usb 2-1: Endpoint 1 MaxPacketSize 64[ 9889.997791] usb 2-1: Endpoint 2 MaxPacketSize 64[ 9889.997810] usb 2-1: Setting MaxPacketSize 64[ 9889.999582] usb 2-1: FTDI USB Serial Device converter now attached to ttyUSB0
This is my first time to try and use BST so I don't know if I am missing something or not. Tried 2 different computers with the same results. Plugged in my Prop Scope to see if Linux saw that and  got this:
 $ dmesg | tail[ 9889.999582] usb 2-1: FTDI USB Serial Device converter now attached to ttyUSB0[10691.200413] usb 2-1: USB disconnect, device number 17[10691.201151] ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0[10691.201282] ftdi_sio 2-1:1.0: device disconnected[10730.128197] usb 2-1: new full-speed USB device number 18 using uhci_hcd[10730.324356] usb 2-1: New USB device found, idVendor=13e2, idProduct=0080[10730.324372] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3[10730.324383] usb 2-1: Product: PropScope[10730.324391] usb 2-1: Manufacturer: Parallax Inc[10730.324400] usb 2-1: SerialNumber: A601FC7H
BST does not see the Prop Scope either and sees no other ports. The "configure ports" screen is blank. Any ideas?

Comments

  • Just for giggles, check to see if you are in the dialout group.
    Type groups in the terminal. This got me one time.

    Where, oh where would we be without BST
    Thank you Brad, wherever you are!
  • installed BST on Linux Mint 17.2 and it ran fine but would not connect to the Proto Board I had attached. Ran this  and it seems to see the serial converter on my USB.
    BST does not see the Prop Scope either and sees no other ports. The "configure ports" screen is blank. Any ideas?


    Diito what Roger said, go to "users and groups" and make sure you are part of the dialout group and I even have the tty group too.
  • TorTor Posts: 2,000
    edited 2015-07-23 - 07:37:53
    ls -l /dev/ttyUSB0

    will tell you the access requirements of the device, this will usually (depending on distro) have read/write access for owner and group, and the group will often be 'dialout' as has been mentioned. But on some distros it may be something else, e.g. tty. Add yourself to whatever group it is.
    And then on a few distros the group may be root, for those unfortunate systems you may have to do 'chmod a+rw /dev/ttyUSB0'.  Or change its group, possibly having to fiddle with udev. Hopefully your distro is not among those.

    -Tor

  • You guys were on to something with your suggestions. Joined the tty and dialout groups, rebooted, and the ports showed up in the "Port Configuration" window. It shows ttyUSB0, and dev/ttyS30 to dev/ttyS0 in the window. I still can not connect to ttyUSB0. I think it is as Tor says in that it is in the root. 
    Now I have : $ ls -l /dev/ttyUSB0crw-rw---- 1 root dialout 188, 0 Jul 23 12:56 /dev/ttyUSB0
     $ chmod a+rw /dev/ttyUSB0chmod: changing permissions of ‘/dev/ttyUSB0’: Operation not permitted
    Thanks for the help so far, any more ideas ?


  • I'am not linux guru. To be honest, I hate linux for this and other reasons.  But your settings seems to be right. Owner root, group is dialout. Both have permission for reading and writing. If your user is in group dialout it should work.You need to type sudo before this chmod command. Then all users should have read and write permissions.
  • The crw-rw---- says that the owner (root) and the group members (dialout), so you should have access

    what is the actual message from bst?

    Does F7 actually detect your Propeller?

    What kind of Propeller board are you using?
  • Ok, changed the permissions, rebooted, no helpchanged permissions without reboot, no helpI try to detect the Protoboard with F7. The protoboard blue led flashes when queried by the computer. The spin tool says  "We cant find a propeller on port /dev/ttyUSB0. Would you like to configure the port manually? I try to send it to ttyUSB0 manually and I get "No propeller detected"
    sudo chmod a+rw /dev/ttyUSB0[sudo] password for jackson: jackson@jackson-AOA150 ~ $ ls -l /dev/ttyUSB0crw-rw-rw- 1 root dialout 188, 0 Jul 23 15:05 /dev/ttyUSB0Just for giggles, check to see if you are in the dialout group.
    Type groups in the terminal. This got me one time.

    Where, oh where would we be without BST
    Thank you Brad, wherever you are!

    Where I am now, without BST !
  • I'm not 100% sure on this, but i'm pretty sure the file /dev/ttyUSB0 will be deleted and recreated every time you unplug your board and plug it back in (or reboot) so changing the permissions won't help. I could be wrong on that though. And in case, if you're in the dialout group then you have read/write access to it anyway.
    How are you starting bst?
    Can you show us the output of the "groups" command, just to confirm 100% that you are in fact in the dialout group.
  • Peter JakackiPeter Jakacki Posts: 9,641
    edited 2015-07-23 - 23:50:36
    Once you set the groups up right all you needed was to log out and back in the first time, no need for a reboot. As mentioned ttyUSB0 will only appear when you plug a USB serial in so it's not about permissions which wouldn't stick anyway. But you said the blue light flashed when you went to access the Prop and it returned with "No Prop found" so the port is working fine and your problem lies with the target board which, but that doesn't seem likely.

    My guess is that you have the terminal using that port while you are trying to communicate with it from BST, you can't have both, this is not a Linux issue. You must either close the terminal or close the port which in minicom is as simply as going into the menu with ^A ^P which then releases the port while it sits in the menu. Once I do my F11 from BST I just hit the ESC in minicom so I can use the port again.


    @dnalor - I guess you prefer running constant anti-virus scans with Windows instead :) I'm no Linux guru but these basic permissions in Linux are there for a reason and easy to configure.

  • TorTor Posts: 2,000
    Peter is right - all looks fine w.r.t. to the access now (being in dialout solved that, according to the 'ls -l' you posted). So it's something else, probably what Peter suggests.

    -Tor
  • Ok, figured it out. Put the protoboard on a windows machine and brought up the MS version of Prop Tool. The board wouldn't connect there either. Found that I had a power issue on the board. Didn't get the juice I needed to keep the Prop running but had enough for the green power LED. Got that straightened out and was able to connect on both Linux and MS versions. Thanks to all those who helped. Sometimes you can't see the forest for the trees. 
    I will mark this as solved if I can find where to do that. 
  • No way to do that in this forum software yet. I think it's one of their known issues on the lengthy todo list.
    Glad you solved it!
  • yetiyeti Posts: 740
    edited 2020-02-21 - 18:25:38
    I will mark this as solved if I can find where to do that. 
    When editing the 1st message of the discussion, you can modify the title line and e.g. prepend "[solved] ".
  • OK
    so i’m a dummy I have bstc.linux located in its own dir. But I cannot get it to install. I did install the 32 bit libs ia32-libs, but my efforts keep failing. I am running Mint 19.3. From the BSTC dir I have tried install get missing output file error or no such source. Any ideas?

    Jim
  • yetiyeti Posts: 740
    edited 2020-02-21 - 18:30:11
    On...
    (yeti@kumari:2)/opt/bst/bin$ lsb_release -sir
    Debian
    10
    (yeti@kumari:2)/opt/bst/bin$ uname -a
    Linux kumari 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2+deb10u2 (2019-11-11) x86_64 GNU/Linux
    
    ...it just works:
    (yeti@kumari:2)/opt/bst/bin$ ./bstc-0.15.3 -v
    Brads Spin Tool Compiler v0.15.3 - Copyright 2008,2009 All rights reserved
    Compiled for i386 Linux at 08:17:46 on 2009/07/20
    (yeti@kumari:2)/opt/bst/bin$ ./bstc-0.15.4-pre9 -v
    Brads Spin Tool Compiler v0.15.4-pre9 - Copyright 2008,2009,2010 All rights reserved
    Compiled for i386 Linux at 16:09:02 on 2010/04/21
    

    It compiles an empty dummy program:
    (and much longer stuff!)
    $ echo pub main >xyzzy.spin
    $ /opt/bst/bin/bstc xyzzy.spin 
    Brads Spin Tool Compiler v0.15.3 - Copyright 2008,2009 All rights reserved
    Compiled for i386 Linux at 08:17:46 on 2009/07/20
    Loading Object xyzzy
    Program size is 24 longs
    Compiled 1 Lines of Code in 0.001 Seconds
    

    What options do you use?
  • Currently running Mint 19.3 (x64). Went to the archive manager and loaded the ia32 library and made sure the username was in the dialout group. BST comes up and runs as it should.

    It only required the ia32 libraries and the correct group membership.
  • Peter JakackiPeter Jakacki Posts: 9,641
    edited 2020-02-23 - 13:17:03
    I also have tty group membership in Linux Mint 19.3. Remember that if you make changes to group membership, that you have to log out and back in again for it to take effect. The default Linux kernel works but I upgraded mine to 5.3 and that works too.

    peter@peter-XPS-15-9550:~/Dropbox/Tachyon/V5/KERNEL$ ./bstc tachyon5v7.spin
    Found a USB Serial Device
    Brads Spin Tool Compiler v0.15.3 - Copyright 2008,2009 All rights reserved
    Compiled for i386 Linux at 08:17:46 on 2009/07/20
    Loading Object tachyon5v7
    Program size is 32400 longs
    Compiled 2831 Lines of Code in 0.052 Seconds
    peter@peter-XPS-15-9550:~/Dropbox/Tachyon/V5/KERNEL$ uname -a
    Linux peter-XPS-15-9550 5.3.0-40-generic #32~18.04.1-Ubuntu SMP Mon Feb 3 14:05:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
    

    This is my bake recipe (make & burn it in).
    peter@peter-XPS-15-9550:~/Dropbox/Tachyon/V5/KERNEL$ cat bake
    m4 -I includes ./includes/$1.m4 > $2.spin
    ./bstc -l -b -O x -d /dev/ttyUSB$4 -D $3 -p2 -f $2.spin
    
  • Ok, I managed to get some more time to work on this. I finally realized (after rtfm) that I had not downloaded bst but the command line processor for bst. I fixed the dialout and user group issues and added la32 library. However I am unsure about where to put the bst folder so that it can be found and I can run bst. I thought I would run the “tree” command and see if that would give me an Idea. LOL 44000+ directories is a bit much to sort through and try to figure out. When you do an apt-get install command, it automatically creates a folder in the right place and installs the executable in the right place so that you can click on the name and it runs. The bst comes pre-compiled and supposed to be able to just run. No joy. I have tried to run it from “downloads” where it unzipped and created a bst folder under my username and copied it there, still no joy. Beginning to think this old dog is slow at learning new tricks. Still not ready to junk all my computers and propeller related toys and start watching daytime soaps instead.
    Jim
  • Peter JakackiPeter Jakacki Posts: 9,641
    edited 2020-02-28 - 15:08:31
    As root you could add a path or put it in one of the root folders that are searched, but I just leave bst on the desktop and make sure it has permission to execute (right clock the icon and select properties then permissions).

    I am using the command line version bstc more these days since I broke up Tachyon into smaller files and use m4 to preprocess and merge the files before passing the merged spin file to bstc. If you want to execute bst or bstc from a terminal that is opened in the same folder, then you can type ./bst or ./bstc which is what you want to type to run a file in the current directory.

    Using the terminal to launch it, at least initially is a good way to check that it is working properly and not complaining about some missing library etc.

    Here is how I could run bstc
    peter@peter-XPS-15-9550:~/Dropbox/Tachyon/V5/KERNEL$ ./bstc tachyon5v7.spin
    Found a USB Serial Device
    Brads Spin Tool Compiler v0.15.3 - Copyright 2008,2009 All rights reserved
    Compiled for i386 Linux at 08:17:46 on 2009/07/20
    Loading Object tachyon5v7
    Program size is 32400 longs
    Compiled 2831 Lines of Code in 0.406 Seconds
    peter@peter-XPS-15-9550:~/Dropbox/Tachyon/V5/KERNEL$
    

    The GUI always complains (but runs) though.
    peter@peter-XPS-15-9550:~/Desktop$ ./bst
    Gtk-Message: 01:07:35.213: Failed to load module "atk-bridge"
    
    (bst:27525): Gtk-WARNING **: 01:07:35.260: Unable to locate theme engine in module_path: "adwaita",
    [WARNING] Out of OEM specific VK codes, changing to unassigned
    [WARNING] Out of unassigned VK codes, assigning $FF
    
  • yetiyeti Posts: 740
    edited 2020-02-28 - 15:16:12
    BST (without trailing C) needs lots of X11 libs in the 32bit version. I don't want to install half of an additional 32bit X11 on my 64bitters. And I'm not a GUI guy, so I really couldn't care much less about clickycoloured IDE stuff.

    BSTC(-i386) even runs fine on PIs and siblings using qemu. Sure not a turbo in this context, but sometimes having this option may save the day.
  • TorTor Posts: 2,000
    It's nice to know that bstc runs in qemu on the Pi. I hadn't thought of that. A Pi plus a QuickStart board is even smaller than my previous approach (notebook plus QuickStart).
  • yetiyeti Posts: 740
    edited 2020-03-02 - 16:05:12
    An old table about time needed to completely build the Hive's operating system TriOS:
    Time     Computer        RAM   OS
    ======================================================
    --<bstc qemulated>------------------------------------
     4m31s   PI3-B         1024M   Raspbian/Jessie(-Pixel)
     7m30s   Cubietruck    2048M   Cubieez/Wheezy
     7m31s   PI2-B         1024M   Raspbian/Jessie(-Lite)
     8m13s   PI3-B         1024M   Devuan/Jessie-64bit
    23m18s   PI1-B+         512M   Raspbian/Jessie(-Pixel)
    --<bstc native>---------------------------------------
     0m22s   T30@2GHz      1024M   Debian/Jessie-32bit
     0m05s   T510@2.4GHz   8192M   Debian/Jessie-64bit
    ======================================================
    
    IIRC it always was a 1 thread build even if the hardware could have done better because the build was done with a purely sequential script which is a direct translation to BASH from the batch file for builds on Windows.

    A large project like TriOS can easily benefit from "make" and friends, so after changing some parts only will need a rebuild of all subtargets depending on the changed files. So don't "make clean" too often and you'll save a lot of time! Only rebuilding the changed parts even benefits less from multiple CPUs or threads. So I think, with a bit of hung well technology ("make" and friends) which every child should learn in pre school even a BSTC on QEMU on Pi1 can be a useful development environment for a P1. Well, due to the fossilised nature of BST(C) it's use should fade out. But TriOS being only buildable with BST/BSTC is a good example for such a locked-in-syndrome and sure will not be the only one. So such hacks like BSTC on QEMU will even have a future.

    ...and don't forget the newer tools that run natively or thanks to Mono in ARM systems too. But that's a topic for an own thread.
  • As Peter mentioned you can create a path for it as root, but you don't need to do that if you are the only user. I just dumped them in my home directory. You could as root, put them under /usr/local/bin (a much more acceptable alternative on a shared system) . You probably won't need to alter any environment vars like PATH as /usr/local/bin are normally already in the default path. Root will be the owner:group. You will have to change the group to user and change the permissions to rwx,r-x,r-x so that members of the users group can run it. Some may want the last part to be r--, but meh, your own box, wouldn't worry about it.

    As Peter said it will whine about a module. Just ignore it. Once BST is working you can tell it where to find all of your project pieces. The user manual is still downloadable. To see the prop, I added my user to the groups dialout and tty since I was not sure which originally worked. Can't miss with both. BST loads and compiles all my stuff, well at least until i start fooling around with it and then , well, iterate, iterate, iterate.... or RTPropM to find my goof.

    If I was doing stuff at Peters level using make files and the like, I would have copied his or a similar make entry, but I like the way the GUI operates and don't have the time to figure out how to make GVIM do all the syntax highlighting and other features of Bst, I will leave well enough alone for now (likely always).
  • OK,
    so I tried starting bst from the terminal(using ./bst) with the bst put in the Desktop folder and the following is what I get on the screen in terminal:
    hpath (may be used multiple times)
     -o <filename> - Output [.list/.eeprom/.binary/.zip] Filename (Defaults to input Filename without .spin)
     -O <options>  - Optimise Binary (HIGHLY EXPERIMENTAL!!!!!)
        a          - Enable all optmisations (Be careful! No, really)
        b          - Bigger constants (should be slightly faster at the expense of code size)
        c          - Fold Constants
        g          - Generic "safe" size optimisations for smaller/faster code, however not what the Parallax compiler will generate
        r          - Remove unused Spin Methods
        u          - Fold Unary "-" Operations on Constants if it will make the code smaller
        x          - Non-Parallax compatible extensions
     -p[012]       - Program Chip on device (-d)
        0          - Load Ram and run
        1          - Load EEProm and shutdown
        2          - Load EEProm and run
     -s            - Intersperse source in listfile (use with -l)
     -w[012]       - Error/Warning level - 0 - Errors only / 1 - Error/Warning / 2 - Error/Warning/Information (Default 0)
     -v            - Get program version information
    
    but when I double click on the bst logo on the desktop, I get nothiing.
    Jim
  • Peter JakackiPeter Jakacki Posts: 9,641
    edited 2020-03-03 - 14:45:32
    That's not bst the GUI, that's bstc the command line. This is my complete terminal dump:
    peter:V5$ ./bstc
    Brads Spin Tool Compiler v0.15.4-pre10 - Copyright 2008,2009,2010 All rights reserved
    Compiled for i386 Linux at 22:00:43 on 2010/04/21
    Program Usage :- bstc (Options) Filename[.spin]
     -a            - Create Propeller object archive zipfile
     -b            - Write .binary file
     -c            - Write .dat file for C-Compiler (Drops a <filename.dat> file)
     -d <device>   - Device to load to (Default : )
     -D <define>   - Define a pre-processor symbol (may be used multiple times)
     -e            - Write .eeprom file
     -f            - Double download baud rate
     -h            - Display this help information
     -l[sma]       - Generate listfile (s) For source code / (m) for Machine readable - Debugger style listing / (a) standard boring listfile
     -L <Lib Path> - Add a library path or file holding library path(s) to the searchpath (may be used multiple times)
     -o <filename> - Output [.list/.eeprom/.binary/.zip] Filename (Defaults to input Filename without .spin)
     -O <options>  - Optimise Binary (HIGHLY EXPERIMENTAL!!!!!)
        a          - Enable all optmisations (Be careful! No, really)
        b          - Bigger constants (should be slightly faster at the expense of code size)
        c          - Fold Constants
        g          - Generic "safe" size optimisations for smaller/faster code, however not what the Parallax compiler will generate
        r          - Remove unused Spin Methods
        u          - Fold Unary "-" Operations on Constants if it will make the code smaller
        x          - Non-Parallax compatible extensions
     -p[012]       - Program Chip on device (-d)
        0          - Load Ram and run
        1          - Load EEProm and shutdown
        2          - Load EEProm and run
     -w[012]       - Error/Warning level - 0 - Errors only / 1 - Error/Warning / 2 - Error/Warning/Information (Default 0)
     -q            - Be silent except for GCC style errors and warnings
     -v            - Get program version information
    
    peter:V5$ 
    

    vs bst the GUI
    peter:V5$ ./bst
    Gtk-Message: 00:44:57.642: Failed to load module "atk-bridge"
    [WARNING] Out of OEM specific VK codes, changing to unassigned
    [WARNING] Out of unassigned VK codes, assigning $FF
    
    
  • FINALLY!
    I finally got bst up and running. I unzipped it and copied it to the desktop. Then from the terminal I changed the directory to Desktop and ran install. That finally worked! Thanks everyone for all the help.
    Jim
  • had to install bst for a new OS so I had to go back and review what I did in this thread.
    Jim
  • BST, still the best tool for Prop1.
  • Yes, and now I use bstc as well for Tachyon preprocessor builds from the command line too.
    Don't forget too that most Linux installs are 64-bit these days and you have to install the 32-bit compatibility libraries "ia32-libs" and of course put the Prop font into your .fonts folder.

    btw, the version I use on Linux Mint 20 is this:
Sign In or Register to comment.