why RX_CALLBACK_SIZE is defined as 8 in dsps-v_5.150.2 example?

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.xmece.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
2 posts / 0 new
Last post
RatheeshT
Offline
Last seen:1 year 11 months ago
Joined:2017-01-02 11:08
why RX_CALLBACK_SIZE is defined as 8 in dsps-v_5.150.2 example?

Hi Dialog support team,

In dsps-v_5.150.2 example, macro named as RX_CALLBACK_SIZE was defined as 8. It means after every 8 byte of data received from UART , UART RX ISR loop(void uart_sps_rcv_data_avail_isr(void)) is stopping to receive bytes and calling the callback function below.
My understanding is correct or not? If my understanding is correct, when more than 8bytes are going to be received at a time,then it will miss the remaining bytes or not. Please give some explanation for this?

if(rcv_bytes)
{
void (*rx_callback) (uint8_t, uint32_t);

// Reset RX parameters
uart_sps_env.rx.bufptr = NULL;

// Retrieve callback pointer
rx_callback = uart_sps_env.rx.callback;

if(rx_callback != NULL)
{
// Clear callback pointer
uart_sps_env.rx.callback = NULL;

// Call handler
rx_callback(SPI_STATUS_OK, rcv_bytes);
}
else
{
ASSERT_ERR(0);
}
}

Device:
MT_dialog
Offline
Last seen:2 months 2 weeks ago
Staff
Joined:2015-06-08 11:34
Hi RatheeshT,

Hi RatheeshT,

遵循configurati RX_CALLBACK_SIZE值on of the UART FIFO, that means that the device will trigger an interrupt when the FIFO of the UART reaches the amount of 8 characters, and thats why the allocation of the buffer follows the RX_CALLBACK_SIZE, the flow of the receiving bytes is stopped by the h/w itself and not via code (as long as you keep the original DSPS fw). So yes from a perspective your understanding is correct. Now, because of the reason that you 've mentioned, is why the FIFO of the UART is configured to operate at half the UART FIFO, so when the external device sends more than 8 bytes, the extra data that the external device will send (in case it misses the flow off) will be stored in the FIFO and will not be missed.

Thanks MT_dialog