@macca said:
No, I can look into proploader sources if can be integrated, however I don't have wifi-enabled devices so don't know how to test.
Can I send you a WiFi module- would that help? Or I'm ready to test anything, or send more details or a demo video/zoom meet-look-test/etc...,
I think having built-in WiFi programming would be very cool - I use it often, and would like to promote it more.
Had a quick look to proploader sources. The protocol doesn't seems complicated, can be done, however it won't be a quick implementation, there are several things to adapt.
I have an ESP8266 module somewhere, maybe I can upload the Parallax firmware to do some initial tests, but a real board will help a lot.
@VonSzarvas said:
Also to round out the instructions on proploader.exe
To run code on a single WiFi module on your network, it's enough to do proploader.exe <binary_filename>
With multiple WiFi modules you'd probably want to use detect first: proploader.exe -W
And then use the IP to target a specific module proploader.exe -i <ip-addr> <binary_filename>
To save to EEPROM and run, add couple tags: proploader.exe -e -r <binary_filename>
That's about all I ever use. Many of the other proploader options are related to programming devices connected via a serial port.
Currently, Spin Tools IDE will attempt to upload to the last selected serial port, if there isn't a propeller then it searches all available serial ports and uploads to the first propeller found. I think I can do the same with the WiFi upload, maybe with some additional settings to skip the discovery if the user doesn't have WiFi modules.
I was also looking at the external tools, it should work however there may be a complication: the compiled binary file is not saved automatically (compile takes place in memory only) so you need to first save the binary from the informations dialog, then run the external proploader.
Hi @macca, thanks for your support of Spin Tools IDE, I am running V0.40.0 on a P2 processor.
My program was in MAIN() and had an OBJ called I2C defined.
I was trying to use a constant defined in the I2C object by calling it with the object name as a prefix, as I have done a few times before.
In this particular object the Constants all used "_" (underscore) prefixes which have not caused me a problem till now.
I tried to use "i2c._VI_A" but it failed giving this error:-
Note the above is just a simple test line I added to prove the error always ocurs.
If I change the constants name so it starts with anything other than an underscore it seems to work ok, but underscores fail in all cases I have tried, if called with an object name as a prefix?
This isn't something I do a lot but perhaps it breaks some rules I am not aware of but it does work in Propeller tool 2.9.3
Thanks for your help with this, it isn't something urgent I just thought you should know.
@lab_ges said:
Hi @macca, thanks for your support of Spin Tools IDE, I am running V0.40.0 on a P2 processor.
My program was in MAIN() and had an OBJ called I2C defined.
I was trying to use a constant defined in the I2C object by calling it with the object name as a prefix, as I have done a few times before.
In this particular object the Constants all used "_" (underscore) prefixes which have not caused me a problem till now.
I tried to use "i2c._VI_A" but it failed giving this error:-
Note the above is just a simple test line I added to prove the error always ocurs.
If I change the constants name so it starts with anything other than an underscore it seems to work ok, but underscores fail in all cases I have tried, if called with an object name as a prefix?
This isn't something I do a lot but perhaps it breaks some rules I am not aware of but it does work in Propeller tool 2.9.3
Thanks for your help with this, it isn't something urgent I just thought you should know.
Yes, seems there is an issue with the tokenizer, I'll look at it.
Thanks.
Anyone working with C ?
I'm putting some "getting started" demos together, and need some help to get started myself
Looking for an example that includes pin high/low/toggle/read, pause X milliseconds, and also running a function in a new cog ?
Doesn't matter if it's part of something larger- I can trim out what I need.
So far I started with the Spin Tools IDE "P1/C" template. Can't see there's any libraries to include with the distribution... what do you guys use... libs from SimpleIDE perhaps?
Anyone working with C ?
I'm putting some "getting started" demos together, and need some help to get started myself
Looking for an example that includes pin high/low/toggle/read, pause X milliseconds, and also running a function in a new cog ?
Doesn't matter if it's part of something larger- I can trim out what I need.
So far I started with the Spin Tools IDE "P1/C" template. Can't see there's any libraries to include with the distribution... what do you guys use... libs from SimpleIDE perhaps?
There is a en example i2c_scanner.c in the examples/P2 folder (sorry, no P1 examples, but I think it can be compiled for P1 too), that also shows how to use the standard Spin objects in the C source.
Beware that the C implementation is very limited, it can run some simple programs but some not-so-simple C statements aren't implemented.
If you need a more complete implementation I strongly suggest to use flexspin.
@macca said:
Beware that the C implementation is very limited, it can run some simple programs but some not-so-simple C statements aren't implemented.
If you need a more complete implementation I strongly suggest to use flexspin.
I've added flexspin to the tools menu. Seems to work ok so far. Once I got past the usual C library link dance
Sure is handy to have the external tools feature.
I've just added my favourite serial terminal too having see the advice a couple threads back.
Alt-Cool! Thank you.
Hi @macca,
Great work so far also for Mac users to have a native development environment for the Propeller, especially since your tool supports the debugger.
I have tried your new version (0.40 for Mac Silicon) and found some little issues and one big problem at least for me.
There is a minor issue on save binary. If one change the file name the file is saved with file extension .bin instead of .binary. If the file name is unchanged it is working as expected.
Additional I found that the replace all function in the dialog find/replace is not working. The error "java.lang.IllegalArgumentException: Index out of bounds" is shown in the error details. Sometimes also on find this error occurs if you search for a not existing string in the file.
Then I tried to run my automated test code which uses only spin code with debug and it was not working. When I look in the .lst file I can see that there are a bunch of methods missing. It looks like that your compiler does some optimization and is generating code only for methods which are used in the code anywhere but not for unused methods. This is different to the compiler of Propeller Tool/PNut and does not work for my automated tests which calls test methods dynamically.
I have attached my code. Hence, you can check if you can make it working also with the Spin Tools IDE.
I keep getting errors. Cannot close the error message. Cannot close the serial terminal. Cant kill the program. Ctrl alt delete task manager does not see the program so I have to reboot my computer to kill it.
Cannot use the program. It was suggersted by the support team that I use your program instead of the Propeller Tool as it is not working either.
I tried to open a simple program for P1 that had fullduplexserial in it as an obj. Your program blew up. I am trying to show you the errors as best I can.
No offense please is this probram in beta??
I like the format but wish I could get it to work.
This appears to be the same type of error as I uploaded the last time. Is there something that I am missing. Do you have a synopsis about how to use the program?
I am running on windows 11 pro.
@Kaio said:
Hi @macca,
Great work so far also for Mac users to have a native development environment for the Propeller, especially since your tool supports the debugger.
Thank you.
I have tried your new version (0.40 for Mac Silicon) and found some little issues and one big problem at least for me.
There is a minor issue on save binary. If one change the file name the file is saved with file extension .bin instead of .binary. If the file name is unchanged it is working as expected.
Additional I found that the replace all function in the dialog find/replace is not working. The error "java.lang.IllegalArgumentException: Index out of bounds" is shown in the error details. Sometimes also on find this error occurs if you search for a not existing string in the file.
I'll look at that.
Then I tried to run my automated test code which uses only spin code with debug and it was not working. When I look in the .lst file I can see that there are a bunch of methods missing. It looks like that your compiler does some optimization and is generating code only for methods which are used in the code anywhere but not for unused methods. This is different to the compiler of Propeller Tool/PNut and does not work for my automated tests which calls test methods dynamically.
Oh.. that's a very interesting implementation, you are poking the object header directly to find and execute methods.
Yes, you are right, Spin Tools IDE automatically removes unused methods from the compiled binary, since your code doesn't invokes the methods directly, the compiler has no ways to know that a method is used. I don't have a solution, except to use a list of method pointers to test instead of poking the header.
There is a command line compiler too that doesn't remove unused methods by default (I'm using it to recompile the examples and libraries for the tests), unfortunately I haven't included command for the Mac builds, I don't know if the linux shell script works for Mac. If you have a Linux or Windows machine to test, you can try the spinc command.
I guess I need to add the remove unused methods flags back to the IDE.
I keep getting errors. Cannot close the error message. Cannot close the serial terminal. Cant kill the program. Ctrl alt delete task manager does not see the program so I have to reboot my computer to kill it.
Cannot use the program. It was suggersted by the support team that I use your program instead of the Propeller Tool as it is not working either.
I tried to open a simple program for P1 that had fullduplexserial in it as an obj. Your program blew up. I am trying to show you the errors as best I can.
No offense please is this probram in beta??
I like the format but wish I could get it to work.
This appears to be the same type of error as I uploaded the last time. Is there something that I am missing. Do you have a synopsis about how to use the program?
I am running on windows 11 pro.
What version are you using (it is in the Help -> About dialog) ?
From the stack trace on the last image, the source doesn't seems to line-up with the current source.
Make sure to use the latest version which can be downloaded either from my web site or github:
@macca
0.33.0 version
I gave you all I could understand. The error message was produced 10 times in 10 windows and all looked the same.
Please explain source?
I will download and see what I get from your website.
Thanks
Martin
@pilot0315 said:
@macca
0.33.0 version
I gave you all I could understand. The error message was produced 10 times in 10 windows and all looked the same.
Please explain source?
I will download and see what I get from your website.
That's a very old version, please update to the latest 0.40.0 and try again.
(about the source, it is a way to know where the error is, that kind of dialogs should never appear)
@Kaio You should be able to fool the optimizer into not removing methods by adding a call to every method under an if (always false, but the compiler can't prove it) at the beginning of the program.
@Electrodude said:
@Kaio You should be able to fool the optimizer into not removing methods by adding a call to every method under an if (always false, but the compiler can't prove it) at the beginning of the program.
@Electrodude, thanks for your suggestion, but this is only a workaround I don't want to do. The idea of a test framework is not to write a method which calls all necessary test case methods. Instead the developer needs only to write the test cases in some methods. The execution of these methods is handled by the test framework itself.
@Kaio said:
1. There is a minor issue on save binary. If one change the file name the file is saved with file extension .bin instead of .binary. If the file name is unchanged it is working as expected.
I tested it with the Windows version and found there is another behavior as on Mac. The Windows save dialog shows two file types (bin and binary) and by default the file name is extended with the file type binary.
On the Mac the details of the file type are not presented in the save dialog and the file name is not extended with a file type in the dialog (see screen shot). My suggestion would be to have only one file type (binary). Then it would work also on Mac as expected.
Additional I found that the replace all function in the dialog find/replace is not working. The error "java.lang.IllegalArgumentException: Index out of bounds" is shown in the error details. Sometimes also on find this error occurs if you search for a not existing string in the file.
I'll look at that.
With the Windows version the replace all function is working. Looks like an issue only on Mac.
Then I tried to run my automated test code which uses only spin code with debug and it was not working. ...
There is a command line compiler too that doesn't remove unused methods by default (I'm using it to recompile the examples and libraries for the tests), unfortunately I haven't included command for the Mac builds, I don't know if the linux shell script works for Mac. If you have a Linux or Windows machine to test, you can try the spinc command.
I tested the spinc command of the Windows version and I was able to run the test code successful. (see attached log).
It would be nice if you would provide the spinc command also in the Mac version. I will check the linux shell script on Mac and give you feedback later.
I guess I need to add the remove unused methods flags back to the IDE.
Hi @macca,
I was able to run the spinc script on my Mac with a little rework of collecting the java libs. It should be located in the MacOS folder of the Spin Tools IDE. Attached you'll find the modified version.
My test code is now working via the spinc script.
On the Windows version the spinc command was executed in the current working directory. This is not the case on the Mac. It would be nice if you could execute it on the Mac also from working directory. Otherwise the binary or lst file will not be saved to the right location. For my test I implemented the change to the working directory in the script just to have it working.
From the logging of spinc It looks like that the upload to the Propeller is a little bit sticky but it is working. Maybe you can add more detailed logging to find the problem. Then I can try and can give you feedback.
From Java code the logging on upload looks as expected, but on the Windows version it was not logged during my test.
@Kaio said:
I was able to run the spinc script on my Mac with a little rework of collecting the java libs. It should be located in the MacOS folder of the Spin Tools IDE. Attached you'll find the modified version.
My test code is now working via the spinc script.
Awesome! I'll add the script in the next release. Thank you!
I think there is a function to get the parent directory without change dir, but it is good for now.
On the Windows version the spinc command was executed in the current working directory. This is not the case on the Mac. It would be nice if you could execute it on the Mac also from working directory. Otherwise the binary or lst file will not be saved to the right location. For my test I implemented the change to the working directory in the script just to have it working.
Suggestion on how to do that ?
I think that the script "trick" is the only way. There is the same issue with the IDE, if I'm not wrong.
From Java code the logging on upload looks as expected, but on the Windows version it was not logged during my test.
You mean it doesn't log the upload or the debug output from the program ?
I tested it with the Windows version and found there is another behavior as on Mac. The Windows save dialog shows two file types (bin and binary) and by default the file name is extended with the file type binary.
On the Mac the details of the file type are not presented in the save dialog and the file name is not extended with a file type in the dialog (see screen shot). My suggestion would be to have only one file type (binary). Then it would work also on Mac as expected.
Seems that the default extension is added by the Mac dialog itself and takes the first on the list (it is listed as .bin;.binary) maybe swapping the extension will fix it.
With the Windows version the replace all function is working. Looks like an issue only on Mac.
Could be a notification from the UI that is fired on the Mac but not on other OS. Do you get a stack trace with the OutOfBounds exception ? May help to find the exact error location.
I can swear that in the recent past I saw a thread that discussed using flexspin as an external tool. Was that a dream? I'm trying to not recreate prior work if possible. Also, most of you are light years ahead of me especially when using Spin as a language. Any guidance on this? Early Happy Thanksgiving to my US located compatriots! Thanks in advance!
@pmrobert said:
I can swear that in the recent past I saw a thread that discussed using flexspin as an external tool. Was that a dream? I'm trying to not recreate prior work if possible. Also, most of you are light years ahead of me especially when using Spin as a language. Any guidance on this? Early Happy Thanksgiving to my US located compatriots! Thanks in advance!
-Mike R...
You did. Go back to page 14 (post #415) for the start of the discussion on external tools. I use PNut as an external compiler.
@pmrobert said:
I can swear that in the recent past I saw a thread that discussed using flexspin as an external tool. Was that a dream? I'm trying to not recreate prior work if possible. Also, most of you are light years ahead of me especially when using Spin as a language. Any guidance on this? Early Happy Thanksgiving to my US located compatriots! Thanks in advance!
-Mike R...
You did. Go back to page 14 (post #415) for the start of the discussion on external tools. I use PNut as an external compiler.
Jon, thank you ever so much! I assure you I did look high and low for that exact page today in the early morning hours. I must have inadvertently skipped from page 13 to 15. My current project is translating my EFI (Electronic Control Unit, provides very precise fuel and spark for spark ignited internal combustion engines) project into Spin 2, mainly due to easier access to your very fine and very comprehensive jm_* set of Spin functions. I had been translating some of your jm_* functions into C then decided to take a different path hence where I am now. I'm going to recode the whole thing into Spin 2 and benchmark both bytecode and Flex-compiled versions. Maybe bytecode will be fast enough, we'll see. My current C implementation is accurate to a few tens of microseconds on very critical ignition timing which translates to a couple of tenths of a degree of crankshaft rotation at 12000 RPM and I'm thinking compiled Spin 2 will easily perform as well or better. Marco and Jon - I apologize for threadcrapping and will likely start my own thread specific to my project. Again, I thank both of you ever so much.
The compiled code from FlexProp will be faster -- the question becomes... do you give up code density for speed that's not buying you anything? In some cases, the answer will be "Yes." In my P1 laser tag code we have to count on non-Parallax Spin compilers (BST, now Spin Tools) that will do dead code removal so that our program will fit into the EEPROM. With the P2 memory there is less concern about code density, but it's a habit thing for me. And with the ability to do inline assembly I seen no need use a full compiler in the work I do.
Good luck with your project, Mike. I'm glad you find my libraries useful.
@Kaio said:
On the Windows version the spinc command was executed in the current working directory. This is not the case on the Mac. It would be nice if you could execute it on the Mac also from working directory. Otherwise the binary or lst file will not be saved to the right location. For my test I implemented the change to the working directory in the script just to have it working.
Suggestion on how to do that ?
I think that the script "trick" is the only way. There is the same issue with the IDE, if I'm not wrong.
I saw that you already use the directory method on ProcessBuilder to set the working directory. I tried it again and found that it is working correct also on Mac. What me confused before was that the binary is not shown in the file tree of the IDE. But no problem for me.
From Java code the logging on upload looks as expected, but on the Windows version it was not logged during my test.
You mean it doesn't log the upload or the debug output from the program ?
Yes, on Windows the remaining bytes on upload was not logged in the console window (attached again). I don't know why. Therefore I was confused by these detailed log as I was trying it on the Mac.
I tested it with the Windows version and found there is another behavior as on Mac. The Windows save dialog shows two file types (bin and binary) and by default the file name is extended with the file type binary.
On the Mac the details of the file type are not presented in the save dialog and the file name is not extended with a file type in the dialog (see screen shot). My suggestion would be to have only one file type (binary). Then it would work also on Mac as expected.
Seems that the default extension is added by the Mac dialog itself and takes the first on the list (it is listed as .bin;.binary) maybe swapping the extension will fix it.
Yes, this should also work.
With the Windows version the replace all function is working. Looks like an issue only on Mac.
Could be a notification from the UI that is fired on the Mac but not on other OS. Do you get a stack trace with the OutOfBounds exception ? May help to find the exact error location.
I have tried it again and now it was surprisingly working. Don't know why there was an issue before. If it occurs again I will report the stack trace.
What I found now during more using the IDE on Mac was, that there is no caret shown in any input field in the find/replace and settings/preferences dialog. It is simply invisible but if one click anywhere in the field one can edit existing text. In the editor window it is shown and working as expected.
@Kaio said:
On the Windows version the spinc command was executed in the current working directory. This is not the case on the Mac. It would be nice if you could execute it on the Mac also from working directory. Otherwise the binary or lst file will not be saved to the right location. For my test I implemented the change to the working directory in the script just to have it working.
Suggestion on how to do that ?
I think that the script "trick" is the only way. There is the same issue with the IDE, if I'm not wrong.
I saw that you already use the directory method on ProcessBuilder to set the working directory. I tried it again and found that it is working correct also on Mac. What me confused before was that the binary is not shown in the file tree of the IDE. But no problem for me.
Oh, ok, maybe I should think of adding some configuration option to filter the tree content.
Yes, on Windows the remaining bytes on upload was not logged in the console window (attached again). I don't know why. Therefore I was confused by these detailed log as I was trying it on the Mac.
The byte count should be displayed on the same line and replaced with the total byte count at the end, it is very fast with the P2. I think you need to redirect the output to see each line.
Could be a notification from the UI that is fired on the Mac but not on other OS. Do you get a stack trace with the OutOfBounds exception ? May help to find the exact error location.
I have tried it again and now it was surprisingly working. Don't know why there was an issue before. If it occurs again I will report the stack trace.
Ok.
What I found now during more using the IDE on Mac was, that there is no caret shown in any input field in the find/replace and settings/preferences dialog. It is simply invisible but if one click anywhere in the field one can edit existing text. In the editor window it is shown and working as expected.
That's really weird... I don't know if matters, but if I'm not wrong you are using a dark theme, I don't know if you set the theme in the application or is system-wide but can you try the light theme ? Maybe the caret is just the wrong color due to the theme for some reasons.
I slightly modified your spinc script to remove the directory change, let me know if works for you.
@Kaio said:
Yes, on Windows the remaining bytes on upload was not logged in the console window (attached again). I don't know why. Therefore I was confused by these detailed log as I was trying it on the Mac.
The byte count should be displayed on the same line and replaced with the total byte count at the end, it is very fast with the P2. I think you need to redirect the output to see each line.
Ahh, it should be written on the same line until the upload is finished. Then this was not working correctly in the console window on Mac as there were all logging lines from upload visible afterwards. Looks like there was additional a newline printed instead of a carriage return only.
The logging of my test code from the Propeller was correct and the same on both OS versions.
What I found now during more using the IDE on Mac was, that there is no caret shown in any input field in the find/replace and settings/preferences dialog. It is simply invisible but if one click anywhere in the field one can edit existing text. In the editor window it is shown and working as expected.
That's really weird... I don't know if matters, but if I'm not wrong you are using a dark theme, I don't know if you set the theme in the application or is system-wide but can you try the light theme ? Maybe the caret is just the wrong color due to the theme for some reasons.
Good point. I'm using the auto mode for the theme on the OS. In the IDE I switched to light theme as I want to see the background colors in the editor window. Now I tested different modes and found that the caret is only invisible if the OS is in dark mode and the IDE is using light theme.
If both (OS and IDE) are using the same mode all is working fine. This is independent from using the system theme in the IDE preferences. On my tests before I was mostly working at the evening, therefore the OS was using the dark mode. Now as I know the root cause I know also a workaround. It would be interesting if this issue also exists on the other OS versions.
I have attached screen shots of the IDE with dark and light theme. So, you can see how it looks like at all on Mac (Silicon). As you can see on the picture with light theme that the window on the upper frame is dark, the same for the find/replace dialog. This indicates that the OS is using the dark mode where the caret is missing. If the OS is using the light mode this frame is also light.
I slightly modified your spinc script to remove the directory change, let me know if works for you.
Often when navigating the code window I find myself inadvertently jumping to a code definition.
Seems my left finger is often pressing the CTRL key too fast, or even holding it mid-operation, especially when copy-pasting things a lot.
I guess I'm jumping the gun by pressing CTRL whilst still mouse-highlighting code to copy, rather than waiting to finish the row highlight, taking a breath, and then pressing CTRL+C.
Would there be a better key for the jump-to-code feature? Maybe shift or alt ? (leaning toward alt as favourite)
A key that we rarely use whilst coding combined with a mouse operation, but is close-by ?
I guess the ship sailed on a fixed change, but could a user-hotkey override be added to the Editor preferences?
Is anyone having issues on the latest MACOS version 15.1.1 ? I have uninstalled re-installed and I always get this message: JavaAppLauncher quit unexpectedly.
However If I open terminal and run JavaAppLauncher, it runs just fine.
Often when navigating the code window I find myself inadvertently jumping to a code definition.
Seems my left finger is often pressing the CTRL key too fast, or even holding it mid-operation, especially when copy-pasting things a lot.
I guess I'm jumping the gun by pressing CTRL whilst still mouse-highlighting code to copy, rather than waiting to finish the row highlight, taking a breath, and then pressing CTRL+C.
Ops.. I see what happens, never thought about it because I never select text with the mouse (shift+cursor keys).
Would there be a better key for the jump-to-code feature? Maybe shift or alt ? (leaning toward alt as favourite)
A key that we rarely use whilst coding combined with a mouse operation, but is close-by ?
Or, I can fix the issue.
I guess the ship sailed on a fixed change, but should a user-hotkey override be added to the Editor preferences?
Sooner or later I'll add a key configuration page (more later than soon).
Comments
Had a quick look to proploader sources. The protocol doesn't seems complicated, can be done, however it won't be a quick implementation, there are several things to adapt.
I have an ESP8266 module somewhere, maybe I can upload the Parallax firmware to do some initial tests, but a real board will help a lot.
Currently, Spin Tools IDE will attempt to upload to the last selected serial port, if there isn't a propeller then it searches all available serial ports and uploads to the first propeller found. I think I can do the same with the WiFi upload, maybe with some additional settings to skip the discovery if the user doesn't have WiFi modules.
I was also looking at the external tools, it should work however there may be a complication: the compiled binary file is not saved automatically (compile takes place in memory only) so you need to first save the binary from the informations dialog, then run the external proploader.
Hi @macca, thanks for your support of Spin Tools IDE, I am running V0.40.0 on a P2 processor.
My program was in MAIN() and had an OBJ called I2C defined.
I was trying to use a constant defined in the I2C object by calling it with the object name as a prefix, as I have done a few times before.
In this particular object the Constants all used "_" (underscore) prefixes which have not caused me a problem till now.
I tried to use "i2c._VI_A" but it failed giving this error:-
Note the above is just a simple test line I added to prove the error always ocurs.
If I change the constants name so it starts with anything other than an underscore it seems to work ok, but underscores fail in all cases I have tried, if called with an object name as a prefix?
This isn't something I do a lot but perhaps it breaks some rules I am not aware of but it does work in Propeller tool 2.9.3
Thanks for your help with this, it isn't something urgent I just thought you should know.
Yes, seems there is an issue with the tokenizer, I'll look at it.
Thanks.
Hey Spin Tools fans!
Anyone working with C ?
I'm putting some "getting started" demos together, and need some help to get started myself
Looking for an example that includes pin high/low/toggle/read, pause X milliseconds, and also running a function in a new cog ?
Doesn't matter if it's part of something larger- I can trim out what I need.
So far I started with the Spin Tools IDE "P1/C" template. Can't see there's any libraries to include with the distribution... what do you guys use... libs from SimpleIDE perhaps?
There is a en example i2c_scanner.c in the examples/P2 folder (sorry, no P1 examples, but I think it can be compiled for P1 too), that also shows how to use the standard Spin objects in the C source.
Beware that the C implementation is very limited, it can run some simple programs but some not-so-simple C statements aren't implemented.
If you need a more complete implementation I strongly suggest to use flexspin.
I've added flexspin to the tools menu. Seems to work ok so far. Once I got past the usual C library link dance
Sure is handy to have the external tools feature.
I've just added my favourite serial terminal too having see the advice a couple threads back.
Alt-Cool! Thank you.
Hi @macca,
Great work so far also for Mac users to have a native development environment for the Propeller, especially since your tool supports the debugger.
I have tried your new version (0.40 for Mac Silicon) and found some little issues and one big problem at least for me.
I have attached my code. Hence, you can check if you can make it working also with the Spin Tools IDE.
Best regards,
Thomas
@macca
@"Ken Gracey"
I keep getting errors. Cannot close the error message. Cannot close the serial terminal. Cant kill the program. Ctrl alt delete task manager does not see the program so I have to reboot my computer to kill it.
Cannot use the program. It was suggersted by the support team that I use your program instead of the Propeller Tool as it is not working either.
I tried to open a simple program for P1 that had fullduplexserial in it as an obj. Your program blew up. I am trying to show you the errors as best I can.
No offense please is this probram in beta??
I like the format but wish I could get it to work.
This appears to be the same type of error as I uploaded the last time. Is there something that I am missing. Do you have a synopsis about how to use the program?
I am running on windows 11 pro.
Thanks.
Martin
Thank you.
I'll look at that.
Oh.. that's a very interesting implementation, you are poking the object header directly to find and execute methods.
Yes, you are right, Spin Tools IDE automatically removes unused methods from the compiled binary, since your code doesn't invokes the methods directly, the compiler has no ways to know that a method is used. I don't have a solution, except to use a list of method pointers to test instead of poking the header.
There is a command line compiler too that doesn't remove unused methods by default (I'm using it to recompile the examples and libraries for the tests), unfortunately I haven't included command for the Mac builds, I don't know if the linux shell script works for Mac. If you have a Linux or Windows machine to test, you can try the spinc command.
I guess I need to add the remove unused methods flags back to the IDE.
What version are you using (it is in the Help -> About dialog) ?
From the stack trace on the last image, the source doesn't seems to line-up with the current source.
Make sure to use the latest version which can be downloaded either from my web site or github:
https://www.maccasoft.com/spin-tools-ide/
https://github.com/maccasoft/spin-tools/releases
Aso, if possible, always include a small source that shows the issue.
And yes, Spin Tools IDE is a beta-level software.
@macca
0.33.0 version
I gave you all I could understand. The error message was produced 10 times in 10 windows and all looked the same.
Please explain source?
I will download and see what I get from your website.
Thanks
Martin
That's a very old version, please update to the latest 0.40.0 and try again.
(about the source, it is a way to know where the error is, that kind of dialogs should never appear)
Thank you.
@Kaio You should be able to fool the optimizer into not removing methods by adding a call to every method under an
if (always false, but the compiler can't prove it)
at the beginning of the program.@Electrodude, thanks for your suggestion, but this is only a workaround I don't want to do. The idea of a test framework is not to write a method which calls all necessary test case methods. Instead the developer needs only to write the test cases in some methods. The execution of these methods is handled by the test framework itself.
Thanks @macca.
I tested it with the Windows version and found there is another behavior as on Mac. The Windows save dialog shows two file types (bin and binary) and by default the file name is extended with the file type binary.
On the Mac the details of the file type are not presented in the save dialog and the file name is not extended with a file type in the dialog (see screen shot). My suggestion would be to have only one file type (binary). Then it would work also on Mac as expected.
With the Windows version the replace all function is working. Looks like an issue only on Mac.
I tested the spinc command of the Windows version and I was able to run the test code successful. (see attached log).
It would be nice if you would provide the spinc command also in the Mac version. I will check the linux shell script on Mac and give you feedback later.
This would be nice to have.
Hi @macca,
I was able to run the spinc script on my Mac with a little rework of collecting the java libs. It should be located in the MacOS folder of the Spin Tools IDE. Attached you'll find the modified version.
My test code is now working via the spinc script.
On the Windows version the spinc command was executed in the current working directory. This is not the case on the Mac. It would be nice if you could execute it on the Mac also from working directory. Otherwise the binary or lst file will not be saved to the right location. For my test I implemented the change to the working directory in the script just to have it working.
From the logging of spinc It looks like that the upload to the Propeller is a little bit sticky but it is working. Maybe you can add more detailed logging to find the problem. Then I can try and can give you feedback.
From Java code the logging on upload looks as expected, but on the Windows version it was not logged during my test.
Awesome! I'll add the script in the next release. Thank you!
I think there is a function to get the parent directory without change dir, but it is good for now.
Suggestion on how to do that ?
I think that the script "trick" is the only way. There is the same issue with the IDE, if I'm not wrong.
You mean it doesn't log the upload or the debug output from the program ?
Seems that the default extension is added by the Mac dialog itself and takes the first on the list (it is listed as .bin;.binary) maybe swapping the extension will fix it.
Could be a notification from the UI that is fired on the Mac but not on other OS. Do you get a stack trace with the OutOfBounds exception ? May help to find the exact error location.
I can swear that in the recent past I saw a thread that discussed using flexspin as an external tool. Was that a dream? I'm trying to not recreate prior work if possible. Also, most of you are light years ahead of me especially when using Spin as a language. Any guidance on this? Early Happy Thanksgiving to my US located compatriots! Thanks in advance!
-Mike R...
You did. Go back to page 14 (post #415) for the start of the discussion on external tools. I use PNut as an external compiler.
Jon, thank you ever so much! I assure you I did look high and low for that exact page today in the early morning hours. I must have inadvertently skipped from page 13 to 15. My current project is translating my EFI (Electronic Control Unit, provides very precise fuel and spark for spark ignited internal combustion engines) project into Spin 2, mainly due to easier access to your very fine and very comprehensive jm_* set of Spin functions. I had been translating some of your jm_* functions into C then decided to take a different path hence where I am now. I'm going to recode the whole thing into Spin 2 and benchmark both bytecode and Flex-compiled versions. Maybe bytecode will be fast enough, we'll see. My current C implementation is accurate to a few tens of microseconds on very critical ignition timing which translates to a couple of tenths of a degree of crankshaft rotation at 12000 RPM and I'm thinking compiled Spin 2 will easily perform as well or better. Marco and Jon - I apologize for threadcrapping and will likely start my own thread specific to my project. Again, I thank both of you ever so much.
-Mike R...
The compiled code from FlexProp will be faster -- the question becomes... do you give up code density for speed that's not buying you anything? In some cases, the answer will be "Yes." In my P1 laser tag code we have to count on non-Parallax Spin compilers (BST, now Spin Tools) that will do dead code removal so that our program will fit into the EEPROM. With the P2 memory there is less concern about code density, but it's a habit thing for me. And with the ability to do inline assembly I seen no need use a full compiler in the work I do.
Good luck with your project, Mike. I'm glad you find my libraries useful.
Flexspin offers the ability to use Spin objects from C, and vice versa. Shouldn't need to port anything.
I saw that you already use the directory method on ProcessBuilder to set the working directory. I tried it again and found that it is working correct also on Mac. What me confused before was that the binary is not shown in the file tree of the IDE. But no problem for me.
Yes, on Windows the remaining bytes on upload was not logged in the console window (attached again). I don't know why. Therefore I was confused by these detailed log as I was trying it on the Mac.
Yes, this should also work.
I have tried it again and now it was surprisingly working. Don't know why there was an issue before. If it occurs again I will report the stack trace.
What I found now during more using the IDE on Mac was, that there is no caret shown in any input field in the find/replace and settings/preferences dialog. It is simply invisible but if one click anywhere in the field one can edit existing text. In the editor window it is shown and working as expected.
Thanks @macca.
Oh, ok, maybe I should think of adding some configuration option to filter the tree content.
The byte count should be displayed on the same line and replaced with the total byte count at the end, it is very fast with the P2. I think you need to redirect the output to see each line.
Ok.
That's really weird... I don't know if matters, but if I'm not wrong you are using a dark theme, I don't know if you set the theme in the application or is system-wide but can you try the light theme ? Maybe the caret is just the wrong color due to the theme for some reasons.
I slightly modified your spinc script to remove the directory change, let me know if works for you.
Ahh, it should be written on the same line until the upload is finished. Then this was not working correctly in the console window on Mac as there were all logging lines from upload visible afterwards. Looks like there was additional a newline printed instead of a carriage return only.
The logging of my test code from the Propeller was correct and the same on both OS versions.
Good point. I'm using the auto mode for the theme on the OS. In the IDE I switched to light theme as I want to see the background colors in the editor window. Now I tested different modes and found that the caret is only invisible if the OS is in dark mode and the IDE is using light theme.
If both (OS and IDE) are using the same mode all is working fine. This is independent from using the system theme in the IDE preferences. On my tests before I was mostly working at the evening, therefore the OS was using the dark mode. Now as I know the root cause I know also a workaround. It would be interesting if this issue also exists on the other OS versions.
I have attached screen shots of the IDE with dark and light theme. So, you can see how it looks like at all on Mac (Silicon). As you can see on the picture with light theme that the window on the upper frame is dark, the same for the find/replace dialog. This indicates that the OS is using the dark mode where the caret is missing. If the OS is using the light mode this frame is also light.
The script is working on Mac. Good work.
Thanks @macca.
@macca
I downloaded 0.40.0 and will let you know.
Thanks
Martin
Is it just me...?
Often when navigating the code window I find myself inadvertently jumping to a code definition.
Seems my left finger is often pressing the CTRL key too fast, or even holding it mid-operation, especially when copy-pasting things a lot.
I guess I'm jumping the gun by pressing CTRL whilst still mouse-highlighting code to copy, rather than waiting to finish the row highlight, taking a breath, and then pressing CTRL+C.
Would there be a better key for the jump-to-code feature? Maybe shift or alt ? (leaning toward alt as favourite)
A key that we rarely use whilst coding combined with a mouse operation, but is close-by ?
I guess the ship sailed on a fixed change, but could a user-hotkey override be added to the Editor preferences?
Is anyone having issues on the latest MACOS version 15.1.1 ? I have uninstalled re-installed and I always get this message: JavaAppLauncher quit unexpectedly.
However If I open terminal and run JavaAppLauncher, it runs just fine.
Ops.. I see what happens, never thought about it because I never select text with the mouse (shift+cursor keys).
Or, I can fix the issue.
Sooner or later I'll add a key configuration page (more later than soon).
Thank you - that sure would be better than changing keys (and habits) !