I have a problem about CAN_TX in MPC5746R.
I wanted to send a sample date but i can't get right date in Oscilloscope.
I didn't know what's wrong. Can someone give me a hand ? thank you very much.
There are my code . Any suggestion is helpful.
int main(void)
{
/* Write your local variable definition here */
#define TX_MAILBOX (1UL)
#define TX_MSG_ID1 (1UL)
#define TX_MSG_ID2 (2UL)
#define RX_MAILBOX (0UL)
#define RX_MSG_ID1 (2UL)
#define RX_MSG_ID2 (1UL)
uint8_t TX_date[1];
uint8_t TX_date1[1];
/*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
#ifdef PEX_RTOS_INIT
PEX_RTOS_INIT(); /* Initialization of the selected RTOS. Macro is defined by the RTOS component. */
#endif
/*** End of Processor Expert internal initialization. ***/
/* Write your code here */
CLOCK_SYS_Init(g_clockManConfigsArr, CLOCK_MANAGER_CONFIG_CNT,
g_clockManCallbacksArr, CLOCK_MANAGER_CALLBACK_CNT);
CLOCK_SYS_UpdateConfiguration(0U, CLOCK_MANAGER_POLICY_FORCIBLE);
PINS_DRV_Init(NUM_OF_CONFIGURED_PINS, g_pin_mux_InitConfigArr);
FLEXCAN_DRV_Init(INST_CANCOM1, &canCom1_State, &canCom1_InitConfig0);
FLEXCAN_DRV_Init(INST_CANCOM2, &canCom2_State, &canCom2_InitConfig0);
flexcan_data_info_t dataInfo =
{
.data_length = 1UL,
.msg_id_type = FLEXCAN_MSG_ID_STD
};
/* Configure TX message buffer with index TX_MSG_ID1 and TX_MAILBOX*/
FLEXCAN_DRV_ConfigTxMb(INST_CANCOM1, TX_MAILBOX, &dataInfo, TX_MSG_ID1);
FLEXCAN_DRV_ConfigTxMb(INST_CANCOM2, TX_MAILBOX, &dataInfo, TX_MSG_ID2);
while(1)
{
TX_date[0] = 0x11U;
/* Execute send non-blocking */
FLEXCAN_DRV_Send(INST_CANCOM1, TX_MAILBOX, &dataInfo, TX_MSG_ID1, (uint8_t*)TX_date);
}