Other Parts Discussed in Thread: HALCOGEN, TPIC1021
Hi,
I'm trying to communicate between two MCUs using LIN. The first controller (tms570ls1224 - master) sends the header to the second controller (tms570ls043 - slave).
The ID is received correctly by the slave. After receiving the ID, the slave should send data to the master. Unfortunately, the master does not receive any RX flags.
I set drivers in halcogen. LIN_ID_INT interrupts on the slave side and LIN_RX_INT on the master side. The frame has the same number of bits configured, the same speed in both cases.
Below I attach a simple code that I use for communication.
Any tip welcome.
// MASTER
int main(void)
{
/* USER CODE BEGIN (3) */
_enable_IRQ();
gioInit();
linSetLength(linREG, 8);
linInit();
while((!(linIsTxReady(linREG))) || (linREG->FLR & 0x8U == 0x8U));
linSendHeader(linREG, 0x3D);
while(1);
/* USER CODE END */
}
void linNotification(linBASE_t *lin, uint32 flags)
{
/* USER CODE BEGIN (23) */
linGetData(linREG, getData_ptr);
/* USER CODE END */
}
// SLAVE
int main(void)
{
/* USER CODE BEGIN (3) */
_enable_IRQ();
linSetLength(linREG, 8);
linInit();
while(1);
/* USER CODE END */
}
void linNotification(linBASE_t *lin, uint32 flags)
{
/* enter user code between the USER CODE BEGIN and USER CODE END. */
/* USER CODE BEGIN (23) */
linSend(linREG, send_example_ptr);
get_id = linGetIdentifier(linREG); //is used to validate the ID
/* USER CODE END */
}