4 years, 11 months ago.

Problem with the use of the CAN class.

Hello I have a problem with this, I am trying to use the CAN-BUS in the NXP OM13094 expansion for the LCPXpresso54608 board and when I try to compile an error ocurred: "Unknown type name 'CAN'". I think that this error is due to the fact that the development board does not have CAN communication but that it has the expansion. The problem is that the expansion isn't in mbed library and you can't used. Does anyone know how to help me? Thank you.

1 Answer

4 years, 11 months ago.

Hi José, I have only some tips because I have not experience with NXP boards.

Your board already have a CAN interface. You can check the page 6 here https://www.nxp.com/docs/en/data-sheet/LPC546XX.pdf or when you look on the pinout of your board, you can see some CAN pins https://os.mbed.com/platforms/LPCXpresso54608/

  • P1_18-CAN1-RD
  • P1_17-CAN1-TD
  • P3_19-CAN0-RD
  • P3_18-CAN0-TD

But for complete usable CAN-BUS you need a CAN transceiver like is TJA1059 contained on your Dual CAN transceiver Shield. https://www.nxp.com/docs/en/user-guide/UM11035.pdf So you not need a library for your shield, because it is only transceiver from CAN RD / TD to differential pair CAN-H / CAN-L. You need a driver/library for CAN interface of you LCPXpresso54608 because your problem with "Unknown type name 'CAN'" looks like Mbed standart CAN.Api does not support CAN interface on your board.

Best regards

J.

Thank you for your help Jan, I think that the library in github ( https://github.com/ARMmbed/mbed-os/blob/master/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_MCU_LPC546XX/drivers/fsl_mcan.h ) must work but I dont know how to use it really well so I am looking for help in that. Thanks again and regards.

posted by José Manuel Salvador 10 May 2019