Hi,
I am working with the EVMC6747 starter kit, CCS v3.3, DSP BIOS 5.33.05 and PSP 1.20.0. My application has 7 tasks and they are all running well. The application is currently use simple UART driver that write and read straight from UART control register with FIFO enable. I was able to transmit data to the UART and captured from the PC at 115200 consistently through EVMC6747_UART_yyy functions provided by Spectrum Digital. However, there are limitations with the FIFO for the Rx data. I couldn’t get more than 16 bytes at a time therefore I switch to the UART EDMA.
I was told to use PSP 1.30.1 since it is newer than the version 1.20.0. However, we already got the I2C, MSASP and AIC310 drivers working with PS 1.20.0 therefore I am not ready to the new version 1.30.1 if it is not absolutely necessary. Please comment if version 1.30.1 made some critical fixes that I should not miss.
I was able to create GIO channels for both UART2 transmit and receive. My problem is when I transmit the first packet of 51 bytes, the whole DSP load was consumed by the task that called GIO_submit. No other task can execute base on my printf and the “Execution Graph”. I looked in the documentations and there is nothing related about this matter. I changed the GIO_submit() to asynchronous with a call back but that did not help. Please comment on what is GIO doing with the task load.
I include my GIO_create and GIO_submit. Please note that the UART transmission was completed. The PC got all the data but all my tasks were hung.
// This function called by BIOS
void UartInit( void )
{
Uart_init();
uartParams = Uart_PARAMS;
uartParams.hwiNumber = 9;
uartParams.opMode = Uart_OpMode_DMAINTERRUPT;
uartParams.rxThreshold = Uart_RxTrigLvl_1;
uartParams.baudRate = Uart_BaudRate_115_2K;
/* enable the uart instance in the PSC module */
Psc_ModuleClkCtrl(Psc_DevId_1, PSC_UART2_LPSC, TRUE);
}
// This function called by initialization
void UartCreateStreams( void )
{
GIO_Attrs gioAttrs = GIO_ATTRS;
Int32 echoTskStatus= 0;
Uart_ChanParams chanParams;
/*
* Initialize channel attributes.
*/
gioAttrs.nPackets = 2;
chanParams.hEdma = hEdma;
/* Initialize pinmux and evm related configurations */
configureUart();
// Initialize UART
hUart_OUT = GIO_create("/UART0", IOM_OUTPUT, NULL, &chanParams, &gioAttrs);
hUart_IN = GIO_create("/UART0", IOM_INPUT, &echoTskStatus, &chanParams, &gioAttrs);
if((NULL == hUart_IN)||(NULL == hUart_OUT))
{
(void)printf("ERROR: Initialization of UART failed\n");
return;
}
}
// This function transmit UART data
void UartSend( uint8_t *data_, uint16_t dataLength_ )
{
Int status = 0;
memcpy( UartTxBuffer, data_, dataLength_ );
TxCallbackFunction.fxn = (GIO_TappCallback)UartTxCallBack;
TxCallbackFunction.arg = NULL;
status = GIO_submit(hUart_OUT, IOM_WRITE, UartTxBuffer, (size_t *)&dataLength_, &TxCallbackFunction);
if(!((status == IOM_COMPLETED)||(status == IOM_PENDING)))
{
(void)printf("GIO_write UART error\n");
}
else
{
(void)printf("GIO_write UART success...\n");
}
}
Thanks,
Dennis Nguyen