I have modified the Bare-Metal Kinetis example to have null filters, and to use only TX MB queue, and the RxFIFO MBs fill a further binary-sized RAM FIFO, and this can work for either or both ports on Kinetis. I use this for J1939, and could probably take out more of that general-case example code for this specific purpose if I were ambitious. As for 'not receiving our TX messages' there are erratta on Kinetis in regard to 'disable self reception'...
This is started by:
FlexCAN_Open(); //Open FlexCAN Interfaces
// Initialize CAN module
FlexCAN_Init(CAN_Bitrate, CAN0_BASE_PTR);
and polled thus:
noBytesRx = FlexCAN_Read_RxFIFOQueue(&PortID, &idRxed, &tstampRXed, bytesRx);
while(noBytesRx >0) //nonEmpty FIFO?
{
if( PortID == 0 ) //Only CAN0 (1-wire) is currently J1939-formatted
j1939_post(noBytesRx, &idRxed, tstampRXed, bytesRx);
else
{
}
noBytesRx = FlexCAN_Read_RxFIFOQueue(&PortID, &idRxed, &tstampRXed, bytesRx);
}
--ERGII