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.

Problem with UART interrupt on C6670 EVM

Other Parts Discussed in Thread: SYSBIOS

I'm not sure whether this belongs in this forum on the Keystone / C66xx forum, but I'll try here first. I'm trying to implement a simple program that receives data from the UART. I can do this by constantly polling the UART, but I wanted to make the application interrupt based so that the receive task will be more efficient.

I am using the latest version of SYS/BIOS and CCSv6 along with TMDSEVM6670LE.

Here's what I've done so far:

1. I followed the examples I've seen in the forum to configure the CpIntC to call the interrupt service function when system event 165 (UART Receive event, according to the 6670 Data Manual).  Here is the relevant part of the cfg file:

/* Interrupt configuration */
var CpIntc = xdc.useModule('ti.sysbios.family.c66.tci66xx.CpIntc');
CpIntc.sysInts[165].fxn = '&event165Fxn';
CpIntc.sysInts[165].arg = 165;
CpIntc.sysInts[165].hostInt = 2;
CpIntc.sysInts[165].enable = true;
CpIntc.mapHostIntToHwiMeta(2, 4);

2. Then I added the event165Fxn to the C code. It simply posts a Semaphore to indicate that the UART has received data.

void event165Fxn(UArg arg0)
{
     platform_write("event165Fxn\n");
     Semaphore_post(SEM_uart_rx);
}

3. The receive task is created dynamically in main. It prints a line to the UART and then posts interrupt 165 in order to test the interrupt configuration:

void uartReceiveTask(UArg arg1, UArg arg2)
{
    // char byteBuf[CMD_BUF_LEN];
    // int cmdBufIdx;
    // cmdBufIdx = 0;
    platform_write("UART receive task is started.\n");

    platform_write("setting event 165 ...\n");
    CpIntc_postSysInt(0, 165);

    while(1)

     {

          Semaphore_pend(SEM_uart_rx, BIOS_WAIT_FOREVER);
          platform_write("SEM_uart_rx fired.\n");
      }
}

The main function also has some code to initialize the UART.

When the CpIntc_postSysInit function posts event 165, the interrupt handler fires as expected. The receive task also detects the semaphore has fired once. It appears that everything is wired correctly. The problem is that the UART receive interrupt never appears to fire when text is sent to the serial port.

Has anyone seen this before? Do I need to do something else to enable the UART receive event, or have I misread the manual and chosen the wrong event ID?

Thanks for your help. I've attached a zip file with the entire project if it helps.

Regards,

Dave Rainey

http://e2e.ti.com/cfs-file.ashx/__key/communityserver-discussions-components-files/639/8080.MulitaskTest.7z

  • It looks like you are using the CPU and not using EDMA to service the UART so you shouldn`t be using EVENT 165.

    Please chnage this to event id 164 which is the multiplexed UART interrupt to CPU as shown in the UART user guide.

    You are currently setting it to EVT ID corresponding to URXEVT which is a recieve EVT to the EDMA controller.

    Hope this helps. Your CpIntC configuration in SYSBIOS appears to be correct so I don`t see any issues there.

    Regards,

    Rahul

  • Rahul,

    Thank you for your help. This fixed my problem.

    Regards,

    Dave