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.

With printf the program work well, without printf the program can't work.



Hi all,

     I'm working a image processing system base on DSP/BIOS on DM642. There are 3 master tasks in my work: image capture, image processing and network transmission.  The image processing task a little too big, more than 3600 lines, and more than 400 printf statements for debug.

     The problem is, when I remove all the printf statements in the image processing task, the program can't work.

  • Sounds like you have a timing issue in your code.  A printf often takes 1000s of CPU cycles and will even cause the processor to momentarily halt while the emulator pulls info from the C I/O buffer to display.

    For starters I recommend trying to narrow down which printf statements are necessary, i.e. can you comment out 398 of th e400 printf statements and still have it working?  Once you get to that point then perhaps we can look at the surrounding code to give you a more proper way to make it work such as polling for a specific bit/event.

  • Than you for reply!

    Yes, in my code have a timing issue. In the PRD module, we have two PRD fuctions: one for the NDK, and another for image processing period. The configuration as follow:

    prdStack:

    priod(ticks): 100

    mode: continuous

    fuction: _llTimerTick

    arg0: 0x00000000

    arg1: 0x00000000

     priod(ms): 100

    prdNewProc:

    priod(ticks): 100

    mode: continuous

    fuction: _StartNewProc

    arg0: 0x00000000

    arg1: 0x00000000

    priod(ms): 100

    The source code is:

    int new100ms=1;

    StartNewProc()

     {

    New100ms=1;

    }

     In the image capture task, the source code is:

    if(new100ms)

    { new100ms=0;

     scomMsg.buf=imagebuf;

    SCOM_putMsg(IntoProc,&scomMsg);

    SCOM_getMsg(ProctoIn,SYS_FORVER);

    }