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.

RTOS/TMS320C6748: PSP Driver for UART C6748, timeout settings

Part Number: TMS320C6748
Other Parts Discussed in Thread: SYSBIOS

Tool/software: TI-RTOS

Hello

I am using the C6748 running on LCKD board. in our project we need to work with the UART on high speed boudrate of ~3mbit/sec.

I use the pdk_C6748_2_0_0_0 with UART driver biospsp_03_00_01_00

I work with the UART configured to work in dma mode

I have 2 units one transmit periodically 88 bytes with delay between transmission, the other receive 88bytes.

I add timeout parameter so when the receiver do not receive data it will wait for TIMEOUT period and then try reading again.

the code in the receiver run in loop and waits for 88 byes, if not receiving wait a delay and try to read again 

while (1)
{
len=CTRL_CH_SIZE+AUDIO_CH_SIZE;
ledSet();
status = GIO_read(uartRxHandle,&uartRxBuffer,&len);
if (IOM_COMPLETED != status)
{
GIO_control(uartRxHandle,Uart_IOCTL_RESET_RX_FIFO,NULL);
//GIO_control(uartRxHandle,Uart_IOCTL_CANCEL_CURRENT_IO,NULL);
ledClr();
Task_sleep(SYNC_DELAY);

}

else

break;
}

if  timeout  accured i use

GIO_control(uartRxHandle,Uart_IOCTL_RESET_RX_FIFO,NULL);
GIO_control(uartRxHandle,Uart_IOCTL_CANCEL_CURRENT_IO,NULL);

but when calling the Uart_IOCTL_CANCEL_CURRENT_IO the unit crash and print:

[C674X_0] A0=0x0 A1=0x0
[C674X_0] A2=0x1 A3=0xc002c268
[C674X_0] A4=0x4 A5=0x3
[C674X_0] A6=0xc003e3fc A7=0x0
[C674X_0] A8=0x0 A9=0x0
[C674X_0] A10=0x0 A11=0x0
[C674X_0] A12=0x0 A13=0x0
[C674X_0] A14=0x0 A15=0x0
[C674X_0] A16=0x0 A17=0x0
[C674X_0] A18=0xc003d8e8 A19=0x20
[C674X_0] A20=0x0 A21=0x0
[C674X_0] A22=0x5e741f9a A23=0xae36af58
[C674X_0] A24=0xef44fb5c A25=0x2503f90e
[C674X_0] A26=0x9a736b7e A27=0xc003f354
[C674X_0] A28=0xc0036188 A29=0x0
[C674X_0] A30=0x0 A31=0xc0062288
[C674X_0] B0=0x1d0c000 B1=0x1c04180
[C674X_0] B2=0x0 B3=0xc0055f60
[C674X_0] B4=0x8110c005 B5=0x0
[C674X_0] B6=0x0 B7=0x0
[C674X_0] B8=0x8110c005 B9=0xc003e3fc
[C674X_0] B10=0x0 B11=0x0
[C674X_0] B12=0x0 B13=0x0
[C674X_0] B14=0xc0066550 B15=0xc003d9d0
[C674X_0] B16=0xc003d928 B17=0x0
[C674X_0] B18=0xa B19=0x78
[C674X_0] B20=0x69 B21=0x2078b970
[C674X_0] B22=0xf B23=0x0
[C674X_0] B24=0xd12b6835 B25=0x180d74c
[C674X_0] B26=0xe9bf71b9 B27=0x0
[C674X_0] B28=0x2e4 B29=0x3
[C674X_0] B30=0xffffffff B31=0x60
[C674X_0] NTSR=0x1020c
[C674X_0] ITSR=0xf
[C674X_0] IRP=0xc00589e0
[C674X_0] SSR=0x0
[C674X_0] AMR=0x0
[C674X_0] RILC=0x0
[C674X_0] ILC=0x0
[C674X_0] Exception at 0x0
[C674X_0] EFR=0x2 NRP=0x0
[C674X_0] Internal exception: IERR=0x1
[C674X_0] Instruction fetch exception
[C674X_0] ti.sysbios.family.c64p.Exception: line 248: E_exceptionMin: pc = 0xc00589e0, sp = 0xc003d9d0.
[C674X_0] xdc.runtime.Error.raise: terminating execution

when we do not call Uart_IOCTL_CANCEL_CURRENT_IO

the unit crash after starting the transmitter and receiving the first frame

when I work without timeout (blocking) I can read data correctly

Is there any problem in using the timeout parameter?

I tried this with boudrate of 115200 and get the same resaults.

  • this is a fairly old PSP version so I am not sure if this is an issue with the driver or if the blocking timeout is causing some sort of internal exception in the SYSBIOS. How are you implementing the timeout? Can you provide your project here so that we can reproduce the issue.

    Also please specify if the driver is in POLL mode or interrupt mode and with or without FIFO setup? Are you also using EDMA for data moment. If will also good to get a Core Resgiter dump from Register view when the exception occurs so that we analyze the issue.

    Regards,
    Rahul
  • Thanks for you quick response,

    I send you the project. the timeout is set in the following way:

    GIO_Params_init(&ioParams);

     chanParams.hEdma = hEdma;

    ioParams.chanParams = (Ptr)&chanParams;

    ioParams.timeout=TIMEOUT_DELAY;//in usec

    /* create the required streams for the UART demo */

    uartTxHandle = GIO_create("/uart1", GIO_OUTPUT, &ioParams, &eb);

    uartRxHandle = GIO_create("/uart1",GIO_INPUT, &ioParams, &eb);

     

    I work in mode: Uart_OpMode_DMAINTERRUPT

    I tried with and without fifo, currently I tried it with :Uart_RxTrigLvl_8

    When there is no data send the gio_read will exit with the timeout status (-11) as needed, but when data start to come (or calling

    Uart_IOCTL_CANCEL_CURRENT_IO) it crash.

    In the project I use dipswitch SW1 pin 5 to stop start transmision. in common.h you need to set operation mode to transmit or receive mode. 

    We just start using the C6748 in a new project, I understood that currently the latest updated package we need to work with is the pdk_C6748_2_0_0_0 on CCS5.1.

    https://e2e.ti.com/support/embedded/tirtos/f/355/p/566210/2075889#2075889

    Is it better for us to work without the psp drivers, and use the starterware drivers, and addopt them in the latest dsp/bios and cc6/ccs7 and not using an old development environment. does other packages (for example NDK) will work on the latest CCS.

    Best Regards

    Ilan