Hi,
I am interfacing my C6748 DSP hardware device with the PC via a FTDI USB to UART chip. I use the TI PSP UART driver to communicate with the FTDI chip which in turn translates the data to USB to interface with the PC.
Here are the tools and software versions I am using:
CCS: 4.2.4.00033
BIOS 5.41.9.34
PSP 01.30.01
Code Generation Tools: 6.1.19
The problem I have is that whenever I connect to a PC that needs to install the driver for the FTDI chip before it can connect to my device the UART driver crashes (i.e. throws a SYS_abort). I have narrowed the problem down to a possible crash in the GIO_iomCallback function in the gio_cbck.c file but I can't debug any further in the bios. My application continuously tries to read the UART interface using GIO_submit calls on a 128 alligned buffer with a specified callback function. Because GIO_submit is asynchronous I post a semaphore whenever I receive the callback from the IOM_READ command so I don't do two or more successive reads but block the task (with a corresponding SEM_pend on the same semaphore) till i have received the callback from the UART driver. I know I can use GIO_read which has its own internal semaphore but I have tried that and run into other problems in my application so I prefer to stick to the GIO_submit function.
I have realized that when I switch the UART driver I'm using to the debug version and not the release version my application doesn't crash anymore. The main difference between the debug and release versions are the removal of debug information from the uart driver and optimization (level 2) for the release build. As soon as I optimize the debug version of the uart driver that crashes too but I found if I place a LOG_printf call just before the call to invoke the application callback my application no longer crashes even with optimization level 2.
i.e LOG_printf before line 3081 in Uart.c Uart_localCompleteCurrentIO function : (*chanHandle->cbFxn) ((Ptr)chanHandle->cbArg, chanHandle->activeIOP);
So can you tell me the difference between the optimized and unoptimized versions that can cause this by taking a look at the asm output file of the uart driver? I think optimizing is probably omiting certain vital lines of code that may cause a crash given certain conditions like I described above. Using the unoptimized version of the driver in my application is not an option for me due to size/efficiency reasons.
Thanks,
Cecil