cancel
Showing results for 
Search instead for 
Did you mean: 

Using USB-UART CP210x and CH341-based converters on STM32MPUs boards

MHolu.1
Associate II

Please help me add support for USB-UART converters of the CP210x and CH341 series on the STM32MP157F-DK2 board. I expect to see ttyUSBx, but no new devices appear after connection. I am using the Distribution Package, and in the kernel configuration, I have activated the following settings:

 

# USB port drivers
#
CONFIG_USB_SERIAL=y
# CONFIG_USB_SERIAL_CONSOLE is not set
CONFIG_USB_SERIAL_GENERIC=y
CONFIG_USB_SERIAL_SIMPLE=m
# CONFIG_USB_SERIAL_AIRCABLE is not set
# CONFIG_USB_SERIAL_ARK3116 is not set
# CONFIG_USB_SERIAL_BELKIN is not set
CONFIG_USB_SERIAL_CH341=m
# CONFIG_USB_SERIAL_WHITEHEAT is not set
# CONFIG_USB_SERIAL_DIGI_ACCELEPORT is not set
CONFIG_USB_SERIAL_CP210X=m

 

But when connecting a CP210x- or CH340-based converter to any of the four USB-A ports on the board, I only get the following in dmesg:

 

 [1619.270102] usb 1-1.3: new full-speed USB device number 4 using ehci-platform

 

At the same time, I can see my adapter when running lsusb:

 

Bus 001 Device 004: ID 10c4:ea60 Silicon Labs CP210x UART Bridge
Bus 001 Device 002: ID 0424:2514 Microchip Technology, Inc. (formerly SMSC) USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

 

The functionality of the converters has been tested on my PC. I am using one of the latest versions of the MPU Ecosystem v5 based on kernel 5.15.67. I have verified my settings in the built system using /proc/config.gz

I would greatly appreciate any assistance in resolving this issue.

Best regards!

1 ACCEPTED SOLUTION

Accepted Solutions
MHolu.1
Associate II

The issue has been resolved! The errors in dmesg occurred due to the absence of the usbserial.ko module, which is the base module required for the converter to work and is enabled in the configuration as CONFIG_USB_SERIAL. However, as noted in the initial post, it was already enabled. Apparently, a conflict arose during my experiments, and I flashed an old uImage onto the board along with the new kernel modules for CP210x and CH341-based converters. After I replaced the old uImage with the corrected one (using the same config), everything started working properly.

Thus, if you configure the kernel as indicated in the main post of this thread and carefully transfer the uImage and new modules as per the instructions https://wiki.st.com/stm32mpu/wiki/Menuconfig_or_how_to_configure_kernel , CP210x and CH341-based converters will work with the STM32MP157F-DK2 board (and likely with other boards in the STM32MP1 family as well).

View solution in original post

2 REPLIES 2
MHolu.1
Associate II

I partially solved the issue after a more careful study of the article about kernel configuration. I manually added new modules from the deploy folder after running menuconfig. Now, the driver is called after connecting the converter, but in dmesg I get this:

 

 

[  498.760411] usb 1-1.3: new full-speed USB device number 3 using ehci-platform
[  499.416543] cp210x: Unknown symbol usb_serial_generic_open (err -2)
[  499.421613] cp210x: Unknown symbol usb_serial_generic_close (err -2)
[  499.427947] cp210x: Unknown symbol usb_serial_deregister_drivers (err -2)
[  499.435020] cp210x: Unknown symbol usb_serial_generic_unthrottle (err -2)
[  499.441741] cp210x: Unknown symbol usb_serial_generic_get_icount (err -2)
[  499.448171] cp210x: Unknown symbol usb_serial_generic_throttle (err -2)
[  499.454915] cp210x: Unknown symbol usb_serial_register_drivers (err -2)

 

 

If I manually load the module, for example using modprobe cp210x, I get the following error:

 

 

modprobe: ERROR: could not insert 'cp210x': Unknown symbol in module, or unknown parameter (see dmesg)

 

 

Perhaps I missed some configuration in the kernel?

MHolu.1
Associate II

The issue has been resolved! The errors in dmesg occurred due to the absence of the usbserial.ko module, which is the base module required for the converter to work and is enabled in the configuration as CONFIG_USB_SERIAL. However, as noted in the initial post, it was already enabled. Apparently, a conflict arose during my experiments, and I flashed an old uImage onto the board along with the new kernel modules for CP210x and CH341-based converters. After I replaced the old uImage with the corrected one (using the same config), everything started working properly.

Thus, if you configure the kernel as indicated in the main post of this thread and carefully transfer the uImage and new modules as per the instructions https://wiki.st.com/stm32mpu/wiki/Menuconfig_or_how_to_configure_kernel , CP210x and CH341-based converters will work with the STM32MP157F-DK2 board (and likely with other boards in the STM32MP1 family as well).