cancel
Showing results for 
Search instead for 
Did you mean: 

Interface can0 isn't appearing in STM32MP157F-DK2

AbhijithKannan
Associate II

I enabled CAN in the device tree using STM32CubeMX and followed the instructions in the provided documentation to generate the .dtb file. Afterward, I copied the generated .dtb file to the /boot directory. In the terminal, I ran the following commands:

 

sync
reboot

 

After rebooting, I checked the dmesg log and found the following output when filtering for CAN-related messages:

 

dmesg | grep can
[ 0.451665] can: controller area network core
[ 0.451819] can: raw protocol
[ 0.451832] can: broadcast manager protocol
[ 0.451847] can: netlink gateway - max_hops=1

 

However, when I checked the available network interfaces can0 isn't avaliable

 

root@stm32mp1-e1-99-00:~#  ls /sys/class/net
end0  lo  usb0  wlan0

 

I have attached the dts file for reference

1 ACCEPTED SOLUTION

Accepted Solutions
AbhijithKannan
Associate II

I found out that the OpenSTLinux was using stm32mp157c_extlinux.conf instead of stm32mp157f_extlinux.conf. I modified it to load the dts file. After updating the dts file with clocks configuration, can0 interface appeared

View solution in original post

3 REPLIES 3
AbhijithKannan
Associate II

I found out that the OpenSTLinux was using stm32mp157c_extlinux.conf instead of stm32mp157f_extlinux.conf. I modified it to load the dts file. After updating the dts file with clocks configuration, can0 interface appeared

ienecode
Associate III

@AbhijithKannani have the same problem with can0 interface. I edited *.dts file by adding m_can, and generate the .dtb file. Afterward, I copied the generated .dtb file to the /boot directory...

 

On my board I have both *_extlinux.xonf files:

root@stm32mp1:/boot/mmc0_extlinux# ls
extlinux.conf stm32mp135f-dk_extlinux.conf stm32mp157c-dk2_extlinux.conf stm32mp157c-ev1_extlinux.conf stm32mp157f-dk2_extlinux.conf stm32mp157f-ev1_extlinux.conf

 

And my stm32mp157c-dk2_extlinux.conf  :

# Generic Distro Configuration file generated by OpenEmbedded
menu title Select the boot mode
MENU BACKGROUND /splash_portrait.bmp
TIMEOUT 20
DEFAULT stm32mp157f-cubmxproj-mx
LABEL OpenSTLinux
KERNEL /uImage
FDTDIR /
INITRD /st-image-resize-initrd
APPEND root=PARTUUID=e91c4e10-16e6-4c0e-bd0e-77becf4a3582 rootwait rw console=${console},${baudrate}
LABEL stm32mp157c-dk2-a7-examples
KERNEL /uImage
FDT /stm32mp157c-dk2-a7-examples.dtb
INITRD /st-image-resize-initrd
APPEND root=PARTUUID=e91c4e10-16e6-4c0e-bd0e-77becf4a3582 rootwait rw console=${console},${baudrate}
LABEL stm32mp157c-dk2-m4-examples
KERNEL /uImage
FDT /stm32mp157c-dk2-m4-examples.dtb
INITRD /st-image-resize-initrd
APPEND root=PARTUUID=e91c4e10-16e6-4c0e-bd0e-77becf4a3582 rootwait rw console=${console},${baudrate}
LABEL stm32mp157f-cubmxproj-mx
KERNEL /uImage
FDT /stm32mp157f-cubmxproj-mx.dtb
APPEND root=PARTUUID=e91c4e10-16e6-4c0e-bd0e-77becf4a3582 rootwait rw console=${console},${baudrate}

 

So what I should do more ?

ienecode
Associate III

Great!  It works!

 

root@stm32mp1:~# ls /sys/class/net
can0  eth0  lo  usb0  wlan0

 

@AbhijithKannan I have a question. Are you editing oryginal *.dts file , or are you using the entire file was generated by STM32CubeMX ?