Test CAN Bus on IMX6

Config : Colibri IMX6S 256MB V1.0A, Colibri Evaluation Board Rev.3.2. WEC7.

Hello, I would like to test CAN Bus (receive and transmit).

I build a program with the example I found on the “How to use CAN library” page but I am completely lost (I have the error CAN Rx Open failed), I don’t know if I have to use the MCP2515 or FlexCAN, and the other configurations… Can you help me ?
Can I use the X2 connector for CAN Bus ?

Here is the config I tried on my code :

Imx6Can_SetConfigString(hCan, L"Implementation", L"FlexCAN", StoreToRegistry);
Imx6Can_SetConfigString(hCan, L"Interface",      L"CAN1",			StoreToRegistry);
Imx6Can_SetConfigString(hCan, L"FrameFormat",    L"standard",     StoreToRegistry);
Imx6Can_SetConfigString(hCan, L"FilterRemote",   L"none",		StoreToRegistry);     
Imx6Can_SetConfigString(hCan, L"RtrFormat",	   L"data",		StoreToRegistry);   
uIo ioRx;    ioRx.Type = ioColibriPin; 	ioRx.Number = 63;  //GPIO08
uIo ioTx;     ioTx.Type = ioColibriPin;	ioTx.Number = 55;  //GPIO09
Imx6Can_SetConfigInt(hCan, L"ioRx", ioRx.GenericDefinition, StoreToRegistry);
Imx6Can_SetConfigInt(hCan, L"ioTx", ioTx.GenericDefinition, StoreToRegistry);
Imx6Can_SetConfigInt(hCan, L"BitRateHz", 500, StoreVolatile);

Thanks in advance for your help, I really need it…

I tried also to configure with MCP2515, but when I want to initialize spi channel (“SPI1”), it does not work…

Hi Aehki,

Remove jumper JP4 and JP5. It isolates CAN transceiver CAN_TX and CAN_RX pins.
If you are using CAN1, please connect SODIMM_63 to CAN_RX (X38,2) and SODIMM_55 to CAN_TX (X38, 1).

Set BitRateHz more than 6K Hz, example setting it to 7.5K
Imx6Can_SetConfigInt(hCan, L"BitRateHz", 7500, StoreVolatile)

MCP2515 CAN is not yet supported.

Please let me know if you want any help on this.

Controller Support

  • As of today (May 2016) the libraries for i.MX6 and VFxx only support the on-chip FlexCan controller.
  • Support for the MCP2515 will be added later. You will find updates on the status in the library roadmap.

Using FlexCan on the Colibri Evaluation Board V3.2

Starting on Evalboard V3.2 we introduced additional jumpers in the CAN physical circuit, which allow to patch the FlexCAN signals to the CAN galvanic isolation, line driver and X2 connector.

Open JP4 and JP5, connect the signals to the correct SODIMM pins.
Please refer to the Schematics for details.

Software

Please start and debug the original source code of \\libdemos\Can_Demo\. There is one modification you need to do: replace "VybridCAN" with "FlexCAN".

Does it also throw the error message? If yes, is there any function returning an error code, before calling CAN_Open() ?

Hello,

Thanks for your help, I think the problem was the bitrate configuration, I forgot that it was in K Hz, I just realized it…

For your information, the bus CAN is working with JP4 and JP5 opened or closed.

It is important too to use methods from can_imx6.h and not can.h.