I have CAN emulator(gridconnect USB/CAN adapter) connected to S32K144 board as in below picture.
For your information: I am running S32K144_CAN_SLAVE_Example application on board.
I am able to send CAN message from emulator to S32K144. Even LED is toggling on the board, it is receiving CAN messages.
But I am unable to send CAN messages from board to emulator i.e, When I press button on board, it seems board should send CAN message but emulator is observing stuff error as in below picture.
Any suggestion please, why board is not able to send CAN messages ?
and what are the timing settings you use in your USB/CAN tool?
Could you please measure the CAN bus when you send data from microcontroller and send me the screen?
Also, could you please send me the screen of USB/CAN tool receive message settings?
I am using 500 kBit/s time setting. Please see below screenshot.
With this setting, sending of CAN message to board(S32K144 EVB) from USB/CAN tool is successful.
There is problem only when CAN message is sent from board to USB/CAN tool. Below screenshot for reference.
I am running below example on board.
your timing settings set in FlexCAN module seems to be strange. Please use the settings below:
CAN0->CTRL1 = 0x00DB0006; /* Configure for 500 KHz bit time */
/* Time quanta freq = 16 time quanta x 500 KHz bit time= 8MHz */
/* PRESDIV+1 = Fclksrc/Ftq = 8 MHz/8 MHz = 1 */
/* so PRESDIV = 0 */
/* PSEG2 = Phase_Seg2 - 1 = 4 - 1 = 3 */
/* PSEG1 = PSEG2 = 3 */
/* PROPSEG= Prop_Seg - 1 = 7 - 1 = 6 */
/* RJW: since Phase_Seg2 >=4, RJW+1=4 so RJW=3. */
/* SMP = 1: use 3 bits per CAN sample */
/* CLKSRC=0 (unchanged): Fcanclk= Fosc= 8 MHz */
On MCU side I made your changes. Below screenshot for reference.
Still I am only able to send CAN message from USB/CAN tool to MCU.
But I am not able to send CAN message from MCU. Below screenshot observed on PCAN view.
unfortunately, I do not have USB/CAN adapter to check on my side. I can only recommend you to use second S32K board and try the communication between two boards.