@Dr_Acula... Yeah, that is the exact line of code i put between the brackets where it says //insert code here. I know it is not the board, because i have used it for other video applications already. Do you think it sent the message to the serial terminal?
Just thought of another possibility - did you by any chance insert the printf line on the same line as the // - in which case it is just a comment?
I switched the mode to release mode like it said to do in the manual... How do i post a build log?
And no, i left the comment in the same place and put the print command one line below it.
There is just one small possibility it is the same as a bug I saw briefly in amongst a frenzy of coding last night, so I need to ask - with that flashing cursor, is it in the top left of the screen, or is it about 1/8th of the way in and 1/8th of the way down the screen?
I switched the mode to release mode like it said to do in the manual... How do i post a build log?
And no, i left the comment in the same place and put the print command one line below it.
Select Settings -> Compiler and Debugger from the main menu. Make sure Catalina C Compiler is the selected compiler, and then select the Other Settings tab in that dialog box. On that tab, make sure the Compiler logging option is set to Full Command Line and the Save Build log to HTML file when build is finished option is selected. There is a picture and some text on page 25 of the Getting Started with CodeBlocks document that may help you.
Then rebuild your project as usual. Examine the build log when finished (which is saved in a HTML file) - either click on the file to open it and cut and paste the results to a new file, or just post the file that it says is generated.
@Dr_acula... It is not all the way in the corner, but it is not an 1/8 of the way down horizontally or vertically. The actual picture is somewhat blurry to.
@Ross... Oh, sorry. I posted the build log in the post above. What am i looking for in there anyway? It said it didn't have any errors or warnings? I am going to bed now(It's like 1: 30 over here), but i will be back in the afternoon tomorrow. Thanks Dr_acula and Ross for the help thus far:)
@Dr_acula... It is not all the way in the corner, but it is not an 1/8 of the way down horizontally or vertically. The actual picture is somewhat blurry to.
@Ross... Oh, sorry. I posted the build log in the post above. What am i looking for in there anyway? It said it didn't have any errors or warnings?
I want to see the actual Catalina command executed. Can you set the Compiler logging option is set to Full Command Line (as described in my previous post) and repost the build log? Also, please post the code as well.
I need some help! I'm having a huge amount of trouble with code::blocks and after 3 hours of coding I still can't get a "hello world" on the screen. I have tried so many combinations and permutations that I'm just not sure where to go next.
I have it working well from my IDE but I can't replicate this in code::blocks. There are things that don't make sense, like when you change a whole lot of settings in Project/Build Options, and then hit Build/Build, it comes up with "Target is up to date, nothing to be done". This does not make sense when you add or delete a library like stdio. I think Build/Build is for compiling on a PC which doesn't mean anything for our programs, is that right? So instead, use the Tools menu.
Simple stuff first:
/*
* main.c - main program
*/
#include <stdio.h>
int main(int argc, char *argv[])
{
printf("Hello World\n");
while(1) ; // the propeller reboots on exit - this line prevents that
return 0;
}
Select Target is "release". I have run Build XMM utilities. I have changed SET_MEM to 512k
I'd like to jump straight to XMM because I know this works.
In Project Build Options I have checked:
Dracblade platform
libc standard c library
VGA high resolution
and nothing else.
I am confused about the Build XMM utilities as it asked some questions about the cache, so I am not sure which is the correct cache setting, what you put in the Build XMM utilities or what you put in that list of checkboxes.
So that is the first bit that is confusing, where to store information.
I also ran into many errors last night where in the final command line, Dracblade ended up there twice. So this might be a related problem.
So, in Tools I run "Download to XMM ram" and I get this message at the bottom of the screen
Launching tool 'Download to Hub RAM': payload.exe Hello (in C:\Propeller\Hello\bin\Release)
stderr> Error: Hello is larger than 32768 bytes - this is too large to load as the first file
Tool execution terminated with status 1
Launching tool 'Download to XMM RAM': payload.exe XMM Hello (in C:\Propeller\Hello\bin\Release)
stderr> Using Propeller (version 1) on port COM1 for first download
stderr> Using Secondary Loader on port COM1 for subsequent download
Tool execution terminated with status 0
So there seems to be an error about the file being >32k, which it will be because it is an XMM program. And so it downloads for a while and I get a flashing cursor but no text.
So how do I get it to compile a file?
Before, I was sure there was a screen that flashed up with all the compilation. I can't see this at the moment. So before I get to the download stage, how do I compile a file? (This is a step I added at the top of my IDE as it is a quick way to find bugs before downloading. At one stage writing code I was recompiling after adding every new line in C).
I was expecting recompilation (but no download) to be Build/Build but it keeps saying "nothing to be done"
Any help here would be most appreciated!
Addit: I worked out how to force a recompilation - change one line in the code. That is odd behaviour as I figure that if hit compile then it compiles, regardless of whether it already did ten minutes ago. But we can live with that.
So a recompilation and we have this error message:
Build started on: 17-10-2011 at 22:31.25
Build ended on: 17-10-2011 at 22:31.26
-------------- Build: Release in Hello ---------------
catalina.exe -DHIRES_VGA -DLARGE -DDRACBLADE -DHIRES_VGA -DDRACBLADE -c main.c -o obj\Release\main.obj
Catalina Compiler 3.3
catalina.exe -o bin\Release\Hello obj\Release\main.obj -DHIRES_VGA -DLARGE -DDRACBLADE -DHIRES_VGA -lc -DDRACBLADE
Homespun Spin Compiler 0.30
Item has already been added. Key in dictionary: 'HIRES_VGA' Key being added: 'HIRES_VGA'
Catalina Compiler 3.3
Output size is 6.80 KB
Process terminated with status 0 (0 minutes, 0 seconds)
1 errors, 0 warnings
Alright, I have a blank VGA screen. That is a start, and I don't care that there is no text on it.
First, I got it to compile.
In Project/Build Options, UNCHECK everything except the libc.
Then change a character in the code to force a recompile.
And compile, and that gives no errors and then you can do a download. No Hello World as yet, but first I need to understand those settings.
In Project/Build Options there seems to be a mix of settings. Some are libraries that you have to include and that makes sense. But some, like the platform you are using, are defined elsewhere, and if you check them in this list then they are added twice to the command line. That seems confusing to me - I'd be expecting settings to only be set in one place. So if they are set in Build XMM Utilities, does that imply that if you are not using XMM then you don't run Build XMM Utilities, and hence you DO set those variables in that checkbox list?
And this is the bit that is maddening, because when I test it on my vb.net IDE, it does not work either. And it worked last night. And the reason it does not work is because I have done a reinstall of the code::blocks package since last night, and it probably has wiped xmm.binary or some other file that I have been fudging for each update of catalina by manually copying into a directory.
Do I go back to an old version that works (3.0)?
Do I try to persevere with the code::blocks version, knowing that the error in 3.3 is the same from code::blocks as from my IDE?
Do I try to copy files from the old working version to the new version, knowing that this will make it very hard for you to debug what is working as there will now be old files in amongst new files?
I just don't quite know what to do next, and this is now my 6th reinstall of the 3.3 package as I have been down this road many times.
Sorry to make it so complicated. To find this error I need a working version to troubleshoot against, so I need to be really clear about what steps I take along the way.
So, this is the code and the command line that work on my version 3.0 code from my IDE, warts and all with several files moved and copied around the place. Can you replicate this command line in code::blocks with version 3.3?
/* Traditional first C program */
#include <stdio.h>
int main ()
{
printf("Hello, World!\n");
while (1); // Prop reboots on exit from main()!
return 0;
}
catalina -lcx -D PLUGIN -x5 -M 512k -D DRACBLADE -D SHARED_XMM -D HIRES_VGA NEW.C
and the version 3.0 compilation is
===================
SETTING UP CATALINA
===================
CATALINA_DEFINE = [default]
CATALINA_INCLUDE = [default]
CATALINA_LIBRARY = [default]
CATALINA_TARGET = [default]
CATALINA_LCCOPT = [default]
CATALINA_TEMPDIR = [default]
LCCDIR = C:\Program Files\Catalina
catalina -lcx -D PLUGIN -x5 -M 512k -D DRACBLADE -D SHARED_XMM -D HIRES_VGA NEW.C
Catalina Compiler 3.0
Homespun Spin Compiler 0.30
parsing C:\Program Files\Catalina\target\xmm_default.spin
parsing C:\Program Files\Catalina\target\Catalina_Common.spin
parsing C:\Program Files\Catalina\target\Catalina_HUB_XMM_Loader.spin
parsing C:\Program Files\Catalina\target\Catalina_XMM.spin
parsing C:\Program Files\Catalina\target\Catalina_HMI_Plugin_HiRes_Vga_No_Mouse.spin
parsing C:\Program Files\Catalina\target\Catalina_comboKeyboard.spin
parsing C:\Program Files\Catalina\target\Catalina_VGA_HiRes_Text.spin
parsing C:\Program Files\Catalina\target\Catalina_CogCount.spin
parsing C:\Program Files\Catalina\target\Catalina_Float32_A_Plugin.spin
parsing C:\Program Files\Catalina\target\Catalina_CogStore.spin
parsing C:\Program Files\Catalina\target\Catalina_SD_Plugin.spin
compiling xmm_default.spin
compiling Catalina_HUB_XMM_Loader.spin
compiling Catalina_XMM.spin
compiling Catalina_HMI_Plugin_HiRes_Vga_No_Mouse.spin
compiling Catalina_comboKeyboard.spin
compiling Catalina_VGA_HiRes_Text.spin
compiling Catalina_CogCount.spin
compiling Catalina_Float32_A_Plugin.spin
compiling Catalina_CogStore.spin
compiling Catalina_SD_Plugin.spin
compiling Catalina_Common.spin
writing 32768 bytes to C:\Program Files\Catalina\target\xmm_default.eeprom
Homespun Spin Compiler 0.30
parsing C:\Program Files\Catalina\target\Catalina.spin
compiling Catalina.spin
writing 69724 bytes to NEW.binary
renaming output file from NEW.binary to NEW_temp.binary
combining target and program to NEW.binary
code = 35620 bytes
cnst = 468 bytes
init = 176 bytes
data = 652 bytes
file = 70236 bytes
Payload XMM NEW
Using Propeller (version 1) on port COM1 for first upload
Using port COM1 for subsequent uploads
Press any key to continue . . .
/*
* main.c - main program
*/
#include <stdio.h>
int main(int argc, char *argv[])
{
// insert your code here
printf("Hello world\n");
while(1) ; // the propeller reboots on exit - this line prevents that
return 0;
}
As for the new build log... I made sure the full command line option was selected. Here is the build log...
/*
* main.c - main program
*/
#include <stdio.h>
int main(int argc, char *argv[])
{
// insert your code here
printf("Hello world\n");
while(1) ; // the propeller reboots on exit - this line prevents that
return 0;
}
...
code = 80 bytes
cnst = 0 bytes
init = 4 bytes
data = 4 bytes
file = 9880 bytes
Process terminated with status 0 (0 minutes, 8 seconds)
0 errors, 0 warnings
Ok - I can see and reproduce the problem, but I'm not sure exactly what's causing it in your case. Compiling that program cannot possibly generate only 80 bytes of code, since using printf() pulls in almost the entire stdio library - on my system compiling your program generates 14144 bytes!
However, compiling the original main.c (or when I remove the printf() statement) does generate exactly 80 bytes.
Somehow you are editing one file, but compiling a different one. Can you please compile by right-clicking on the catalinatest project node in the navigation pane and selecting rebuild from that menu?
Also, could you close all your open source files in Code::Blocks, and then re-open main.c by right-clicking on the one under the catalinatest/Sources node? - that way, you will know you are editing the correct main.c
Ravenkallen: I am no C expert, but this bit looks wrong to me..
while(1) ; // the propeller reboots on exit - this line prevents that
return 0;
Shouldn't this be???
while(1) {} // the propeller reboots on exit - this line prevents that
// return 0;
Hi Cluso,
That "return" is required to avoid a warning message since main() is defined (by the ANSI C standard) to return an int. It is never executed (and may in fact be optimized away by the compiler - I've never checked).
I need some help! I'm having a huge amount of trouble with code::blocks and after 3 hours of coding I still can't get a "hello world" on the screen. I have tried so many combinations and permutations that I'm just not sure where to go next.
I have it working well from my IDE but I can't replicate this in code::blocks. There are things that don't make sense, like when you change a whole lot of settings in Project/Build Options, and then hit Build/Build, it comes up with "Target is up to date, nothing to be done". This does not make sense when you add or delete a library like stdio. I think Build/Build is for compiling on a PC which doesn't mean anything for our programs, is that right? So instead, use the Tools menu.
Like "make", the Code::Blocks build engine does not understand anything except source file changes. If you make a configuration change and say "build" it will not build anything - no source files have changed so it thinks the binary is up to date. To force a build, use Build->Rebuild instead.
/*
* main.c - main program
*/
#include <stdio.h>
int main(int argc, char *argv[])
{
printf("Hello World\n");
while(1) ; // the propeller reboots on exit - this line prevents that
return 0;
}
Select Target is "release". I have run Build XMM utilities. I have changed SET_MEM to 512k
I'd like to jump straight to XMM because I know this works.
In Project Build Options I have checked:
Dracblade platform
libc standard c library
VGA high resolution
and nothing else.
Not even LARGE or SMALL? Please post the actual build log.
I am confused about the Build XMM utilities as it asked some questions about the cache, so I am not sure which is the correct cache setting, what you put in the Build XMM utilities or what you put in that list of checkboxes.
It doesn't usually matter what you set, as long as you set the same cache size (or no cache) in both places.
I also ran into many errors last night where in the final command line, Dracblade ended up there twice. So this might be a related problem.
You have specified options in two places. In the build options dialog, select the main project node as well as the release node and make sure you only use one of the two sets of options.
So, in Tools I run "Download to XMM ram" and I get this message at the bottom of the screen
Launching tool 'Download to Hub RAM': payload.exe Hello (in C:\Propeller\Hello\bin\Release)
stderr> Error: Hello is larger than 32768 bytes - this is too large to load as the first file
Tool execution terminated with status 1
Launching tool 'Download to XMM RAM': payload.exe XMM Hello (in C:\Propeller\Hello\bin\Release)
stderr> Using Propeller (version 1) on port COM1 for first download
stderr> Using Secondary Loader on port COM1 for subsequent download
Tool execution terminated with status 0
So there seems to be an error about the file being >32k, which it will be because it is an XMM program. And so it downloads for a while and I get a flashing cursor but no text.
Th build log is cumulative - you previously executed a "Download to Hub RAM". But the "Download to XMM RAM" looked like it worked ok. You can clear out the old contents of the build log by right clicking on the "Build Log" title bar.
Before, I was sure there was a screen that flashed up with all the compilation. I can't see this at the moment. So before I get to the download stage, how do I compile a file? (This is a step I added at the top of my IDE as it is a quick way to find bugs before downloading. At one stage writing code I was recompiling after adding every new line in C).
I was expecting recompilation (but no download) to be Build/Build but it keeps saying "nothing to be done"
And this is the bit that is maddening, because when I test it on my vb.net IDE, it does not work either. And it worked last night. And the reason it does not work is because I have done a reinstall of the code::blocks package since last night, and it probably has wiped xmm.binary or some other file that I have been fudging for each update of catalina by manually copying into a directory.
As I said before, you don't need to copy XMM.binary anywhere - Payload looks for it in the bin directory, which is where the "build utilities" puts it.
Let's get these issues sorted out, and then try again to identify if anything else is causing you a problem.
Ross, I think I found that issue...
I tried to fix that other problem where it wouldn't complain if I did "large" on SuperQuad.
Here's what I substitiuted (I think you gave this to me):
#ifndef NO_RAM
#define NO_RAM
#ifdef LARGE
ERROR : LARGE MEMORY MODE NOT SUPPORTED BY THE SUPERQUAD
#endif
#endif
It complains about the colon after "ERROR" says expected "(eol)", got ":"
That's intentional - Homespun has not have a general #error directive (like C does), so when I discover an error condition I artificially generate an error. This causes homespun to spit out the actual line as part of the error message, and I then detect that in Code::Blocks.
Ross, you're too fast! I was updating my previous post. I think the issue may be that the CodeBlocks "Build XMM Tools" always specifies "LARGE" on the command line.
Could that be?
Ross, you're too fast! I was updating my previous post. I think the issue may be that the CodeBlocks "Build XMM Tools" always specifies "LARGE" on the command line.
Could that be?
Possibly. Where do you see the "LARGE" - I'll have to check this out when I get home.
Ross, Ok, I think the problem is in the "build_all.bat" file here:
:superquad
@echo on
call build_tmp_var %1 %2 %3 %4 %5 %6 %7 %8 %9 LARGE
@echo on
homespun Payload_XMM_Loader -L "%TMP_LCCDIR%\target" -b -o XMM %TMP_VAR%
homespun "%TMP_LCCDIR%\target\xmm_default.spin" -L "%TMP_LCCDIR%\target" -b %TMP_VAR% -o Flash_Boot -d
@echo.
@echo off
goto copy
I'm tempted to change that LARGE to SMALL...
Yes, give it a try. As I said earlier, I specify LARGE only to force the inclusion of XMM functionality. SMALL may do the same. If not, I'll fix it when I get home. In hindsight, I probably should have used SMALL, since all XMM boards will support SMALL, but not all will support LARGE.
Thinking through what works (v3.0) and doesn't (3.3), it probably is the setup process. I've reinstalled v3.3 so many times I suspect I'm leaving something out. I am now thinking that with respect to XMM programs, there are two things that need running, not one. From page 17 of the manual:
Note that some of Catalina’s build scripts (e.g. the build_all script in the utilities
directory) need to set up very specific configurations before compiling some of the
utility programs, and therefore these scripts check to see if the CATALINA_DEFINE
variable is set - (if so) they refuse to run, because the settings could interfere with
the operation of the script. To run these scripts, first unset the CATALINA_DEFINE
variable, and then specify the target on the command line – e.g:
build_all HYBRID
Loading Programs
For LMM programs, the simplest way to load a program (assuming your platform has
a suitable serial or USB interface, and it is connected to your PC, and the Propeller
is powered up) is to use the Payload serial loader. Just enter a command like:
payload hello_world
Payload will locate the Propeller automatically. You can also load programs into
EEPROM, by including the –e command line option:
payload hello_world -e
Before we can load XMM programs, we must first build some Catalina utilities for the
platform we want to load. To do this, go to the Catalina utilities directory, and enter
the following command:
build_utilities
This is an interactive batch program which will ask you questions about the Propeller
platform you intend to run the programs on.
So I think the two batch files to run are build_all and build_utilities
I'm still not sure about xmm.binary - it is not in the /bin folder but I suspect that one of the above batch files might create it.
Thinking through what works (v3.0) and doesn't (3.3), it probably is the setup process. I've reinstalled v3.3 so many times I suspect I'm leaving something out. I am now thinking that with respect to XMM programs, there are two things that need running, not one. From page 17 of the manual:
...
So I think the two batch files to run are build_all and build_utilities
I'm still not sure about xmm.binary - it is not in the /bin folder but I suspect that one of the above batch files might create it.
Hi Dr_A,
I'm sure I've said this several times now
XMM.binary is not included in the Catalina distribution because it it platform-dependent. You have to build it yourself. You can do this in either of two ways:
From the Catalina Command Line:
build_utilities
From Code::Blocks:
Tools->Build XMM Utilities
In either case, the correct XMM.binary will be built and copied to the bin directory, where Payload will find it automatically. You do not need to copy this file anywhere else. If you have copied it elsewhere, you are probably best off deleting all the copies.
Note: The build_all script (in the utilities folder) is a third way of doing the same job - but it does not walk you through the various options step-by-step - you have to know exactly what to specify on the command line.
@Ross... Yeah, i am stuck with guys a little longer, haha... Now i have to do stuff like setting I/O pins, flashing LEDS, declaring variables. Is there more info i could find about basic I/O functions?
Comments
Just thought of another possibility - did you by any chance insert the printf line on the same line as the // - in which case it is just a comment?
Ross.
And no, i left the comment in the same place and put the print command one line below it.
Oh, nevermind... I copied this from the build log.
Build: Release in catalinatest
Compiling: main.c
1 file(s) moved.
Catalina Compiler 3.3
Linking console executable: bin\Release\catalinatest
Homespun Spin Compiler 0.30
parsing C:\Program Files\Catalina\target\lmm_default.spin
parsing C:\Program Files\Catalina\target\Catalina_Common.spin
parsing C:\Program Files\Catalina\target\Catalina.spin
parsing C:\Program Files\Catalina\target\Command_Line.spin
parsing C:\Program Files\Catalina\target\Catalina_CogStore.spin
parsing C:\Program Files\Catalina\target\Floating_Point.spin
parsing C:\Program Files\Catalina\target\SD_Card.spin
parsing C:\Program Files\Catalina\target\Clock.spin
parsing C:\Program Files\Catalina\target\HMI.spin
parsing C:\Program Files\Catalina\target\Catalina_HMI_Plugin_HiRes_Tv.spin
parsing C:\Program Files\Catalina\target\Catalina_CogCount.spin
parsing C:\Program Files\Catalina\target\Catalina_comboKeyboard.spin
parsing C:\Program Files\Catalina\target\Catalina_comboMouse.spin
parsing C:\Program Files\Catalina\target\Catalina_mouse.spin
parsing C:\Program Files\Catalina\target\Catalina_HiRes_TV_Text.spin
parsing C:\Program Files\Catalina\target\TV_Half_Height.spin
parsing C:\Program Files\Catalina\target\Graphics.spin
parsing C:\Program Files\Catalina\target\Proxy_IO.spin
parsing C:\Program Files\Catalina\target\Extras.spin
parsing C:\Program Files\Catalina\target\Catalina_LMM.spin
compiling lmm_default.spin
compiling Catalina.spin
compiling Command_Line.spin
compiling Catalina_CogStore.spin
compiling Floating_Point.spin
compiling SD_Card.spin
compiling Clock.spin
compiling HMI.spin
compiling Catalina_HMI_Plugin_HiRes_Tv.spin
compiling Catalina_CogCount.spin
compiling Catalina_comboKeyboard.spin
compiling Catalina_comboMouse.spin
Catalina Compiler 3.3
compiling Catalina_mouse.spin
compiling Catalina_HiRes_TV_Text.spin
compiling TV_Half_Height.spin
compiling Graphics.spin
compiling Proxy_IO.spin
compiling Extras.spin
compiling Catalina_LMM.spin
compiling Catalina_Common.spin
writing 9880 bytes to bin\Release\catalinatest.binary
code = 80 bytes
cnst = 0 bytes
init = 4 bytes
data = 4 bytes
file = 9880 bytes
Process terminated with status 0 (0 minutes, 33 seconds)
0 errors, 0 warnings
Build log saved as:
There is just one small possibility it is the same as a bug I saw briefly in amongst a frenzy of coding last night, so I need to ask - with that flashing cursor, is it in the top left of the screen, or is it about 1/8th of the way in and 1/8th of the way down the screen?
Select Settings -> Compiler and Debugger from the main menu. Make sure Catalina C Compiler is the selected compiler, and then select the Other Settings tab in that dialog box. On that tab, make sure the Compiler logging option is set to Full Command Line and the Save Build log to HTML file when build is finished option is selected. There is a picture and some text on page 25 of the Getting Started with CodeBlocks document that may help you.
Then rebuild your project as usual. Examine the build log when finished (which is saved in a HTML file) - either click on the file to open it and cut and paste the results to a new file, or just post the file that it says is generated.
Ross.
@Ross... Oh, sorry. I posted the build log in the post above. What am i looking for in there anyway? It said it didn't have any errors or warnings? I am going to bed now(It's like 1: 30 over here), but i will be back in the afternoon tomorrow. Thanks Dr_acula and Ross for the help thus far:)
I want to see the actual Catalina command executed. Can you set the Compiler logging option is set to Full Command Line (as described in my previous post) and repost the build log? Also, please post the code as well.
Ross.
I need some help! I'm having a huge amount of trouble with code::blocks and after 3 hours of coding I still can't get a "hello world" on the screen. I have tried so many combinations and permutations that I'm just not sure where to go next.
I have it working well from my IDE but I can't replicate this in code::blocks. There are things that don't make sense, like when you change a whole lot of settings in Project/Build Options, and then hit Build/Build, it comes up with "Target is up to date, nothing to be done". This does not make sense when you add or delete a library like stdio. I think Build/Build is for compiling on a PC which doesn't mean anything for our programs, is that right? So instead, use the Tools menu.
Simple stuff first:
Select Target is "release". I have run Build XMM utilities. I have changed SET_MEM to 512k
I'd like to jump straight to XMM because I know this works.
In Project Build Options I have checked:
Dracblade platform
libc standard c library
VGA high resolution
and nothing else.
I am confused about the Build XMM utilities as it asked some questions about the cache, so I am not sure which is the correct cache setting, what you put in the Build XMM utilities or what you put in that list of checkboxes.
So that is the first bit that is confusing, where to store information.
I also ran into many errors last night where in the final command line, Dracblade ended up there twice. So this might be a related problem.
So, in Tools I run "Download to XMM ram" and I get this message at the bottom of the screen
So there seems to be an error about the file being >32k, which it will be because it is an XMM program. And so it downloads for a while and I get a flashing cursor but no text.
So how do I get it to compile a file?
Before, I was sure there was a screen that flashed up with all the compilation. I can't see this at the moment. So before I get to the download stage, how do I compile a file? (This is a step I added at the top of my IDE as it is a quick way to find bugs before downloading. At one stage writing code I was recompiling after adding every new line in C).
I was expecting recompilation (but no download) to be Build/Build but it keeps saying "nothing to be done"
Any help here would be most appreciated!
Addit: I worked out how to force a recompilation - change one line in the code. That is odd behaviour as I figure that if hit compile then it compiles, regardless of whether it already did ten minutes ago. But we can live with that.
So a recompilation and we have this error message:
Alright, I have a blank VGA screen. That is a start, and I don't care that there is no text on it.
First, I got it to compile.
In Project/Build Options, UNCHECK everything except the libc.
Then change a character in the code to force a recompile.
And compile, and that gives no errors and then you can do a download. No Hello World as yet, but first I need to understand those settings.
In Project/Build Options there seems to be a mix of settings. Some are libraries that you have to include and that makes sense. But some, like the platform you are using, are defined elsewhere, and if you check them in this list then they are added twice to the command line. That seems confusing to me - I'd be expecting settings to only be set in one place. So if they are set in Build XMM Utilities, does that imply that if you are not using XMM then you don't run Build XMM Utilities, and hence you DO set those variables in that checkbox list?
This is my compile log
So why no "Hello World"
And this is the bit that is maddening, because when I test it on my vb.net IDE, it does not work either. And it worked last night. And the reason it does not work is because I have done a reinstall of the code::blocks package since last night, and it probably has wiped xmm.binary or some other file that I have been fudging for each update of catalina by manually copying into a directory.
Do I go back to an old version that works (3.0)?
Do I try to persevere with the code::blocks version, knowing that the error in 3.3 is the same from code::blocks as from my IDE?
Do I try to copy files from the old working version to the new version, knowing that this will make it very hard for you to debug what is working as there will now be old files in amongst new files?
I just don't quite know what to do next, and this is now my 6th reinstall of the 3.3 package as I have been down this road many times.
Sorry to make it so complicated. To find this error I need a working version to troubleshoot against, so I need to be really clear about what steps I take along the way.
So, this is the code and the command line that work on my version 3.0 code from my IDE, warts and all with several files moved and copied around the place. Can you replicate this command line in code::blocks with version 3.3?
Anyway, here are the files that I think were giving me trouble:
http://www.rayslogic.com/Propeller/Products/FlashPoint/Catalina/FlashPoint_CfgDef_Platform.zip
But, like I said, I wouldn't bother with it yet.
As for the new build log... I made sure the full command line option was selected. Here is the build log...
Ok - I can see and reproduce the problem, but I'm not sure exactly what's causing it in your case. Compiling that program cannot possibly generate only 80 bytes of code, since using printf() pulls in almost the entire stdio library - on my system compiling your program generates 14144 bytes!
However, compiling the original main.c (or when I remove the printf() statement) does generate exactly 80 bytes.
Somehow you are editing one file, but compiling a different one. Can you please compile by right-clicking on the catalinatest project node in the navigation pane and selecting rebuild from that menu?
Also, could you close all your open source files in Code::Blocks, and then re-open main.c by right-clicking on the one under the catalinatest/Sources node? - that way, you will know you are editing the correct main.c
Ross.
Hi Cluso,
That "return" is required to avoid a warning message since main() is defined (by the ANSI C standard) to return an int. It is never executed (and may in fact be optimized away by the compiler - I've never checked).
Ross.
I tried to fix that other problem where it wouldn't complain if I did "large" on SuperQuad.
Here's what I substitiuted (I think you gave this to me):
#ifndef NO_RAM
#define NO_RAM
#ifdef LARGE
ERROR : LARGE MEMORY MODE NOT SUPPORTED BY THE SUPERQUAD
#endif
#endif
It complains about the colon after "ERROR" says expected "(eol)", got ":"
That's intentional - Homespun has not have a general #error directive (like C does), so when I discover an error condition I artificially generate an error. This causes homespun to spit out the actual line as part of the error message, and I then detect that in Code::Blocks.
Ross.
Maybe this is related to that thing you mentioned earlier where xmm tools is always build with "large" specified in CodeBlocks...
Also, I think there is an error in that code that I found previously. I modified that code to this:
Could that be?
Ross.
I'm tempted to change that LARGE to SMALL...
Yes, give it a try. As I said earlier, I specify LARGE only to force the inclusion of XMM functionality. SMALL may do the same. If not, I'll fix it when I get home. In hindsight, I probably should have used SMALL, since all XMM boards will support SMALL, but not all will support LARGE.
Ross.
http://nanochess.110mb.com/chess1.html
Probably pretty good. Actually, I just compiled it
code = 78180 bytes
Of course, I don't know if it will actually run - it depends on how much run-time stack it might need. Chess programs can be pretty "deep"
Ross.
BTW: I think I'll just remove the large error checking in Flashpoint_def.inc for now, because I'm trying to do a guide for the current version...
- Save the file as toledo.c and add it to the project.
- Replace main with my_main throughout the file toledo.c
- Replace the code in main.c with the following:
Sounds ok.Thinking through what works (v3.0) and doesn't (3.3), it probably is the setup process. I've reinstalled v3.3 so many times I suspect I'm leaving something out. I am now thinking that with respect to XMM programs, there are two things that need running, not one. From page 17 of the manual:
So I think the two batch files to run are build_all and build_utilities
I'm still not sure about xmm.binary - it is not in the /bin folder but I suspect that one of the above batch files might create it.
Ultimately what I'd like to write is a step by step guide specifically for XMM programs/boards. These are different to the standard setup. (I see Rayman has done this just in the last few hours! http://www.rayslogic.com/Propeller/Products/FlashPoint/Catalina/Catalina_FlashPoint.htm)
Step 1 is to get an XMM program compiled in version 3.3 from the command line. Then look at code::blocks. brb
Hi Dr_A,
I'm sure I've said this several times now
XMM.binary is not included in the Catalina distribution because it it platform-dependent. You have to build it yourself. You can do this in either of two ways:
From the Catalina Command Line:
Note: The build_all script (in the utilities folder) is a third way of doing the same job - but it does not walk you through the various options step-by-step - you have to know exactly what to specify on the command line.
Ross.
Great! Now you have no excuse for leaving!
Ross.