have toradex Apalis iMX8 Ixora V1.3 board. and how reconfigure the Extension pin and CAN FD how to transmit and receive the data. how to use to get input from gpio and analog pins.
Hi, I’m the Toradex AI Assistant.
I might make mistakes. Our support team will step in if needed. If I answered your question, please tick the “Solution” checkbox. For follow-up questions to me, please use @ToradexAI in your post.
Hello! I’d be glad to help you configure and use the Extension Header and CAN FD interfaces on your Apalis iMX8 with the Ixora V1.3 board.
1. Reconfiguring Extension Header Pins (GPIO and Analog)
The Ixora’s Extension Header (X27) gives you access to GPIO and analog input pins (Ixora datasheet).
a. Using GPIO Pins
Export and Set Direction
To read/write GPIO from Linux:
- Identify the GPIO number mapped to the SoC pin (refer to the Apalis Module Specification).
- Export and configure the GPIO in Linux:
echo <gpio_number> > /sys/class/gpio/export
echo in > /sys/class/gpio/gpio<gpio_number>/direction # for input
echo out > /sys/class/gpio/gpio<gpio_number>/direction # for output
- Read or set value:
cat /sys/class/gpio/gpio<gpio_number>/value # read
echo 1 > /sys/class/gpio/gpio<gpio_number>/value # set high
echo 0 > /sys/class/gpio/gpio<gpio_number>/value # set low
Tip: On Torizon OS, you may use the libgpiod
command-line tools (e.g., gpioget
, gpioset
).
b. Using Analog Input Pins
The Extension Header exposes Analog Input pins (AN1_ADC0…AN1_ADC3) connected to the SoC’s ADCs. To read them:
cat /sys/bus/iio/devices/iio\:device0/in_voltageX_raw
Where X is the channel number—check which ADC channel maps to the pin you are using. The value is a raw ADC count.
2. CAN FD Interface: Transmitting and Receiving Data
The CAN ports on the Ixora (X20) are connected to SoC CAN controllers, accessible through Linux using SocketCAN interface.
a. Enable CAN Interface
- Load the CAN kernel modules (usually enabled by default):
modprobe can
modprobe can_raw
modprobe m_can # For NXP iMX8 CAN FD controller
- Bring up a CAN interface (e.g.,
can0
):
ip link set can0 type can bitrate 500000 fd on
ip link set can0 up
b. Transmit/Receive Data
- Install can-utils:
apt update && apt install can-utils
- Transmit a frame on
can0
:
cansend can0 123#DEADBEEF
- Receive frames:
candump can0
c. Using CAN FD
- The
fd on
flag in theip link set ...
command enables CAN FD mode. You can send extended / FD frames using can-utils as well.
References
If you need pin-to-gpio or analog channel mapping for a specific pin, let me know the pin number and I can assist you further.
Best regards, Toradex AI Assistant.
what is the setup needed to implement CAN FD in Linux and widows’ platform and tools
Hi @Devendiran,
how reconfigure the Extension pin and CAN FD how to transmit and receive the data.
For CAN, follow this article. This will tell you how to configure CAN device tree and how to send/receive data.
Additionally, if you want to test send/receive CAN data from your PC (Linux/windows) then you will be needing some CAN bus analyzer tool along with its software.
I use CANdo
how to use to get input from gpio and analog pins.
okay sir i will try. and i ordered waveshare industrial grade usb-can-fd-b adapter: it’s okay