USB Communication Problems between ESP32 and EPC 1502
Greetings,
I am working on a project where a motor controller based on ESP32 needs to communicate with an EPC 1502 via the USB interface, using the serial port.
When I connect the ESP32 I notice that I don't get a ttyUSB device as it is supposed to appear, investigating I verified that for the communication I need the CP210x driver which is not installed in the EPC and usbserial which is installed in the EPC.
The Cp210X driver comes on the official website as a source code, a .c, which would need to be compiled, but unfortunately the EPC does not have a compilation tool itshelf.
I also tried to use an already copied version of the driver (CP210.ko) of the same architecture as the EPC (x86_64) but it didn't work because the kernel version is not the same.
Finally I thought about trying to cross-compile the .c file.
However I'm stuck on this part. I don't quite know how to do it.
Would this work or is there a better alternative?
Regards and many thanks in advance.
Comments
This page shows how to use an SDK for a PLCnext Control device to cross-compile a simple C++ executable:
https://www.plcnext-runtime.com/ch01-05-hello-again-world.html
In your case you'll need to include the relevant compiler options if you need to build a library rather than an executable, but otherwise the process should be roughly similar.
I hope this helps.
Hello again,
Following the instructions on the shared page https://www.plcnext-runtime.com/ch01-05-hello-again-world.html, I have performed the cross-compilation process for a C++ executable. However, during this process, I noticed that some essential libraries are missing, among them "tty_flip.h" or "moduleparam.h".
Is there any way to customise the SDK to incorporate these specific libraries during cross-compilation?
Thanks
Is there any way to customise the SDK to incorporate these specific libraries during cross-compilation?
It sounds like there are missing dependencies, which means you also need to cross-compile those dependencies. Unfortunately it may be a long and complicated iterative process to build all the dependencies.
Is there any other way I can use this driver?
Hello Elvis,
you would probably need the Kernel Sources of the EPC 1522 to proceed here or try a module thats been build for the same kernel version. Check your current kernel version via "uname -a".
!!! Watch out! We can not guarante correct exectution of device services as soon as you modify your Kernel !!!
How to build on your development Machine:
source the toolchain environment.
make EPC_1522_defconfig //load EPC 1522 Defconfig
make menuconfig //Activate your driver in the kernel make menu
make bzImage // If driver ist not purely modular Image needs to be replaced as well.
make modules // to build the *.ko files
Then copy the file to your device to /lib/modules/kernelversion/kernel/drivers
On EPC:
modprobe <YourDriver>.ko
Access to kernel soruces etc. can be requested through your local subsidiary.
Alternativly you could request the integration of the specific driver for the next Firmware Version.
Kind Regards,
Oliver