Hello,
I am having trouble with some printf statements not being output to my console in CCS. My CCS project is fairly large, but this failure occurs very early in execution. My beginning of main.c and another function that gets called from main.c are shown below. When I run, "FGB Booting..." prints out just fine in the console. In addition, many other routines that are called following BIOS_start() can print to the console just fine. However, none of the printf calls in FGB_Init() (prior to BIOS_start()) print to the console. Any suggestions?
I have tried digging down into the assembly to see what could be happening. Unfortunately, I have not figured out enough to know how to resolve. I did notice that when printf works correctly, the address to the text data is pushed to a register; and then somewhere in the chain of calls, printf() - _printfi() - fputc(), that address gets pushed to the stack and decremented one character at a time (prior to the _doflush() - HOSTwrite() - writemsg() chain of calls). When printf() malfunctions, I see that the address to the relevant text is stored to a register during the call to printf(). Inside of printf() - prior to the call to _printfi() - the register containing the address of the text data gets overwritten prior to be pushed to the stack (if it ever gets pushed to the stack at all), and I never again see this address appear in the core registers or on the stack during the remainder of the printf() call chain. What could be going wrong?
I have tried manipulating stack sizes - at least I think I have. Here are some values from my Bios config file.
BIOS.heapSize = 0x200000;
heapMemParams.size = 0x200000;
Program.stack = 0x40000;
SysMin.bufSize = 0x2000;
int main()
{
printf("FGB Booting...\n");
FGB_Init();
void FGB_Init(void)
{
Uint8 temp0;
I2C_ReturnType i2c_status;
CSL_GpioRegsOvly gpioRegs = (CSL_GpioRegsOvly)CSL_GPIO_0_REGS;
printf("Initing the DM648 DSP\n");
DSP_Init();
printf("Initializing the GP Timers module\n");
GPTimer_Init();
Here is an excerpt of my console output:
FGB Booting...
��q���q���q���q���q���q���q���q���q���q�NetworkTask: Initializing NDK...
NetworkTask: Starting network services...
NetworkTask: NC_NetStart()
cpsw_MDIO_Init
Notice the garbage characters where there should be print statements originating from my FGB_Init() routine.
Other info:
Bios: Version: bios_6_34_02_18
CCS: Version: 5.3.0.00090
Target: TMS320DM648