Other Parts Discussed in Thread: HALCOGEN
Hi,
configured halcogen (rm48hdk) for debug printing and receiving char's using isr both for rx and tx on sci2.
Single usage of rx and tx works , together not.
After debugging i sorted out:
Gernerated code:
void sciReceive(sciBASE_t *sci, uint32 length, uint8 * data)
{
/* USER CODE BEGIN (17) */
/* USER CODE END */
if ((sci->SETINT & SCI_RX_INT) == SCI_RX_INT)
{
/* we are in interrupt mode */
uint32 index = sci == sciREG ? 0U : 1U;
/* clear error flags */
sci->FLR = SCI_FE_INT | SCI_OE_INT | SCI_PE_INT;
g_sciTransfer_t[index].length = length;
g_sciTransfer_t[index].data = data;
}
...
void sciSend(sciBASE_t *sci, uint32 length, uint8 * data)
{
uint32 index = sci == sciREG ? 0U : 1U;
/* USER CODE BEGIN (11) */
/* USER CODE END */
if ((g_sciTransfer_t[index].mode & SCI_TX_INT) != 0U)
{
/* we are in interrupt mode */
g_sciTransfer_t[index].length = length;
g_sciTransfer_t[index].data = data;
/* start transmit by sending first byte */
sci->TD = *g_sciTransfer_t[index].data++ ;
sci->SETINT = SCI_TX_INT;
}
Both are using the same structure (index debugged as 1 for both rx and tx ( as written in the linxLevelInterrupt g_sciTransfer_t[1U])).
Am I right if a tx chain of several chars is pending and for rx a sciSend is called for reloading the notification, it may be a collision?
Looking forward for comments...
Regards
Andreas