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.

EDMA was affected by printf() function

Other Parts Discussed in Thread: TMS320C6747

Dear Sir:

When I'm running NDK2.0  in TMS320C6747 , it contains a lot of prinf() function , normally it is working properly.

But when I setup a Periodic EDMA transfer (trigged by external interrupt), if the function printf() was called , the EDMA transfer don't work properly. In the CPU Register ,the EMCR and SECR corresponding bit was set to 1, this means that it will never run to the EDMA interrupt routine.

What should I do to avoid this problem?

  • Hi,

    Thanks for your post.

    To my opinion, there shouldn't be any relation between EDMA and printf function to stop EDMA transfer, may be, if you would use more printf, it would delay the EDMA transfer due to consumption of more cycles which would decrease the EDMA throughput but no way, the printf function would stop the EDMA transfer.

    May be, I would recommend you to move all the printf's outside the scope of EDMA ISR and just try once, but this is not a genuine solution. Please try evaluate the error status registers (ERRSTAT) in the TC's and check whether do you see any TRERR is enabled which indicates the state of EDMA3TC error interrupt generation. For more info. on TC error registers, please see section 16.4.3.4 from C6747 TRM below:

    http://www.ti.com/lit/ug/spruh91b/spruh91b.pdf

    Thanks & regards,

    Sivaraj K

    ----------------------------------------------------------------------------------------------------------

    Please click the Verify Answer button on this post if it answers your question.

    ----------------------------------------------------------------------------------------------------------

  • Pan,

    When printf() is executed, it interacts with CCS to display data at the console. This uses the emulation Stop Mode, halting the processor and taking control of the processor for a long time in terms of DSP clock cycles. There is probably some documentation on this delay time, most likely on the TI Wiki Pages. Mostly, the comments will be 'do not use printf()' when you are trying to meet any real-time requirements. The printf() display is useful for debugging, but it is very intrusive to a DSP application.

    Even when the DSP is halted, the EDMA can continue to run. If your EDMA setup requires DSP interaction to set it up for each transfer, then you will miss an interrupt but probably still get your next external interrupt to trigger the EDMA before it has been prepared for that next transfer. This will result in EMR and SER having bits set, and the one in EMR is what prevents future transfers on that DMA channel.

    The right solution is to disable the printf() usage. Or you can replace those calls with BIOS equivalent of printf(), which depends on the version you are using. It is very concerning to me that the NDK even has printf() calls, but I have no visibility into that or control of it.

    Regards,
    RandyP