Skip to main content
rpoon
Associate II
July 18, 2019
Solved

Not able to send the data without delay in UART interfacing. I am using 3 UART channel at a time. I want to know how can I remove the delay .

  • July 18, 2019
  • 1 reply
  • 1375 views

I am working with 560B54L5 discovery board. I am using runtime IO component with uart test application. I am able to send data at one channel at a time(one channel).

my issues are

  1. how to receive the data using interrupt in case of runtime IO?
  2. How can I use three channel at a time in case of runtime IO?
  3. what is the parameter in runtime io function (fd and flags)?

If I can not use runtime IO for 3 uart channel than can you please suggest me some alternate for removing the delay component after write function.

status = sd_lld_write(&SD1,command,getStrlen(command));

osalThreadDelayMilliseconds(200);

Thanks

Rewatee

This topic has been closed for replies.
Best answer by Erwan YVIN

Hello ,

You can not use 3 different uart Channels for Runtime IO.

  • if you want to remove the delay, You should increase the STACK SIZE
  • If you want to interact with 3 uart Channels , i advice you to use a RTOS (Chibios or FreeRTOS) with 3 differents threads matching with 3 UARTs

we have already performed this task on Chibios with 2 UARTs

just a note, sd_lld_read is a blocking function

/**
 * @brief Low level serial driver read
 *
 * @param[in] sdp pointer to a @p SerialDriver object
 * @param[out] buffer data buffer receiver
 * @param[out] len number of bytes received
 *
 * @return The number of bytes effectively read.
 *
 * @api
 */
uint16_t sd_lld_read(SerialDriver* sdp, uint8_t* buffer, uint16_t len) {
 
 uint16_t ret;
 
 /* If the interrupts are disabled, reception is not possible otherwise the
 execution should be blocked till all bytes are received.*/
 if(irqGetExtIntEnable() == 0U) {
 ret = 0U;
 } else {
 
 if(sdp->config->api_mode != SPC5_LIN_API_MODE_BUFFERED_IO) {
 SPC5_LIN_RX_IN_PROGRESS(sdp);
	}
 
 /* Check if DMA is enabled.*/
#if (SPC5_SERIAL_DMA_MODE == SPC5_SERIAL_DMA_ON)
 /* Check if the LinFlex support DMA.*/
 if ((sdp->dma_supported == TRUE) && (sdp->config->dma_enable == TRUE)) {
 ret = sd_rx_dma(sdp, buffer, len);
 } else {
 ret = sd_rx(sdp, buffer, len);
 }
#else
 ret = sd_rx(sdp, buffer, len);
#endif
 
 if(sdp->config->api_mode != SPC5_LIN_API_MODE_BUFFERED_IO) {
 SPC5_LIN_WAIT_FOR_RX_COMPLETION(sdp);
	}
 }
 
 return ret;
}

check this application

SPC56ECxx_RLA Crypto Test Application

Best Regards

Erwan

1 reply

Erwan YVIN
Erwan YVINBest answer
ST Technical Moderator
July 18, 2019

Hello ,

You can not use 3 different uart Channels for Runtime IO.

  • if you want to remove the delay, You should increase the STACK SIZE
  • If you want to interact with 3 uart Channels , i advice you to use a RTOS (Chibios or FreeRTOS) with 3 differents threads matching with 3 UARTs

we have already performed this task on Chibios with 2 UARTs

just a note, sd_lld_read is a blocking function

/**
 * @brief Low level serial driver read
 *
 * @param[in] sdp pointer to a @p SerialDriver object
 * @param[out] buffer data buffer receiver
 * @param[out] len number of bytes received
 *
 * @return The number of bytes effectively read.
 *
 * @api
 */
uint16_t sd_lld_read(SerialDriver* sdp, uint8_t* buffer, uint16_t len) {
 
 uint16_t ret;
 
 /* If the interrupts are disabled, reception is not possible otherwise the
 execution should be blocked till all bytes are received.*/
 if(irqGetExtIntEnable() == 0U) {
 ret = 0U;
 } else {
 
 if(sdp->config->api_mode != SPC5_LIN_API_MODE_BUFFERED_IO) {
 SPC5_LIN_RX_IN_PROGRESS(sdp);
	}
 
 /* Check if DMA is enabled.*/
#if (SPC5_SERIAL_DMA_MODE == SPC5_SERIAL_DMA_ON)
 /* Check if the LinFlex support DMA.*/
 if ((sdp->dma_supported == TRUE) && (sdp->config->dma_enable == TRUE)) {
 ret = sd_rx_dma(sdp, buffer, len);
 } else {
 ret = sd_rx(sdp, buffer, len);
 }
#else
 ret = sd_rx(sdp, buffer, len);
#endif
 
 if(sdp->config->api_mode != SPC5_LIN_API_MODE_BUFFERED_IO) {
 SPC5_LIN_WAIT_FOR_RX_COMPLETION(sdp);
	}
 }
 
 return ret;
}

check this application

SPC56ECxx_RLA Crypto Test Application

Best Regards

Erwan

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question.