Forums

2808 dev board program too big - my solution

Started by sr_gamer August 27, 2009
I found I was running out of ram so I couldn’t put my programs on the chip (I am currently using a 2809 chip, yes in the 2808 dev board).

When I put the program into flash instead every print statement would seize the program – so I disabled the end of program breakpoints which sort of worked, this made the program run all the way through, however now the program never halted and the whole thing hung up. Pasted at the end is my command file and the perl script that loads, runs and logs. To get around the problem of the never halting program I instructed the perl script to repeatedly open the log file and check for an “END OF FILE”, when that is found the perl manually halts the run and everything wraps up gracefully. So all I had to do was instruct the program on the chip to print "END OF FILE" when it had completed the tasks I wanted it to do.

This method seems like a major kludge, it works, but.. Do you have any better suggestions?

Thanks!

-Simon

######################################### go.pl #########################################

BEGIN {

push @INC, "C:/CCStudio_v3.3/bin/utilities/ccs_scripting";

}

use CCS_SCRIPTING_PERL;

$Module_Dir = "$ARGV[0]";

$MyProgram = "$Module_Dir\\debug\\$ARGV[1].out";

$numArgs = $#ARGV + 1;

if ($numArgs < 2)

{

print "\nUsage:
Simon-

> I found I was running out of ram so I couldnt put my programs
> on the chip (I am currently using a 2809 chip,
> yes in the 2808 dev board).
>
> When I put the program into flash instead every print statement
> would seize the program so I disabled the end
> of program breakpoints which sort of worked, this made the
> program run all the way through, however now the program
> never halted and the whole thing hung up. Pasted at the end is
> my command file and the perl script that loads, runs
> and logs. To get around the problem of the never halting
> program I instructed the perl script to repeatedly open the
> log file and check for an END OF FILE, when that is found the
> perl manually halts the run and everything
> wraps up gracefully. So all I had to do was instruct the
> program on the chip to print "END OF FILE" when it had
> completed the tasks I wanted it to do.
> This method seems like a major kludge, it works, but..
> Do you have any better suggestions?

As you may know, print() and printf() in a CCS DSP program translate to some type of JTAG communication back to the
host PC (over parallel port or USB). My guess is that when your print() function executes from Flash instead of
internal mem, CCS encounters some type of timing issue, or maybe it wants to "modify the code" slightly with some type
of breakpoint instruction, but it can't because that mem location is not writable (Flash).

What you might try is to create your own version of the function, say sr_print(), which in turn calls print(), and
locate the function in internal mem. Then replace all of your print() calls. Maybe that would be a tradeoff that
saves mem yet allows normal CCS screen and file I/O to work.

PS. I have to say, your kludge is a very creative solution. Your program has to "say the magic word" to be allowed to
exit :-)

-Jeff
> ######################################### go.pl #########################################
>
> BEGIN {
>
> push @INC, "C:/CCStudio_v3.3/bin/utilities/ccs_scripting";
>
> }
>
> use CCS_SCRIPTING_PERL;
>
> $Module_Dir = "$ARGV[0]";
>
> $MyProgram = "$Module_Dir\\debug\\$ARGV[1].out";
>
> $numArgs = $#ARGV + 1;
>
> if ($numArgs < 2)
>
> {
>
> print "\nUsage:

_____________________________________