Can1 enablement on IMX95 verdin 19x19 board

Hi,

I am working on the Toradex Verdin i.MX95 19x19 board. On this board I see that there are two CAN interfaces present which are connected to headers J26 and J27. One of the FlexCAN interfaces gets automatically enabled and works without any additional configuration. However, when I try to enable the second CAN interface, I am facing issues.

Initially, I was trying to find the schematic of the board and the i.MX95 Applications Processor Reference Manual, but I was not able to locate them. If possible, could someone please share the correct links for the schematic and the processor reference manual, especially the sections related to register information and pin configuration.

Then I started investigating the DTB to understand how the CAN controllers are configured. In the DTB I found the following pinctrl groups:

flexcan1grp {
fsl,pins = <0x1e0 0x3e4 0x00 0x06 0x00 0x39e 0x1e4 0x3e8 0x408 0x06 0x00 0x39e>;
phandle = <0x54>;
};

flexcan2grp {
fsl,pins = <0x74 0x278 0x00 0x02 0x00 0x39e 0x7c 0x280 0x444 0x02 0x02 0x39e>;
phandle = <0x32>;
};

Based on the phandle mapping, I found that these correspond to the following CAN controller nodes:

flexcan1 = “/soc/bus@44000000/can@443a0000”; → flexcan1grp
flexcan2 = “/soc/bus@42000000/can@425b0000”; → flexcan2grp

When I inspected the flexcan2 node, I observed that it is already enabled and configured correctly:

