Hi p_decesare,
Did you initialize the PTD0 and PTD15? The project only initialize the PT16 by default.
If you want to only receive CAN Message with the ID 0X555, you can direct #define NODE_B in FlexCAN.h.(The codes has configure check all ID bits and allow 0x555 by default.)

Once you receive the CAN Message with the ID 0X555, the ricevuto will be true.
The this condition will never be established: if (((CAN0->IFLAG1 >> 4) & 0) && ricevuto)
And the blue LED will never light.
Please try to debug:
for (;;)
{ /* Loop: if a msg is received, transmit a msg */
if ((CAN0->IFLAG1 >> 4)) { /* If CAN 0 MB 4 flag is set (received msg), read MB4 */
FLEXCAN0_receive_msg (); /* Read message */
PTD->PSOR |= 1<<0 | 1<<16;
PTD->PCOR |= 1<<15;
}
else{
PTD->PSOR |= 1<<15 | 1<<16;
PTD->PCOR |= 1<<0;
}
}
If you put a breakpoint PTD->PCOR |= 1<<15;, you will see the red LED light once. And then the codes will turn off red LED and light bule LED.
If you want to use print on the console the ID of CAN message, please refer the "S32K144_Project_LPUART".

The ID of CAN message(RxID) will be read in FLEXCAN0_receive_msg.

Best Regards,
Robin
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------