Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CP210x driver / kernel module needed for DSM 6.2.4-25556 Update 6, kernel 3.10.105 (avoton architecture) #52

Closed
twobeseen opened this issue Dec 15, 2022 · 7 comments

Comments

@twobeseen
Copy link

twobeseen commented Dec 15, 2022

I know that most people search for driver for DSM 7 but I still have DSM 6.2.4 installed.

I tried the "SynoKernel USB Serial driver" from https://synocommunity.com/package/synokernel-usbserial for my DSM 6.2.4-25556 Update 6, kernel 3.10.105 (avoton architecture) but with no luck:

I installed the package SynoKernel USB Serial drivers and
wanted to load kernel module "cp210x.ko" in my DS1515+ (avoton) with DSM 6.2.4-25556 Update 6, kernel 3.10.105
but get the dmesg message:

cp210x: version magic '3.10.102 SMP mod_unload ' should be '3.10.105 SMP mod_unload '

Anybody could perhaps help and compile the package/kernel module with the right kernel version please? Probably i also could do it myself with some help....

Thanks :-)

BR,

Ben

@robertklep
Copy link
Owner

As far as I can remember, DSM6 came with most of the serial drivers already installed in /lib/modules

@twobeseen
Copy link
Author

twobeseen commented Dec 16, 2022

usbserial.ko is present, but no cp210x.ko ...
afaik I would need both to get /dev/ttyACM0 working with my Sonoff Zigbee USB Stick.

@robertklep
Copy link
Owner

Yes, you do need cp210x.ko for it.

Perhaps you can find the original Jadahl drivers here: https://web.archive.org/web/20220630112631/http://www.jadahl.com/drivers_6.2/

@twobeseen
Copy link
Author

Yeah, would be nice to try that, sadly the archive didn't archive the DS1515+ (= avoton) one cry ;-)
(The Wayback Machine has not archived that URL.)

@robertklep
Copy link
Owner

Ah too bad 😭 I can only help with DSM7 drivers, perhaps someone that's still running DSM6 and has downloaded the drivers previously might be able to help you (I assume you want to run some sort of home automation platform, so perhaps on a forum specific to that).

@twobeseen
Copy link
Author

twobeseen commented Jan 7, 2023

I could successfully compile the cp210x.ko kernel module myself today. I am quite happy :-)

To check my synology right kernel version and and architecture on my synology with DSM 6.2.4-25556 Update 6 you can use
uname -a and i got:

Linux nameOfMyStation 3.10.105 #25556 SMP Sat Aug 28 02:15:59 CST 2021 x86_64 GNU/Linux synology_avoton_1515+

To compile the module I used the following info websites:
https://www.bydavy.com/2012/01/compiling-linux-kernel-modules-for-synology-devices/
https://hallard.me/how-to-install-kernel-modules-on-synology-ds1010-dsm-4-1/

I downloaded the correct Synology toolchain "avoton-gcc493_glibc220_linaro_x86_64-GPL.txz" (more or less the right gcc compiler) from here:
https://sourceforge.net/projects/dsgpl/files/Tool%20Chain/DSM%206.2.4%20Tool%20Chains/Intel%20x86%20Linux%203.10.105%20%28Avoton%29/
(direct download link for the file: https://sourceforge.net/projects/dsgpl/files/Tool%20Chain/DSM%206.2.4%20Tool%20Chains/Intel%20x86%20Linux%203.10.105%20%28Avoton%29/avoton-gcc493_glibc220_linaro_x86_64-GPL.txz/download)
(i found the link to sourceforge in this PDF: https://global.download.synology.com/download/Document/Software/DeveloperGuide/Firmware/DSM/6.0/enu/DSM_Developer_Guide_6_0.pdf)

Additionally I downloaded the Synology NAS GPL Sources "linux-3.10.x.txz" that are needed to compile CP210x driver from here:
https://archive.synology.com/download/ToolChain/Synology%20NAS%20GPL%20Source/6.2-25556
(direct download link for the file: https://global.download.synology.com/download/ToolChain/Synology%20NAS%20GPL%20Source/6.2-25556/avoton/linux-3.10.x.txz)

(To see the needed GPL Sources you can lookup the #included header files in the cp210x driver c-file. One example of this is in this repository https://github.com/robertklep/dsm7-usb-serial-drivers/blob/main/sources/3.10.x/cp210x.c , all these #includes are in the "linux-3.10.x.txz" file. The cp210x driver c-file itself you don't need to download separately because it is also part of "linux-3.10.x.txz" because it is maintained in the kernel hence its important role.)

Like in the info documents described i did the following things on my virtual Ubuntu:
Already I had necessary devel packages, compiler etc. already installed in Ubuntu but needed ncurses package:
sudo apt-get install ncurses-dev
sudo tar -xf /path-to/avoton-gcc493_glibc220_linaro_x86_64-GPL.txz -C /usr/local
sudo tar -xf /path-to/linux-3.10.x.txz -C /usr/local/x86_64-pc-linux-gnu/
sudo cd /usr/local/x86_64-pc-linux-gnu/linux-3.10.x
sudo cp ./synoconfigs/avoton .config
For the following you have to know that avoton architecture is x86:
sudo make ARCH=x86 CROSS_COMPILE=/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu- oldconfig
sudo make ARCH=x86 CROSS_COMPILE=/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu- menuconfig

In the menuconfig i could enable to build the cp210x driver under: Device Drivers -> USB Support -> USB Serial Converter Support -> USB CP210x family of UART Bridge Controllers ... and Enabled this, so an "M" is shown left of the entry (will be conpiled as module)

After enabling to compile the cp210x i then compiled all modules (too lazy to just let compile this one cp210x- module):
sudo make ARCH=x86 CROSS_COMPILE=/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu- modules

The successful built module cp210x.ko could be found then under:
ls -Al /usr/local/x86_64-pc-linux-gnu/linux-3.10.x/driver/usb/serial/cp210x.ko

After copying the cp210x.ko to my synology to /lib/modules i could load the module successfully AFTER loading usbserial.ko which in my case was already there:
insmod /lib/modules/usbserial.ko
insmod /lib/modules/cp210x.ko

I then plugged in my Zigbee Dongle which has cp210x USB Serial Chip and checked correct cp210x-driver working with:
dmesg | grep tty
Hurray: "usb 2-2: cp210x converter now attached to ttyUSB0"

@robertklep
Copy link
Owner

Thanks for the elaborate explanation!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants