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.

TMS320C6747: working McASP examples with UART communication

Part Number: TMS320C6747

Dear Champs,

My customer is trying to add UART communication in McASP examples of PDK 1.0.1(pdk_omapl137_1_0_1 of RTOS SDK 4.0.0.4), but they found an noise in the audio output while UART writing was run.

They added print_UART function into while loop of mcasp_audiodc_test.c(\ti\pdk_omapl137_1_0_1\packages\ti\board\diag\mcasp_audiodc\src) as below.

I'm afraid it takes too much time to execute 'print_UART' function and thus there will be underflow occurred in audio buffer.

Could you please provide your opinion on this and how print_UART function should be added to remove audio noise?

I also attached source files.mcasp_uart.zip

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

while(1)
{
if (uartTickCount++ >= UART_PRINT_COUNTER) {
uartPrintMultipler--;
if (uartPrintMultipler == 0) {
print_uart("INFO %s\n", "UARTWrite test");

uartPrintMultipler = 50;
}
uartTickCount = 0;
}

if(lastFullRxBuf != lastSentTxBuf)
{

Thanks and Best Regards,

SI.

  • SI,

    We don`t recommend using UART in a task that has real time requirements. Printf and console IOs should be avoided in time critical tasks.

    Can you elaborate as to what kind of noise is being reported, is it white noise or clicking or something else? Just want to make sure that it is the UART that is the root cause of the issue. Typically if Console IO and audio need to run simulataneously, we put the console IO task as low priority so that the audio task is always serviced first.

    Other recommendations to try would be to use UART -EDMA implementation and to see if UART CALLBACK MODE gives any improvement.

    Regards,
    Rahul
  • Hi Rahul,

    The noise looks like 'clicking' and 'clicking' was heard only when text printed through UART.

    Thanks and Best Regards,
    SI.
  • Hi,

    By referencing C6748 starterware code(\\C6748_StarterWare_1_20_04_01\examples\lcdkC6748\uart_edma), I implemented UART callback function in my I2S bypass examples.

    I'm debugging my code and I want to check with you if below code for interrupt setting is right.

    ~~~~~~~~~~~~~
    static void EDMA3IntSetup(void)
    {
    #ifdef _TMS320C6X
    IntRegister(C674X_MASK_INT5, EDMA3CCComplIsr);
    IntEventMap(C674X_MASK_INT5, SYS_INT_EDMA3_0_CC0_INT1);
    IntEnable(C674X_MASK_INT5);

    /* *** 2018/01/18, psi, UART callback with DMA *** */
    IntRegister(C674X_MASK_INT7, Edma3ComplHandlerIsr);
    IntRegister(C674X_MASK_INT8, Edma3CCErrHandlerIsr);

    IntEventMap(C674X_MASK_INT7, SYS_INT_EDMA3_0_CC0_INT1);
    IntEventMap(C674X_MASK_INT8, SYS_INT_EDMA3_0_CC0_ERRINT);

    IntEnable(C674X_MASK_INT7);
    IntEnable(C674X_MASK_INT8);
    #else

    ~~~~~~~~~~~~~~~

    And also, I want to check if it is OK to enabled EDMA at each time of UART transfer and I’m worrying if there is an conflict occurred with McASP EDMA when enabled EDMA at UART transfer function.
    Could you please check and let me know your opinion?
    I attached full source code.

    ~~~~~~~~~~~~~~~~~```
    static void UartTransmitData(unsigned int tccNum, unsigned int chNum,
    volatile char *buffer, unsigned int buffLength)
    {
    EDMA3CCPaRAMEntry paramSet;

    /* Fill the PaRAM Set with transfer specific information */
    :
    :

    /* Now write the PaRAM Set */
    EDMA3SetPaRAM(SOC_EDMA30CC_0_REGS, chNum, &paramSet);

    /* Enable EDMA Transfer */
    EDMA3EnableTransfer(SOC_EDMA30CC_0_REGS, chNum, EDMA3_TRIG_MODE_EVENT);
    }
    ~~~~~~~~~~~~~~



    Thanks and Best Regards,
    SI.