HI,
I have enabled CAN interface on imx6q EVB. Able to see CAN interfaces "can0" and "can1". I have also configured gpio pins. But when I connect CANoe to the board and send messages using "cansend" there is not data recieved at CANoe. PLease help. Are there any jumper settings on the board ?
List of commands I'm executing.
echo 101 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio101/direction
echo 0 > /sys/class/gpio/gpio101/value
ip link set can0 up
ip link set can0 type can bitrate 500000
cansend can0 500#1E.10.10
Commands are successful. Configured same baud rates at both the ends. But not able to recieve/transfer data.
Request help on yhis.
Regards
Shalini
Hi,
Please follow below mentioned steps to enable the CAN interface on i.MX6Q SABRESD board.
CAN interface Patch |
---|
--- a/arch/arm/boot/dts/imx6qdl-sabresd.dtsi +++ b/arch/arm/boot/dts/imx6qdl-sabresd.dtsi @@ -137,6 +137,19 @@ gpio = <&gpio6 14 0>; enable-active-high; }; + + reg_can_xcvr: regulator@6 { + + compatible = "regulator-fixed"; + reg = <5>; + regulator-name = "CAN XCVR"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + pinctrl-names = "default"; + gpio = <&gpio4 5 GPIO_ACTIVE_HIGH>; + enable-active-low; + }; + }; gpio-keys { @@ -608,6 +621,14 @@ interrupt-parent = <&gpio3>; interrupts = <16 1>; }; + + max7310_b: gpio@32 { + compatible = "maxim,max7310"; + reg = <0x32>; + gpio-controller; + #gpio-cells = <2>; + }; + }; &iomuxc { @@ -700,6 +721,16 @@ >; }; + + pinctrl_flexcan1: flexcan1grp { + fsl,pins = < + MX6QDL_PAD_GPIO_7__FLEXCAN1_TX 0x1b0b0 + MX6QDL_PAD_GPIO_8__FLEXCAN1_RX 0x1b0b0 + MX6QDL_PAD_GPIO_19__GPIO4_IO05 0x1b0b0 + >; + }; + + pinctrl_gpio_keys: gpio_keysgrp { fsl,pins = < MX6QDL_PAD_EIM_D29__GPIO3_IO29 0x1b0b0 @@ -1064,3 +1095,11 @@ fsl,wdog_b; status = "okay"; }; + +&can1 { + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_flexcan1>; + xceiver-supply = <®_can_xcvr>; + status = "okay"; /* pin conflict with fec */ +}; |
After applying these modification, run following commands on i.MX6Q SABRESD Board terminal,
$ ip link set can0 up
$ ip link set can0 type can bitrate 500000
$ cansend can0 123#DEADBEEF
The CAN bus data captured in CAN analyzer between CANH (pin-7) and GND (pin-2) is shown as below:
Regards,
Shivani.
Hi,
I got this result like you, can you tell me how to resolve the question.
Hi Shalini
please look at
How to enable CAN bus on i.MX6Q SabreSD
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi,
I'm using LINUX KERNEL 3.14.28. M not using LTIB. I'm using buildroot. IN linux kernel 3.14.28, there is no folder mach-mx6 and also there is no "bard-mx6q_sabresd.h". PLease help.
please use sabre-ai configuration, sabre sd by default does not
support can.
Hi,
Thanks for the reply. I have configured flex can drivers in linux kernel and compiled. There is no issue at driver level. BUt not able to send/recieve data. I doubt if there are any other GPIO settings.
Hi shalini,
Were you able to solve this issue ?
If yes, please let us know how. We are also facing the same issue.