1

I was installing CP210x drivers on my Ubuntu 22.04. In its instruction, the first step was to run make cp210x on Terminal windows. But, while executing it, there was an error message said that linux/slab.h was not found. Here is the screenshot

I had tried steps which were said to be the resolution of this problem

First, I tried installing the linux-headers package for my current kernel version by running these commands on the Terminal window.

  1. uname -r" on the terminal
  2. sudo apt-get install linux-headers-$(uname -r)
  3. make cp210x" again.

Second, from another source, (in this case the file err.h that not found, but I thought it would work since those files are from the same /linux directory) it was said that I needed the package linux-libc-dev.

  1. sudo apt-get update
  2. sudo apt-get install linux-libc-dev linux-headers-generic

But all resolutions above didn't resolve anything, I was just the same before I tried to do those steps. What should I do? Is there any sollutions?

Things that might help you to find a solution or recommendation:

  • I installed Arduino 2.0.4 via AppImage on Ubuntu 2.0.4
  • I have also installed esp32 2.0.7 by Expressif Systems
  • Are you absolutely sure that there actually is a file at /usr/include/linux/slab.h? That file doesn't exist on my system either. You may want to check the kernel version that the driver is designed for and compare it with the kernel version you're running, as drivers designed only for older kernels will frequently not work properly on newer kernels. – ArrayBolt3 Mar 16 '23 at 03:53
  • This appears to be a kernel module, so you should probably just type make rather than make cp210x - that will cause it to run a command relative to the kernel source tree, like make -C /lib/modules/$(uname -r)/build M=/home/username/src/cp210x modules rather than a simple cc ... -o command. – steeldriver Mar 16 '23 at 11:51
  • ... although having said that, it looks like the first link may only support kernel versions 2.x thru 4.x – steeldriver Mar 16 '23 at 11:54

0 Answers0