cancel
Showing results for 
Search instead for 
Did you mean: 

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 .

rpoon
Associate II

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

1 ACCEPTED SOLUTION

Accepted Solutions
Erwan YVIN
ST Employee

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

View solution in original post

1 REPLY 1
Erwan YVIN
ST Employee

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