GCC for DS00 C code
prof_braino
Posts: 4,313
There is some C code posted for the prop chip in the DS00 Laser Range Finder.
http://www.lightware.co.za/download/software/DS00_Rev00.zip
Per the readme:
"The C source code (was) written using the ICCPROP V7.04D compiler from Imagecraft.com"
The image craft is 30-days free trial, I might want to re-do the code after 30 days. I would like to use the community tool of choice compiler.
Would you kind folks advise me which would be easier for a complete n00b to get going?
Be advised that I am not so good with C. I don't even have a "C" on my keyboard; it fell off, and I have a scratch-up "O" from a spare.
EDIT - Renamed thread to talk about GCC for DS00, I'll look at Catalina as a separate issue.
http://www.lightware.co.za/download/software/DS00_Rev00.zip
Per the readme:
"The C source code (was) written using the ICCPROP V7.04D compiler from Imagecraft.com"
The image craft is 30-days free trial, I might want to re-do the code after 30 days. I would like to use the community tool of choice compiler.
Would you kind folks advise me which would be easier for a complete n00b to get going?
Be advised that I am not so good with C. I don't even have a "C" on my keyboard; it fell off, and I have a scratch-up "O" from a spare.
EDIT - Renamed thread to talk about GCC for DS00, I'll look at Catalina as a separate issue.
Comments
OK, I got simpleIDE downloaded and installed, and the Hello.c program ran.
I made a new project with the DS00 Main.c, a file Main.side file was created.
Using COG Memory Model, message is:
Ignoring "Simple printf" flag in COG mode program.
Switched to LMM, message is:
Main.c:11:23: fatal error: constants.h: No such file or directory
This file constants.h resides in the same directory as Main.c, should this be in a different location? Or is it something with the backwards slashes?
I've been working with this package. There are several problems to overcome.
It's been a great and revealing exercise so far ! Will post something later.
So I made a project "braino" (I already used all the obvious names with fails), and braino.side and copied Main.c to braino.c
The build chokes on asio.h
braino.c:16:18: fatal error: asio.h: No such file or directory
I guess this is something particular to imagecraft? Or is there something equivalent in GCC?
Spaces? Eeek. I'll look into that. Wonder why it hasn't come up before.
Yes, asio.h was a light weight serial io library. I wrote that long ago and ICC included it - that was a mistake relatively speaking.
Propeller GCC just does the right thing. You'll have to get rid of the asio_init(57600) line in Utilities.c ....
BTW, you helped find a library bug with this exercise. Thanks.
Another thing will be use of lots of ICC propeller.h macros like SET and CLR which change bits in a variable. I'm not sure how to handle that just yet.
So, commented out out
// asio.h is not needed in GCC, so removed asio_init(57600) in utilities.h
// #include <asio.h>
from main, and commented out
// line is not needed in GCC 20120420 jazzed
// asio_init(57600); // Initialise comms
Now there's a whole slew of messages refering to undefined references; the first of which is:
This looks like the automatic default temp dir path from windows. Is there another environment variable to set?
It compiles and gets down to Initialise_Parameters for me.
I don't have the device, so the rest is up in the air.
When I open your .side file, the left pane shows all the rest of the .c and .h files. How did you get them to show up? I thought the tool already knows about then via the include statement?
I added them using the project list right-click on filename "Add File" feature.
Only the .c and .a files must be in the project list (other files such as .cogc and .spin can be added).
The package I posted was tested with 0-6-6 which is still under test but has many "link" related improvements.
For the time being, please add "-I ." (minus eye dot) to the "Other Compiler Options" box just below the "Math Lib" checkbox.
http://forums.parallax.com/showthread.php?137928-PropGCC-SimpleIDE&p=1091035&viewfull=1#post1091035
but installing gives the message
"Application failed to start because QtCored4.dll was not found"
Was that the right 0-6-6? The google code download page only goes up to 0-6-5
I ran into that as well. I installed 0.6.5 and then replaced the SimpleIDE.exe in the SimpleIDE\bin folder with the new version of SimpleIDE.exe from the 0.6.6 zip file.
I'm running Win7/64 so in my case it was in C:\Program Files (x86)\SimpleIDE\bin.
C.W.
Ya, it's just a .exe without all the support files.
Did you try adding "-I ." as mentioned ?
The .zip you found contains a SimpleIDE.exe that would replace *Program Files* \SimpleIDE\bin\SimpleIDE.exe
The .zip will work, but it is was just a test version .... Since it is "posted and found" i have to re-version it
I'm guessing "the project list" is the upper left pane.
Right clicking gives: "Add file copy" I'm using the first one since its on top Lots of those....
anfd then a whole bunch like this...
finally it ends with
_SET' was the first of a couple dozen undefined reference messages.
I said there were lots of issues - they are mainly caused by that very thick ICC propeller.h file.
Some things are good, others not so good.
The package I posted should at least compile.
I should be very happy that you are testing something for me
Thanks,
--Steve
I did use the stuff from post #8, it was a big help and got me to the point where I could get the messages in post #10
I did not figure out where to add the "-I .", I saw the "-I" several times in the output and (incorrectly?) assumed it was added automatically someplace.
I did not yet find ' the "Other Compiler Options" box just below the "Math Lib" checkbox' yet, I got a 10 year old's birthday sleep-over going on, they keep kicking me out for privacy and calling me back to squash a spider every few minutes. Hopefully I can pull it together when the feathers settle.
10 year olds I wish my kids were all 10 or so again ... permanently
The user guide link below has a picture that shows 2 boxes just above the Code Size information.
The bottom one is "Other Linker Options". The one above it is "Other Compiler Options"
https://sites.google.com/site/propellergcc/simpleide/user-s-guide#TOC-Project-Options
The posted preview SimpleIDE.exe version 0-6-6 (package 0-6-5 with 0-6-6 .exe file) adds the "-I ." automatically.
The attachment shows version 0-6-6 result with .zip in post #8. The headers can be removed from the project list with a similar result. One thing to note: the board type is set to SSF which in this case is just using 80MHz PLL16x clock.
Another A-ha! Not to be whiney or anything, why aren't these boxes labeled? Is it just windows being weird? Please don't say all compilers assume user know where compiler and linker options go.
Not that is matters, but I don't see anything that says code size information box, nor do I see anything that looks like code size information
Neither Help -> About nor Help -> Help mention the user guide, nor do I find one in C:\Program Files\SimpleIDE
Did my install fail? Oh wait, there it is in your link. Maybe the Help -> Help could have a link to the User Guide?
Oh, right it was on the web site when I did the download. Somehow I lost it between then and now.
So, I'm guessing I no longer need to add it?
Why SSF? Tried it, still doesn't build.
Build always gives the result in post #15.
How do we remove headers from the project list? How do we add headers to the project list? Do I need to do this?
How do we set the board type? OK, its an unlabeled field, I suggest labeling it.
I get a load of undefined references, a load of multiple definitions, one .text will not fit in hub, and one build error.
So if you got the code to build, something must be different from your install compared to a clean install? What do you normally change first thing before you start working, because I did not do anything beyond install.
Wait, I see from your png that you have different check boxes, from what came up by default. How do we determine what the options mean, and when we want to switch them? I suppose there is a section in the user guide?
.....
OK, I switched the check boxes to match yours, got the same errors.
I notice there is not option for Stock Prop 64K EEPROM 80Mhz, since Hydra and Quickstart are present, I used quickstart.
Field next to Board type is... comport... but is blank since my quickstart is disconnected. "Disconnected" would be better than blank, and a label "comport" would be better than no label.
Ok, I'm just hacking with no understanding. Time to stop before I hurt myself.
- Main IDE window titled "Simple IDE".
- Menu->Help->About window titled "Simple IDE" with Propeller GCC splash.
- Project->Properties Folders titled "Simple IDE Properties" with Folder Tab Selected
- Explorer c:\propgcc\bin
- Explorer c:\propgcc\propeller-load
My questions at this point are:I'll collect screen shots when the kids are gone, and hopefully read the user guide with both eyes, instead of one on the 4 year old
It seems I'm missing something basic on both GCC and Catalina. You guys can get them both to build, I can get neither past the errors in step #8
One last check for stupid questions:
Do I need to install something before or in addition to the simpleIDE package?
Does the file that contains "main" need to named main.c?
Is there some "trick" to setting up the project file that I'm forgetting?
Do I have to set up some kind of make file to get this to go?
https://sites.google.com/site/propellergcc/simpleide/Setup
https://sites.google.com/site/propellergcc/simpleide/user-s-guide
I'm trying to get a new package out that doesn't require patching the 0-6-6 .exe into the 0-6-5 download.
Once that is done, I'll post it.
I appreciate your effort. So far, my experience has been that people "get it" and use it, or don't "get it" and forget it.
I do want everyone to "get it" without much effort.
To answer your "One last check ... ":
The setup does assume for not that you have an FTDI driver installed for your Propeller board.
The file that contains main must be listed first in the project files list. This is usually done automatically.
There are no tricks. Try the setup and user guides i mentioned.
You do not need make files for this to work. SimpleIDE and it's project manager handle that kind of thing.
Thanks,
--Steve