New user having problems
Rsadeika
Posts: 3,837
I am testing propgcc on my Windows XP SP3 computer. I am using the "Hello world" example, and I get the following:
Verifying ... Upload OK!
[Entering terminal mode. Type ESC ...
But, I do not get "Hello world" displayed on the screen.
I tried 'propeller-load -p com5 hello -r -t', and 'propeller-load -p com5 -b C3 hello -r -t' , to get the same results, nothing on the screen. So, am I doing something wrong, or did I miss a step?
Ray
Verifying ... Upload OK!
[Entering terminal mode. Type ESC ...
But, I do not get "Hello world" displayed on the screen.
I tried 'propeller-load -p com5 hello -r -t', and 'propeller-load -p com5 -b C3 hello -r -t' , to get the same results, nothing on the screen. So, am I doing something wrong, or did I miss a step?
Ray
Comments
Hi Ray.
What GCC package/version are you using?
Is the hello example from the INSTALL.txt?
Can you list the files in your hello directory?
Can I assume you are using your C3?
Thanks,
--Steve
-readme_windows.txt
-hello.c, hello (I ran hello.c with propeller-elf-gcc -o hello hello.c)
-Yes, I am using the C3.
I downloaded the latest v0_2_2 package and followed the directions which worked on Windows7.
I need to find my Windows XP Netbook and try it. It is locked in my daughter's room right now.
I'll post again when I've tried that - I have other commitments today so it will be later.
One question. How did you start your command window?
I double-clicked the propgcc.bat file. That automatically sets the path.
Also, I don't use the -p comx option much anymore now that propeller-load automatically detects and uses the first USB COM port.
So, for example i just say: c:\propgcc\propeller-load -r -t hello
The auto-detect only detects ports right now and may stall a while if a Propeller is not found. We are adding a more efficient auto-detect propeller soon.
propeller-elf-gcc -o ledonoff ledonoff.c
propeller-load -p com5 ledonoff -r -t
which seem to work, I was seeing 'LED on', 'LED off' on the screen. So, I am not sure why your example is not working for me.
Ray
Ray
For XMM today, you would say:
propeller-elf-gcc -mxmmc -o ledonoff ledonoff.c
propeller-load -p com5 ledonoff -r -t -b C3F
or
propeller-elf-gcc -mxmm -o ledonoff ledonoff.c
propeller-load -p com5 ledonoff -r -t -b C3
XMMC mode is "code only" mode. That is the program is saved in flash and data lives in HUB ram. With that mode you use board type -b C3F for better performance, but -b C3 would also work. XMM mode uses Flash and SRAM and is often much slower.
Another mode is COG and your program will run entirely from a single COG.
propeller-elf-gcc -mcog -o ledonoff ledonoff.c
propeller-load -p com5 ledonoff -r -t
You mean passed from the loader? That's an interesting idea, but no we don't allow that today.
The Propeller GCC program can accept parameters in main as int main(int argc, char* argv[]), so it may be possible to have the loader do that in a future release. Generally, we have to setup the pins and other parameters in the program today.
We talked about making pre-built libraries last week. The first libraries will be for the PropBOE board. We will add other libraries after that. I can not make specific promises in this area, but I do know that PropBOE has an XBEE socket.
It would be useful to get Ken Gracey involved in this part of the conversation. I'll send him a pointer.
Glad you got this sorted out!
I'm a little confused though. If the hello program was not already built what got loaded before?
Regardless, I have benefited greatly from this thread.
Thanks,
--Steve
Since I am using a C3 board, are there functional SD card drivers? I noticed that somebody did a very, very basic full_duplex_serial driver, so when I add an RS-232 breakout to my C3, I will try to improve on the serial driver. Maybe now I can put my C3 board to some use, providing that there are drivers for the SD card.
Ray
Funny, I've done that too and it used to crash.
There are examples in the demo package.
-propeller-elf-gcc -o fileteast filetest.c
crashes: ... region 'hub' overflowed by 9896 bytes
collect2: Id returned 1 exit status
-propeller-elf-gcc -mxmm -o filetest filetest.c
compiles
-propeller-load -p com5 -b C3 filetest -r -t
loads, but I do not see anything on the screen, like the contents of the help() function.
The SD card that I am using is functional, because I just ran it in a SPIN environment using fsrw.
It seems like using the -t is a hit or miss situation.
Ray
I assume you are using the filetest.c program in demos/c3files/src. In the LMM mode, the filetest program uses a smaller version of printf that's located in the source directory along with filetest.c. The standard library printf takes up too much room in memory. Also, the default optimization does not produce compact code, so it makes the executable too large. You should compile the LMM version as follows:
propeller-elf-gcc -Os -o filetest filetest.c printf.c
I tried this, and it worked for me.
I'm not sure why the XMM mode did not work for you. It works OK for me. Note, along with the c3files/src directory there are lmm, xmm, xmmc directories. These contain makefiles that will build the various memory models in those directories. Have you tried running make in one of those directories?
Dave
I tried your test1 program, and it works on my C3 card. The program must be hanging on LoadSDDriver or dfs_mount in your case. Can you add debug prints before these calls to see where it's hanging? Did you try LMM or XMM? in XMM mode, LoadSDDriver is not used since the SD Driver is already included in the cache driver.
Dave
-propeller-elf-gcc -o test1 test1.c FileDriver.c
The propgcc zip file did not have a Drivers folder in propgcc/lib, hopefully all this will be taken care in the next release. But, in the mean time ...
Ray
Try commenting out the call to LoadSDDriver as well as dfs_mount in test1.c. Maybe it's LoadSDDDriver that's causing the problem. Also, try other SD cards.
Dave
One of these days somebody will have to standardize SD cards, and SD card readers! The problem was the SD card, I tried a different one and it works, or at least the program does not hang.
I am testing the program in small pieces, next puzzle to solve is:
... : undefined reference to '_tokenize'
collect2: Id returned 1 exit status
What header file is this in?
Ray
tokenize is a function defined in filetest.c that extracts tokens from a string using the space character as a delimiter.
-propeller-load -p com5 test1 -r -t
loader complains - error: no cache driver to load external image
error: load failed
I am not sure what is going on now.
For the SD example program, I noticed that there are no commands for creating a file, was that intentional? Since I am new at this I doubt that I have enough skill to do it myself.
What is the propGCC team using as an editor to work with files. I noticed yesterday when I was retyping the functions I missed some ')' and some '}', man it was a pain trying to find the problem. Any editors out there that catch that sort of stuff?
Ray
Ray
-propeller-load -p com6 ledonoff -r -t
error writing port
a device attached to the system is not functioning
The big problem is, that propgcc hangs the CLI window, the task manager can not kill the task. The only way to get out is with a shutdown, gets to be little annoying after awhile.
Ray
propeller-load -p com5 test1 -r -t -b c3
I'm not sure exactly what you mean. PropGCC is not an O/S. Dave's filetest.c program has a "cat" command though.
There are some tools to help keep track of braces { and }. Try Notepad++ as shown below.
You can set C from Menu Language->C, and it will add braces tracking for you.
The parentheses ( and ) are a little harder to keep track of and notepad++ does not have tracking for that.
In any case using good indentation practice helps to get the braces right in any editor.
The Eclipse IDE and plugin will have braces and parentheses tracking features.
A package will be available that does all the setups for the IDE soon.
It is possible that toggling pin 31 of Propeller can put extra characters on a terminal. Usually they are not spaces though.
Are you using the propeller-load terminal -t ? If you're using another terminal some settings may need to be adjusted.
Ray, this problem is very serious and should not happen. I trust that it did happen of course, and we need to know why so we can fix it.
Can you please try to recall all steps you took before this happened? For instance, did you have another terminal attached to your COM port?
Thanks,
--Steve