Hello,
I am attempting to automate our build and flash procedures using the loadti script. I do not seem to be able to access the argv data from my program. I have created a simple program as a test, that only uses printf to print the arguments received. I can print the argc value, which is correct, but the program seems to hang when I try to print or access the first argv value (argv(0)). At this point, I have to "control c" out of the script.
In the project, I set the "Set C argc/argv memory size" to 512. Are there any other configuration options I need to initialize? I have included my test program and the output from running loadti.
Using Code Composer Studio 5.1.1.00031
Target is 5502 (TMS320C5502)
Debugger is Spectrum Digital XDS510 USB
Simple test code below:
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
void main(int argc, char *argv[])
{
printf("\nHELLO, We will be burning these files:\n");
printf("\nargc value is: %i\n", argc);
printf("\nargv[0] is: %s \n", argv[0]);
printf("\nargv[1] is: %s \n", argv[1]);
printf("\nargv[2] is: %s \n", argv[2]);
printf("\nargv[3] is: %s \n", argv[3]);
printf("\nargv[4] is: %s \n", argv[4]);
}
Batch file to run loadti below:
CALL loadti -v,-c C:\SPD_TI_Workspace\Test_ARGV\TMS320C5502.ccxml -x ^ C:\SPD_TI_Workspace\Test_ARGV\mylog.xml ^ C:\SPD_TI_Workspace\Test_ARGV\Debug\Test_ARGV.out ^ C:\YL_2_2_Binaries\Flash\MP_Link_DSP_SSBoot.bin ^ C:\YL_2_2_Binaries\Flash\MP_Link_DSP_Dataload.bin ^ C:\YL_2_2_Binaries\Flash\MP_Link_DSP_Dataload.bin ^ C:\YL_2_2_Binaries\Flash\MP_Link_DSP_App.bin
DOS Command Session output:
C:\SPD_TI_Workspace\Test_ARGV>argv
C:\SPD_TI_Workspace\Test_ARGV>CALL loadti -c C:\SPD_TI_Workspace\Test_ARGV\TMS32
0C5502.ccxml -x C:\SPD_TI_Workspace\Test_ARGV\mylog.xml C:\SPD_TI_Workspace\Test
_ARGV\Debug\Test_ARGV.out C:\YL_2_2_Binaries\Flash\MP_Link_DSP_SSBoot.bin C:\Y
L_2_2_Binaries\Flash\MP_Link_DSP_Dataload.bin C:\YL_2_2_Binaries\Flash\MP_Link_
DSP_Dataload.bin C:\YL_2_2_Binaries\Flash\MP_Link_DSP_App.bin
***** DSS Generic Loader *****
START: 09:35:04 GMT-0400 (EDT)
Configuring Debug Server for specified target...
Done
WARNING: Unlicensed
An error occurred attempting to acquire a license for this product.
TARGET: Spectrum Digital XDS510USB Emulator
Connecting to target...
C55xx: GEL Output: C5502_Init Complete.
testEnv.outFiles: C:\SPD_TI_Workspace\Test_ARGV\Debug\Test_ARGV.out
Loading C:\SPD_TI_Workspace\Test_ARGV\Debug\Test_ARGV.out
Done
Target running...
Interrupt to abort . . .
HELLO, We will be burning these files:
argc value is: 5
Terminate batch job (Y/N)? y
C:\SPD_TI_Workspace\Test_ARGV>
I don't know why we get the "license error". Our license server is up and running.
Additional debugging shows the arguments are getting stored in memory, so the loadti script is working okay. The problem seems to be a "printf" weirdness. I have allocated a large heap size and that does not help. I can put in additional printf statements that work just fine, however trying to "prinft argv" does not work.
Thanks for you time!
Stephen