can@425b0000 {
compatible = “fsl,imx95-flexcan”;
reg = <0x425b0000 0x10000>;
interrupts = <0x00 0x26 0x04>;
clocks = <0x11 0x77 0x11 0x78>;
clock-names = “ipg\0per”;
assigned-clocks = <0x11 0x78>;
assigned-clock-parents = <0x11 0x0a>;
assigned-clock-rates = <0x2625a00>;
fsl,clk-source = [00];
status = “okay”;
pinctrl-names = “default”;
pinctrl-0 = <0x34>;
xceiver-supply = <0x35>;
phandle = <0xed>;

However, when I checked the flexcan1 node, I found that it is disabled by default:

can@443a0000 {
compatible = “fsl,imx95-flexcan”;
reg = <0x443a0000 0x10000>;
interrupts = <0x00 0x08 0x04>;
clocks = <0x11 0x2b 0x11 0x2c>;
clock-names = “ipg\0per”;
assigned-clocks = <0x11 0x2c>;
assigned-clock-parents = <0x11 0x0a>;
assigned-clock-rates = <0x2625a00>;
fsl,clk-source = [00];
status = “disabled”;
pinctrl-names = “default”;
pinctrl-0 = <0x54>;
xceiver-supply = <0x55>;
phandle = <0x10d>;
};

To enable flexcan1, I modified the imx95-19x19-verdin.dts located at:
bld-xwayland/tmp/work-shared/imx95-19x19-verdin/kernel-source/arch/arm64/boot/dts/freescale.

and added the following nodes at the bottom of the DTS file:

&micfil {
status = “disabled”;
};

&flexcan1 {
status = “okay”;
};

Note: The reason I disabled micfil is because both micfil and flexcan1 appear to share the same pinmux, and by default micfil is enabled.

After rebuilding and booting the system, I observed the following error in the logs:

root@imx95-19x19-verdin:~# dmesg | grep -i can
[ 0.583426] HugeTLB: 0 KiB vmemmap can be freed for a 1.00 GiB page
[ 0.596405] HugeTLB: 0 KiB vmemmap can be freed for a 32.0 MiB page
[ 0.609405] HugeTLB: 0 KiB vmemmap can be freed for a 2.00 MiB page
[ 0.622406] HugeTLB: 0 KiB vmemmap can be freed for a 64.0 KiB page
[ 6.355962] systemd[1]: xen-qemu-dom0-disk-backend.service: Cannot add dependency job, ignoring: Unit xen-qemu-dom0-disk-backend.service has a bad unit file setting.
[ 7.287776] can: controller area network core
[ 7.293227] NET: Registered PF_CAN protocol family
[ 7.301419] can: raw protocol
[ 9.019002] CAN device driver interface
[ 9.099666] flexcan 443a0000.can: Error applying setting, reverse things back
[ 9.124995] clk: failed to reparent can1 to syspll1_pfd1_di: -1
[ 9.157939] Modules linked in: snd_soc_fsl_sai(+) flexcan(+) ap1302 snd_soc_wm8904(+) snd_soc_fsl_utils imx_pcm_dma rpmsg_ctrl can_dev rpmsg_char pwm_fan can_raw can fuse
[ 9.173172] pc : flexcan_read_le+0x0/0x18 [flexcan]
[ 9.173189] lr : flexcan_probe+0x398/0x798 [flexcan]
[ 9.225885] flexcan_read_le+0x0/0x18 [flexcan]
[ 9.225955] flexcan_driver_init+0x20/0x1000 [flexcan]

Then I attempted another modification by removing the inherited clock assignments for flexcan1:

&micfil {
status = “disabled”;
};

&flexcan1 {
status = “okay”;

/* Forcefully clear the inherited clock assignments by setting them to empty */
assigned-clocks = <>;
assigned-clock-parents = <>;
assigned-clock-rates = <>;
};

However, even after this modification I still see errors during boot:

root@imx95-19x19-verdin:~# dmesg | grep -i can
[ 0.587660] HugeTLB: 0 KiB vmemmap can be freed for a 1.00 GiB page
[ 0.600645] HugeTLB: 0 KiB vmemmap can be freed for a 32.0 MiB page
[ 0.613644] HugeTLB: 0 KiB vmemmap can be freed for a 2.00 MiB page
[ 0.626638] HugeTLB: 0 KiB vmemmap can be freed for a 64.0 KiB page
[ 6.350338] systemd[1]: xen-qemu-dom0-disk-backend.service: Cannot add dependency job, ignoring: Unit xen-qemu-dom0-disk-backend.service has a bad unit file setting.
[ 7.300235] can: controller area network core
[ 7.305704] NET: Registered PF_CAN protocol family
[ 7.313915] can: raw protocol
[ 9.122141] CAN device driver interface
[ 9.167331] flexcan 443a0000.can: Error applying setting, reverse things back
[ 9.195601] Modules linked in: snd_soc_wm8904(+) ap1302 snd_soc_fsl_sai(+) snd_soc_fsl_utils flexcan(+) imx_pcm_dma can_dev rpmsg_ctrl rpmsg_char pwm_fan can_raw can fuse
[ 9.232216] pc : flexcan_read_le+0x0/0x18 [flexcan]
[ 9.232238] lr : flexcan_probe+0x398/0x798 [flexcan]
[ 9.358362] flexcan_read_le+0x0/0x18 [flexcan]
[ 9.358432] flexcan_driver_init+0x20/0x1000 [flexcan]

My use case is to enable and use both CAN interfaces (CAN1 and CAN2) on the Cortex-A55 core.

Is there any restriction on using both CAN controllers simultaneously on the A55 core on this platform? If not, could you please guide me on the correct way to enable the second CAN interface?

Also, if possible, please share the schematic and reference documentation where I can find the detailed register information and pin configuration for these CAN interfaces.

Any guidance would be greatly appreciated. Thank you.

Hi, I’m the Toradex AI Assistant.

I might make mistakes or occasionally get you wrong. Our support team will step in if needed.


I can see you’re working with the Verdin iMX95 board and trying to enable both CAN interfaces. Based on the available documentation, I can provide some guidance on device tree overlays and general approaches, though the specific iMX95 implementation details aren’t fully covered in the sources.

Device Tree Overlay Approach

For enabling additional peripherals like CAN interfaces, the recommended approach is using device tree overlays rather than directly modifying the base device tree files (1). Device Tree Overlays allow you to add or modify device nodes and properties without the need to recompile the entire device tree (1).

Why Use Device Tree Overlays

DTOs provide several advantages (1):

  • Customization and Adaptability: Enable hardware customization without modifying the base device tree
  • Selective Modification: Apply specific changes on top of a base device tree
  • Simplified Development: Work with smaller, more manageable modifications

Creating a Device Tree Overlay

You can create a device tree overlay to enable flexcan1. The basic syntax would be (1):

/dts-v1/;
/plugin/;

/ {
    compatible = "toradex,verdin-imx95";
};

&micfil {
    status = "disabled";
};

&flexcan1 {
    status = "okay";
};

(1)

Compilation and Deployment

After creating your overlay, you need to (1):

  1. Compile the DTO source file using Device Tree Compiler (DTC) or TorizonCore Builder
  2. Deploy the compiled DTO to your system in the /dtb/overlays/ directory in /boot
  3. Enable the overlay in your boot configuration

Hardware Documentation

Regarding the Aquila iMX95 hardware specifications, the available datasheet shows that the iMX95 SoC features multiple CAN FD interfaces (2). The i.MX 95 family includes up to 6 Cortex-A55 cores running at up to 1.8 GHz, along with additional processors including Cortex-M7 and M33 cores (2).

Pin Multiplexing Considerations

Your observation about micfil and flexcan1 sharing pinmux is likely correct. Pin multiplexing conflicts are common in embedded systems, and you’ll need to ensure that conflicting peripherals are properly disabled when enabling others.

Troubleshooting the Clock Error

The error you’re seeing suggests a clock configuration issue:

clk: failed to reparent can1 to syspll1_pfd1_di: -1

This indicates that the clock parent assignment is failing. You might need to:

  1. Check if the target clock parent is available and enabled
  2. Verify the clock configuration in your device tree
  3. Ensure proper clock dependencies are met

Recommendations

  1. Use Device Tree Overlays: Instead of modifying the base DTS file, create a proper device tree overlay for your CAN configuration
  2. Check Pin Conflicts: Verify all pin assignments to ensure no conflicts between peripherals
  3. Clock Configuration: Review the clock tree and ensure proper parent-child relationships
  4. Test Incrementally: Enable one interface at a time to isolate issues

To get the most accurate hardware documentation and schematics for your specific board, I’d recommend checking the official Toradex product page at NXP i.MX, Texas Instruments AM62X, AM69, NVIDIA Tegra SoCs | Computer on Modules for the most up-to-date documentation.

Best regards, Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

Hi,

I can at least confirm that CAN1 is working on B0 silicon. Allthough I’ve add issues migrating from A0 silicon.

In my project I’m using CAN1 on the M7 so I don’t have all the specific device tree details. My main problem for not functioning CAN1 was due to rx pin properties. Somehow during the A0 development this was configured as a GPIO pin, which apparently was fine for A0 system manager. Now that I changed it to CAN1 rx pin (using mcuxpresso config tool) CAN1 is working as it should.

Another thing to note on the Toradex board:
Make sure the PDM/CAN1 switch is switched properly.

For completeness, this are the pins being used for CAN1 TX and CAN1 RX respectively on the Toradex board:

  • PDM_CLK
  • PDM_BIT_STREAM0

See also this generated device tree snipped:
fsl,pins = <
MX95_PAD_GPIO_IO14__LPUART3_TX 0x0000051E
MX95_PAD_GPIO_IO15__LPUART3_RX 0x0000051E
MX95_PAD_PDM_BIT_STREAM0__IMX95_AONMIX_TOP_CAN1_RX 0x0000051E
MX95_PAD_PDM_CLK__IMX95_AONMIX_TOP_CAN1_TX 0x0000051E
>;

1 Like

Thank you for sharing your experience with CAN1 on the B0 silicon! This is valuable information that helps clarify the configuration requirements for the Verdin iMX95.

Pin Configuration for CAN1

Your observation about the rx pin properties being critical is very important. Based on the Verdin iMX95 datasheet, I can confirm the pin assignments you mentioned (1):

  • PDM_CLK (SODIMM pin 252) - corresponds to CTRL_WAKE1_MICO# in the Verdin specification (1)
  • PDM_BIT_STREAM0 - this would be one of the PDM bit stream pins (1)

Looking at the pin multiplexing table in the datasheet, SODIMM pin 252 shows PDM_BIT_STREAM1 as the SoC ball name, with a pull-down reset state (1). This pin can be configured for multiple alternate functions through the device tree.

Device Tree Configuration Approach

For the original poster’s Linux/A55 core implementation, the key points from your M7 experience translate to:

  1. Proper pin multiplexing: Ensure the pins are configured for CAN function, not GPIO
  2. PDM/CAN1 switch: Verify the physical switch position on the board
  3. Pin properties: Configure both TX and RX pins with correct alternate functions

Device Tree Overlay Solution

Based on the pin information and following Toradex’s device tree overlay approach (2), you could create an overlay like:

/dts-v1/;
/plugin/;

/ {
    compatible = "toradex,verdin-imx95";
};

&main_pmx0 {
    pinctrl_flexcan1: flexcan1grp {
        fsl,pins = <
            /* Configure PDM_CLK as CAN1_TX */
            /* Configure PDM_BIT_STREAM0 as CAN1_RX */
            /* Specific register values would need to be determined from iMX95 reference manual */
        >;
    };
};

&micfil {
    status = "disabled";
};

&flexcan1 {
    status = "okay";
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_flexcan1>;
};

(2)

Hardware Switch Configuration

Your mention of the PDM/CAN1 switch is crucial - this physical switch on the Verdin Development Board needs to be in the correct position to route the signals properly.

Migration from A0 to B0 Silicon

The fact that you experienced issues migrating from A0 to B0 silicon suggests there were changes in the system manager or pin configuration requirements between these revisions. This explains why the device tree modifications alone weren’t sufficient for the original poster.

Thank you for sharing this practical insight - it provides a clear path forward for enabling CAN1 on the Verdin iMX95 B0 silicon.

Best regards, Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

1 Like

Hi @siddharthav!

Were you able to solve your issue?

Best regards.