Regular debug statements in Spin Tools will appear in the console at the bottom of the screen. Graphical debug windows are identical to PNut/Propeller Tool.
Advantage of regular debug statements in the console is that it's a scrollable window -- in PNut anything that scrolls off screen is lost.
@macca Will you consider adding a toggle to turn off the flashing cursor in the terminal window when in character input mode? I have a display that is very dynamic and the flashing cursor sparkling all over the screen is very distracting. I prefer character mode of this program so I can have single-key commands.
@bob_g4bby said:
I don't know much about Linux: I installed Spin Tools IDE 0.54.1 on Linux Mint, following the instructions on Macca's website:-
1. Can edit SPIN2 files in Spin Tools
2. 'Show Devices' identifies my P2 Eval board on /dev/ttyUSB0
3. I can interact with Taqoz in the Serial Terminal
4. A program with some debug statements, which ran under Windows Spin Tools, appears to load to the P2EVAL, but produces no debug results in the debug window. Other programs which opened graphical debug windows in Windows do not do so in Linux Mint. When compiling the blue lights flash on the P2 Eval briefly, as though the code is uploading.
I'd appreciate any advice on how to fix this, please. (Still using Win10, but have dual booted Linux Mint as a precaution)
That's odd.
One thing you could verify is if the program actually is loaded and working by blinking a led on the board.
If that works, could be some issues with the serial port, but right now I can't think of a cause, aside from adding your user to the dialout group, but that seems already working.
If the program is PASM-only (no Spin code) remember to use asmclk or enable the clock setter option (in Preferences -> Spin2). It should not make any difference when debug is enabled since it should automatically set the proper clock mode.
Also, just to be sure, the debug is enabled when you upload with the bug icon on the toolbar, or use one of the specific Tools -> Upload with debug menu items.
Try to run spinide from the command line, if there are internal errors they may appear on the console (cd spin-tools then ./spinide).
You can also try with the command line compiler spinc (replace the serial port device with yours):
./spinc -r -d -t -p /dev/ttyUSB0 Program.spin2
The -t enters the terminal mode, you should see the debug messages but no debug windows (not supported from the command line).
@JonnyMac said:
@macca Will you consider adding a toggle to turn off the flashing cursor in the terminal window when in character input mode? I have a display that is very dynamic and the flashing cursor sparkling all over the screen is very distracting. I prefer character mode of this program so I can have single-key commands.
Yes, I'll add the option.
If you are using ANSI mode, you can turn off the cursor with ESC[?25l unfortunately there isn't a code for PST.
I was thinking to merge the terminal modes, codes are mostly compatible, except the CR that adds an LF with PST.
I have to think about that.
I'm using PST mode. For the moment, just open PST so I can watch the data without all the distracting cursor sparkles. Thanks for add the option. I have seen terminals that will treat a CR as a CR or a CR+LF. Maybe that's worth considering, too.
Off topic: Can Charles or Lewis beat the Mercedes this weekend?
@JonnyMac said:
I'm using PST mode. For the moment, just open PST so I can watch the data without all the distracting cursor sparkles. Thanks for add the option. I have seen terminals that will treat a CR as a CR or a CR+LF. Maybe that's worth considering, too.
Yes, merging the terminal modes requires some configuration settings.
Off topic: Can Charles or Lewis beat the Mercedes this weekend?
I hope so, but honestly, I think the chances are low, at least until june or so...
"... working by blinking a led on the board." - This code blinks the 8 P2-EVAL blue LEDs when run without debug using the 'play' button. When running with debug ('bug' button) two lights briefly flash, but then the program does not run - no blinking lights. This is the code used:-
pub go() | x
repeat
pinwrite(56 addpins 7, getrnd())
waitms(100)
"... if there are internal errors they may appear on the console " - No error messages appear in the console during and after spinide execution from the command line.
"... You can also try with the command line compiler spinc (replace the serial port device with yours):" - Running ./spinc -r -d -t -p /dev/ttyUSB0 blink.spin2 produced in the console:-
bob@bob-Z68X-UD3P-B3:~/spin-tools$ ./spinc -r -d -t -p /dev/ttyUSB0 blink.spin2
Spin Tools Compiler - Version 0.54.1
Copyright (c) 2021-26 Marco Maccaferri and others. All rights reserved.
Compiling...
blink.spin2
blink.spin2: 1:11 : warning : method "go" local variable "x" is not used
Program size is 9170 bytes
Uploading...
Propeller 2 on port /dev/ttyUSB0
Loading binary image to hub memory
9176 bytes sent
Verifying checksum ... OK
Entering terminal mode. CTRL-C to exit.
Cog0 INIT $0000_0000 $0000_0000 load
Cog0 INIT $0000_0F64 $0000_1860 jump
The two debug lines got through OK and the 8 blue LEDs flashed properly.
When running using SPINC as above, the expected debug lines were displayed + the blue leds flashed
When the above was tried under Windows 10 in a command window, the expected debug lines were displayed + the blue leds flashed
So SPINC behaves normally in Windows 10 and Linux Mint.
I don't have a lot of time invested in Linux Mint, so don't mind switching to another distro - what are known to work with Spin Tools IDE? Alternatively, I'm quite willing to try more experiments to get the IDE working under Mint - I'm using version 22.3, which is not that old. It's a 'would-like' for me, not a 'must-have'
Cheers, Bob
When running spinide:-
Clicking the 'Upload to RAM with Debug' button on the toolbar under Windows 10, I get the same as you + all the blue leds flash - normal operation
Clicking the 'Upload to RAM with Debug' button on the toolbar under Linux Mint v22.3, no debug display is produced and no blue leds flash - abnormal operation
Clicking the 'Upload to RAM' button on the toolbar under Windows 10, all blue leds flash - normal operation
Clicking the 'Upload to RAM' button on the toolbar under Linux Mint v22.3, all blue leds flash - normal operation
When running spinc from a terminal window, using './spinc -r -d -t -p /dev/ttyUSB0 blink.spin2' as per @macca 's hint:-
Under Windows 10, the blue leds flash and the expected debug is displayed in the terminal window
Under Linux Mint v22.3, the blue leds flash and the expected debug is displayed in the terminal window
@bob_g4bby said:
@macca thanks for all the suggestions.
"... working by blinking a led on the board." - This code blinks the 8 P2-EVAL blue LEDs when run without debug using the 'play' button. When running with debug ('bug' button) two lights briefly flash, but then the program does not run - no blinking lights. This is the code used:-
pub go() | x
repeat
pinwrite(56 addpins 7, getrnd())
waitms(100)
Well... if I'm not wrong, that program also toggles the prop-plug serial pins (62 and 63), at least for me, when run without debug I also see the prop-plug led flashing. Oddly, that doesn't happens with debug, it randomly flashes the two leds on the P2-EC board but nothing on the prop-plug.
So SPINC behaves normally in Windows 10 and Linux Mint.
That's weird, spinc and spinide are basically the same, except the UI.
I don't have a lot of time invested in Linux Mint, so don't mind switching to another distro - what are known to work with Spin Tools IDE? Alternatively, I'm quite willing to try more experiments to get the IDE working under Mint - I'm using version 22.3, which is not that old. It's a 'would-like' for me, not a 'must-have'
I'm using Ubuntu 24.04LTS, but is not a fresh install, I don't remember if I had to do something special with a fresh install.
I vaguely remember an issue with ModemManager that attempted to get control of any serial device, had to add an udev rule to get rid of it.
Checking the /etc/udev/rules.d directory I see a number of rules that includes the FTDI vendor id 0403, the most relevant, to me are these:
The /etc/udev/rules.d directory contains one file - '70-persistent-cd.rules'. (Why is it that Nemo, the file manager doesn't display folder 'etc' even when told to display hidden files - Aaaagh?!)
Sorry for the blunder in the led flash program. I've modified it to flash 4 LEDs only now, so the debug link can't be disturbed:-
I uninstalled modem manager and rebooted just in case that was needed.
The issue with Spinide remains, no 'Upload to RAM with Debug' functionality with this Linux Mint.
Since everything works under Windows 10, I'm quite happy to set this aside for now.
Many thanks for the hints and tips.
Cheers, Bob
Comments
Regular debug statements in Spin Tools will appear in the console at the bottom of the screen. Graphical debug windows are identical to PNut/Propeller Tool.
Advantage of regular debug statements in the console is that it's a scrollable window -- in PNut anything that scrolls off screen is lost.
@macca Will you consider adding a toggle to turn off the flashing cursor in the terminal window when in character input mode? I have a display that is very dynamic and the flashing cursor sparkling all over the screen is very distracting. I prefer character mode of this program so I can have single-key commands.
Thanks.
That's odd.
One thing you could verify is if the program actually is loaded and working by blinking a led on the board.
If that works, could be some issues with the serial port, but right now I can't think of a cause, aside from adding your user to the dialout group, but that seems already working.
If the program is PASM-only (no Spin code) remember to use asmclk or enable the clock setter option (in Preferences -> Spin2). It should not make any difference when debug is enabled since it should automatically set the proper clock mode.
Also, just to be sure, the debug is enabled when you upload with the bug icon on the toolbar, or use one of the specific Tools -> Upload with debug menu items.
Try to run spinide from the command line, if there are internal errors they may appear on the console (cd spin-tools then ./spinide).
You can also try with the command line compiler spinc (replace the serial port device with yours):
The -t enters the terminal mode, you should see the debug messages but no debug windows (not supported from the command line).
Always try with a small simple program.
Yes, I'll add the option.
If you are using ANSI mode, you can turn off the cursor with ESC[?25l unfortunately there isn't a code for PST.
I was thinking to merge the terminal modes, codes are mostly compatible, except the CR that adds an LF with PST.
I have to think about that.
I'm using PST mode. For the moment, just open PST so I can watch the data without all the distracting cursor sparkles. Thanks for add the option. I have seen terminals that will treat a CR as a CR or a CR+LF. Maybe that's worth considering, too.
Off topic: Can Charles or Lewis beat the Mercedes this weekend?
Yes, merging the terminal modes requires some configuration settings.
I hope so, but honestly, I think the chances are low, at least until june or so...
@macca thanks for all the suggestions.
"... working by blinking a led on the board." - This code blinks the 8 P2-EVAL blue LEDs when run without debug using the 'play' button. When running with debug ('bug' button) two lights briefly flash, but then the program does not run - no blinking lights. This is the code used:-
pub go() | x repeat pinwrite(56 addpins 7, getrnd()) waitms(100)"... if there are internal errors they may appear on the console " - No error messages appear in the console during and after spinide execution from the command line.
"... You can also try with the command line compiler spinc (replace the serial port device with yours):" - Running ./spinc -r -d -t -p /dev/ttyUSB0 blink.spin2 produced in the console:-
The two debug lines got through OK and the 8 blue LEDs flashed properly.
I added a counter to the program:-
pub go() | x, counter repeat pinwrite(56 addpins 7, getrnd()) waitms(100) counter := counter + 1 debug(udec(counter))When running using SPINC as above, the expected debug lines were displayed + the blue leds flashed
When the above was tried under Windows 10 in a command window, the expected debug lines were displayed + the blue leds flashed
So SPINC behaves normally in Windows 10 and Linux Mint.
I don't have a lot of time invested in Linux Mint, so don't mind switching to another distro - what are known to work with Spin Tools IDE? Alternatively, I'm quite willing to try more experiments to get the IDE working under Mint - I'm using version 22.3, which is not that old. It's a 'would-like' for me, not a 'must-have'
Cheers, Bob
Are you clicking the DEBUG icon on the toolbar?
This is what I get when I run that bit of code (Windows 10 Pro).
Yes @JonnyMac , just to confirm:-
When running spinide:-
Clicking the 'Upload to RAM with Debug' button on the toolbar under Windows 10, I get the same as you + all the blue leds flash - normal operation
Clicking the 'Upload to RAM with Debug' button on the toolbar under Linux Mint v22.3, no debug display is produced and no blue leds flash - abnormal operation
Clicking the 'Upload to RAM' button on the toolbar under Windows 10, all blue leds flash - normal operation
Clicking the 'Upload to RAM' button on the toolbar under Linux Mint v22.3, all blue leds flash - normal operation
When running spinc from a terminal window, using './spinc -r -d -t -p /dev/ttyUSB0 blink.spin2' as per @macca 's hint:-
Under Windows 10, the blue leds flash and the expected debug is displayed in the terminal window
Under Linux Mint v22.3, the blue leds flash and the expected debug is displayed in the terminal window
Well... if I'm not wrong, that program also toggles the prop-plug serial pins (62 and 63), at least for me, when run without debug I also see the prop-plug led flashing. Oddly, that doesn't happens with debug, it randomly flashes the two leds on the P2-EC board but nothing on the prop-plug.
That's weird, spinc and spinide are basically the same, except the UI.
I'm using Ubuntu 24.04LTS, but is not a fresh install, I don't remember if I had to do something special with a fresh install.
I vaguely remember an issue with ModemManager that attempted to get control of any serial device, had to add an udev rule to get rid of it.
Checking the /etc/udev/rules.d directory I see a number of rules that includes the FTDI vendor id 0403, the most relevant, to me are these:
70-snap.snapd.rules:754:ATTRS{idVendor}=="0403", ENV{ID_MM_DEVICE_MANUAL_SCAN_ONLY}="1" 77-bitscope.rules:7:ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", ENV{ID_MM_DEVICE_IGNORE}="1"The first should have been installed by the system as it uses snap packages, the other is for the BitScope Micro device.
Check if you have at least the snapd rule installed, or uninstall ModemManager (should be package name modemmanager).
The /etc/udev/rules.d directory contains one file - '70-persistent-cd.rules'. (Why is it that Nemo, the file manager doesn't display folder 'etc' even when told to display hidden files - Aaaagh?!)
Sorry for the blunder in the led flash program. I've modified it to flash 4 LEDs only now, so the debug link can't be disturbed:-
pub go() | x, counter repeat pinwrite(56 addpins 3, getrnd()) waitms(100) counter := counter + 1 debug(udec(counter))I uninstalled modem manager and rebooted just in case that was needed.
The issue with Spinide remains, no 'Upload to RAM with Debug' functionality with this Linux Mint.
Since everything works under Windows 10, I'm quite happy to set this aside for now.
Many thanks for the hints and tips.
Cheers, Bob