This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

dsk 6713+ccs3.1+debbugging+ printf

Dear All,

Can anybody suggest me how to use printf() for debugging in this following simple code. I have used this format printf("value %d",i) but did not worked. I have heard about log_printf , bit did not able to use. Plz suggest me a suitable debugging method.

Thanks in adv.

(reader may get surprise with this code. plz dont be surprised the code has been built to perform ofdm, but unnecessary line has been deleted to make it small to post here. I believe procedure to use print which will be suggested for this code here, will work on the complex code also)

      
 *  ======== tone.c ========

#include "tonecfg.h"
#include "stdio.h"
#include "stdlib.h"
#include "dsk6713.h"
#include "dsk6713_aic23.h"
#include "dsk6713_led.h"
#include "dsk6713_dip.h"
# include "math.h"
/* Codec configuration settings */
DSK6713_AIC23_Config config = {
    0x0017, // 0 DSK6713_AIC23_LEFTINVOL  Left line input channel volume
    0x0017, // 1 DSK6713_AIC23_RIGHTINVOL Right line input channel volume
    0x00d8, // 2 DSK6713_AIC23_LEFTHPVOL  Left channel headphone volume
    0x00d8, // 3 DSK6713_AIC23_RIGHTHPVOL Right channel headphone volume
    0x0011, // 4 DSK6713_AIC23_ANAPATH    Analog audio path control
    0x0000, // 5 DSK6713_AIC23_DIGPATH    Digital audio path control
    0x0000, // 6 DSK6713_AIC23_POWERDOWN  Power down control
    0x0043, // 7 DSK6713_AIC23_DIGIF      Digital audio interface format
    0x0001, // 8 DSK6713_AIC23_SAMPLERATE Sample rate control
    0x0001  // 9 DSK6713_AIC23_DIGACT     Digital interface activation
};


void main()
{
DSK6713_AIC23_CodecHandle hCodec;
Uint32 leftsample,rightsample;
int N=64,i=0,j=0;
double y[128];
double x[128];
double w[128];
	for(i=0;i<128;i++)
	{
		x[i]=0;
		y[i]=0;
	}

	 DSK6713_init();
       hCodec = DSK6713_AIC23_openCodec(0, &config);
       DSK6713_AIC23_setFreq(hCodec,DSK6713_AIC23_FREQ_48KHZ); 
       
       gen_w_r2(w, N); 		// Generate coefficient table
                
	while(1)
	{		while (!DSK6713_AIC23_read(hCodec,&leftsample));
	   		while (!DSK6713_AIC23_read(hCodec,&rightsample));
			x[2*i]=leftsample;
	     		x[2*i+1]=0;
	   		while (!DSK6713_AIC23_write(hCodec,5*y[2*i]));
		     while (!DSK6713_AIC23_write(hCodec,5*y[2*i+1]));
if(i==63) { for(j=0;j<=127;j++) { y[j]=x[j]; } i=-1; } i++;
	}
    
    	DSK6713_AIC23_closeCodec(hCodec);
}

  • Please find some helpful information on the TI Wiki Pages. If you go to that link and search for "printf", you will find some tips for using printf.

    I know that CCSv4 works well with printf, although one thing I have always had to remember was to allocate heap space in addition to using #include <stdio.h>, which you already have.

    But CCS 3.1 might have other issues that I do not recall. You may want to consider to upgrade to CCSv4. It is available with a free license with used with on-board emulation on a DSK or when using an inexpensive XDS100 JTAG pod.

    Regards,
    RandyP

     

    If you need more help, please reply back. If this answers the question, please click  Verify Answer  , below.

  • I have tried to use ccs4 but did not able to build a single project yet. There are lots of error coming plz refer to forum post

    Forum :Code Composer Studio

    Subject: CONVERSON OF PROJECT FROM CCS V3.1 TO CCS V4

    Posted by: Paban Saha

    Me & paban are working in same group .

    Plz suggest what to do.

     

  • Since the migration to CCSv4 is addressed in the other thread, I will not address it here. For the convenience of future readers, the other thread concerning the migration from CCS 3.1 to CCSv4 is at http://e2e.ti.com/support/development_tools/code_composer_studio/f/81/t/99905.aspx . At the time I write this, that thread has been marked with the Verify Answer button, which tells us that the question is answered. You may suggest to your co-worker that he has used enough large font / bold type challenges to those who are trying to help him.

    In the support files that come with the DSK6713, there are numerous examples for using the various peripherals in the DSP and on the board. These support files are available from the board vendor if you do not have them today. If you do a search, you will find some of those examples use printf for debug display. My recommendation is to use one of those examples to confirm that you can get printf to work. Then you can choose to either build your application up from there or work to discover what needs to be added or changed in your application to make printf work.

    Please let us know what results you find, either positive or negative. And if you find a solution, please post it here.

    Regards,
    RandyP

     

    If you need more help, please reply back. If this answers the question, please click  Verify Answer  , below.

  • From some old notes of mine, it looks like there were some issues with printf and CCS 3.1. These were fixed in CCS 3.3 and some later releases of CCS 3.2, although 3.2 would not apply to your use of the C6713.

    The best choice is of course to upgrade to CCSv4. But can you at least upgrade to CCS 3.3? This would be done through the Help->Update Adviser menu item.

    Regards,
    RandyP

     

    If you need more help, please reply back. If this answers the question, please click  Verify Answer  , below.

  • Dear Randy, Thanx for the information. I have successfully migrated that project to ccs4 & printf is also working fine in ccs4. But 1 little - if run the the program multiple time or reset it multiple times console prints are coming, but traces of print previous iteration remains in the console can u tell me whats the procedure to clear the console at each reset. rgrd biprangshu
  • There is an icon for the Console Window that will clear it when you click that icon. I do not know of a way to clear it every time you reset. If this is an issue you need to solve, I recommend you first search on the TI Wiki Pages for help information on using CCSv4, and then if you still seek this answer you should post this question on the Code Composer forum where software issues can be addressed more easily.

    Regards,
    RandyP