#define TX_MAILBOX (1UL)
#define TX_MSG_ID (1UL)
#define RX_MAILBOX (0UL)
#define RX_MSG_ID (0x190UL) // From default we have used required msg id to recieve
const flexcan_user_config_t canCom1_InitConfig0 = {
.pe_clock = FLEXCAN_CLK_SOURCE_OSC,
.max_num_mb = 16,
.num_id_filters = FLEXCAN_RX_FIFO_ID_FILTERS_8,
.is_rx_fifo_needed = false,
.flexcanMode = FLEXCAN_NORMAL_MODE,
.bitrate = {
.propSeg = 7,
.phaseSeg1 = 4,
.phaseSeg2 = 1,
.preDivider = 4,
.rJumpwidth = 1
},
.transfer_type = FLEXCAN_RXFIFO_USING_INTERRUPTS
};
// Following is dataInfo used to configure RX mailbox and we have updated the required data_length with 8 to receive a message with message id 0x190 rather than 1 in the default example.
flexcan_data_info_t dataInfo =
{
.data_length = 8U,
.msg_id_type = FLEXCAN_MSG_ID_STD
};
Hi,
there are two CAN transceivers on the board, standalone TJA1145 and second as part of SBC chip. The SBC chip is put by jumper J45 in Debug mode so the CAN transceiver is set to normal operation mode by default allowing CAN communication without SPI configuration. By default FlexCAN_D module is connected to it (jumpers J48, J50).
The TJA1145 starts in Standby mode so you need to configure it through SPI to put device to Normal mode and enable CAN transceiver. By default FlexCAN_A module is connected to it (jumpers J58, J60).
There is no SDK based example directly for this board, although using SBC's transceiver it could run.
The TJA1145 generic driver can be found e.g. here https://community.nxp.com/message/936919?commentID=936919#comment-936919
BR, Petr