-
Notifications
You must be signed in to change notification settings - Fork 0
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
Get the Wombat to work on a fresh OS without breaking things. #5
Comments
I only show a couple of examples but this happens with most packages Click to View
|
I am currently rebuilding the kernel for a fresh copy of raspberry Pi OS. Some notes for concern:
(I'll keep updating this comment as I discover/rediscover problems) |
Problem: pi@raspberrypi:~/raspi/tsc2007 $ make
make -C /lib/modules/5.15.21-v7+/build M=/home/pi/raspi/tsc2007 modules
make[1]: *** /lib/modules/5.15.21-v7+/build: No such file or directory. Stop.
make: *** [Makefile:5: all] Error 2
Solution: sudo apt-get install raspberrypi-kernel-headers -y
rpi-source Progress Update: I'm currently working on locating a proper source for the headers I need to build the module. I've also started using cross compilation instead of building the kernel on the Pi every time I re-build the kernel. |
Problem: pi@raspberrypi:~/raspi/tsc2007 $ make
make -C /lib/modules/5.15.21-v7+/build M=/home/pi/raspi/tsc2007 modules
make[1]: Entering directory '/home/pi/linux-84db2c69d8dfaa3dfcc48efaff43b562fc58fa11'
ERROR: Kernel configuration is invalid.
include/generated/autoconf.h or include/config/auto.conf are missing.
Run 'make oldconfig && make prepare' on kernel src to fix it.
Makefile:645: include/config/auto.conf: No such file or directory
make[1]: *** [Makefile:720: include/config/auto.conf] Error 1
make[1]: Leaving directory '/home/pi/linux-84db2c69d8dfaa3dfcc48efaff43b562fc58fa11'
make: *** [Makefile:5: all] Error 2
Solution: sudo apt-get install --reinstall raspberrypi-kernel-headers -y
rpi-source
#if rpi-source starts asking weird y/n questions
rpi-update
rpi-source |
Problem: pi@raspberrypi:~/raspi/tsc2007 $ make
make -C /lib/modules/5.15.21-v7+/build M=/home/pi/raspi/tsc2007 modules
make[1]: Entering directory '/home/pi/linux-60652604154e70aeac81fb6155fd9d15dc39daaf'
CC [M] /home/pi/raspi/tsc2007/tsc2007.o
/home/pi/raspi/tsc2007/tsc2007.c:28:10: fatal error: linux/i2c/tsc2007.h: No such file or directory
28 | #include <linux/i2c/tsc2007.h>
| ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [scripts/Makefile.build:277: /home/pi/raspi/tsc2007/tsc2007.o] Error 1
make[1]: *** [Makefile:1868: /home/pi/raspi/tsc2007] Error 2
make[1]: Leaving directory '/home/pi/linux-60652604154e70aeac81fb6155fd9d15dc39daaf'
make: *** [Makefile:5: all] Error 2 (This is what I mentioned in the earlier comment) File Found: pi@raspberrypi:/lib/modules/5.15.21-v7+/source/drivers/input/touchscreen $ ls | grep tsc
bcm_iproc_tsc.c
imx6ul_tsc.c
ti_am335x_tsc.c
tsc2004.c
tsc2005.c
tsc2007_core.c
tsc2007.h
tsc2007_iio.c
tsc200x-core.c
tsc200x-core.h
tsc40.c
Manually setting the include to that directory results in this: View Outputpi@raspberrypi:~/raspi/tsc2007 $ make
make -C /lib/modules/5.15.21-v7+/build M=/home/pi/raspi/tsc2007 modules
make[1]: Entering directory '/home/pi/linux-60652604154e70aeac81fb6155fd9d15dc39daaf'
CC [M] /home/pi/raspi/tsc2007/tsc2007.o
/home/pi/raspi/tsc2007/tsc2007.c:60:8: error: redefinition of ‘struct ts_event’
60 | struct ts_event {
| ^~~~~~~~
In file included from /home/pi/raspi/tsc2007/tsc2007.c:28:
/lib/modules/5.15.21-v7+/source/drivers/input/touchscreen/tsc2007.h:54:8: note: originally defined here
54 | struct ts_event {
| ^~~~~~~~
/home/pi/raspi/tsc2007/tsc2007.c:66:8: error: redefinition of ‘struct tsc2007’
66 | struct tsc2007 {
| ^~~~~~~
In file included from /home/pi/raspi/tsc2007/tsc2007.c:28:
/lib/modules/5.15.21-v7+/source/drivers/input/touchscreen/tsc2007.h:60:8: note: originally defined here
60 | struct tsc2007 {
| ^~~~~~~
/home/pi/raspi/tsc2007/tsc2007.c:87:19: error: conflicting types for ‘tsc2007_xfer’
87 | static inline int tsc2007_xfer(struct tsc2007 *tsc, u8 cmd)
| ^~~~~~~~~~~~
In file included from /home/pi/raspi/tsc2007/tsc2007.c:28:
/lib/modules/5.15.21-v7+/source/drivers/input/touchscreen/tsc2007.h:86:5: note: previous declaration of ‘tsc2007_xfer’ was here
86 | int tsc2007_xfer(struct tsc2007 *tsc, u8 cmd);
| ^~~~~~~~~~~~
/home/pi/raspi/tsc2007/tsc2007.c:145:13: error: conflicting types for ‘tsc2007_is_pen_down’
145 | static bool tsc2007_is_pen_down(struct tsc2007 *ts)
| ^~~~~~~~~~~~~~~~~~~
In file included from /home/pi/raspi/tsc2007/tsc2007.c:28:
/lib/modules/5.15.21-v7+/source/drivers/input/touchscreen/tsc2007.h:88:6: note: previous declaration of ‘tsc2007_is_pen_down’ was here
88 | bool tsc2007_is_pen_down(struct tsc2007 *ts);
| ^~~~~~~~~~~~~~~~~~~
/home/pi/raspi/tsc2007/tsc2007.c: In function ‘tsc2007_probe’:
/home/pi/raspi/tsc2007/tsc2007.c:305:31: error: invalid use of undefined type ‘struct tsc2007_platform_data’
305 | ts->model = pdata->model;
| ^~
/home/pi/raspi/tsc2007/tsc2007.c:306:31: error: invalid use of undefined type ‘struct tsc2007_platform_data’
306 | ts->x_plate_ohms = pdata->x_plate_ohms;
| ^~
/home/pi/raspi/tsc2007/tsc2007.c:307:31: error: invalid use of undefined type ‘struct tsc2007_platform_data’
307 | ts->max_rt = pdata->max_rt ? : MAX_12BIT;
| ^~
/home/pi/raspi/tsc2007/tsc2007.c:308:31: error: invalid use of undefined type ‘struct tsc2007_platform_data’
308 | ts->poll_delay = pdata->poll_delay ? : 1;
| ^~
/home/pi/raspi/tsc2007/tsc2007.c:309:31: error: invalid use of undefined type ‘struct tsc2007_platform_data’
309 | ts->poll_period = pdata->poll_period ? : 1;
| ^~
/home/pi/raspi/tsc2007/tsc2007.c:310:31: error: invalid use of undefined type ‘struct tsc2007_platform_data’
310 | ts->get_pendown_state = pdata->get_pendown_state;
| ^~
/home/pi/raspi/tsc2007/tsc2007.c:311:31: error: invalid use of undefined type ‘struct tsc2007_platform_data’
311 | ts->clear_penirq = pdata->clear_penirq;
| ^~
/home/pi/raspi/tsc2007/tsc2007.c:313:11: error: invalid use of undefined type ‘struct tsc2007_platform_data’
313 | if (pdata->x_plate_ohms == 0) {
| ^~
/home/pi/raspi/tsc2007/tsc2007.c:334:60: error: invalid use of undefined type ‘struct tsc2007_platform_data’
334 | put_set_abs_params(input_dev, ABS_X, 0, MAX_12BIT, pdata->fuzzx, 0);
| ^~
/home/pi/raspi/tsc2007/tsc2007.c:335:60: error: invalid use of undefined type ‘struct tsc2007_platform_data’
335 | put_set_abs_params(input_dev, ABS_Y, 0, MAX_12BIT, pdata->fuzzy, 0);
| ^~
/home/pi/raspi/tsc2007/tsc2007.c:337:9: error: invalid use of undefined type ‘struct tsc2007_platform_data’
337 | pdata->fuzzz, 0);
| ^~
/home/pi/raspi/tsc2007/tsc2007.c:339:11: error: invalid use of undefined type ‘struct tsc2007_platform_data’
339 | if (pdata->init_platform_hw)
| ^~
/home/pi/raspi/tsc2007/tsc2007.c:340:8: error: invalid use of undefined type ‘struct tsc2007_platform_data’
340 | pdata->init_platform_hw();
| ^~
/home/pi/raspi/tsc2007/tsc2007.c:361:11: error: invalid use of undefined type ‘struct tsc2007_platform_data’
361 | if (pdata->exit_platform_hw)
| ^~
/home/pi/raspi/tsc2007/tsc2007.c:362:8: error: invalid use of undefined type ‘struct tsc2007_platform_data’
362 | pdata->exit_platform_hw();
| ^~
/home/pi/raspi/tsc2007/tsc2007.c: In function ‘tsc2007_remove’:
/home/pi/raspi/tsc2007/tsc2007.c:376:11: error: invalid use of undefined type ‘struct tsc2007_platform_data’
376 | if (pdata->exit_platform_hw)
| ^~
/home/pi/raspi/tsc2007/tsc2007.c:377:8: error: invalid use of undefined type ‘struct tsc2007_platform_data’
377 | pdata->exit_platform_hw();
| ^~
make[2]: *** [scripts/Makefile.build:277: /home/pi/raspi/tsc2007/tsc2007.o] Error 1
make[1]: *** [Makefile:1868: /home/pi/raspi/tsc2007] Error 2
make[1]: Leaving directory '/home/pi/linux-60652604154e70aeac81fb6155fd9d15dc39daaf'
make: *** [Makefile:5: all] Error 2
So I have to figure out what is supposed to be putting the header into <linux/i2c/tsc2007.h> Compiler Search LocationsThis is where g++ is set to search: pi@raspberrypi:/usr/include/linux $ g++ -print-search-dirs
install: /usr/lib/gcc/arm-linux-gnueabihf/10/
programs: =/usr/lib/gcc/arm-linux-gnueabihf/10/:/usr/lib/gcc/arm-linux-gnueabihf/10/:/usr/lib/gcc/arm-linux-gnueabihf/:/usr/lib/gcc/arm-linux-gnueabihf/10/:/usr/lib/gcc/arm-linux-gnueabihf/:/usr/lib/gcc/arm-linux-gnueabihf/10/../../../../arm-linux-gnueabihf/bin/arm-linux-gnueabihf/10/:/usr/lib/gcc/arm-linux-gnueabihf/10/../../../../arm-linux-gnueabihf/bin/arm-linux-gnueabihf/:/usr/lib/gcc/arm-linux-gnueabihf/10/../../../../arm-linux-gnueabihf/bin/
libraries: =/usr/lib/gcc/arm-linux-gnueabihf/10/:/usr/lib/gcc/arm-linux-gnueabihf/10/../../../../arm-linux-gnueabihf/lib/arm-linux-gnueabihf/10/:/usr/lib/gcc/arm-linux-gnueabihf/10/../../../../arm-linux-gnueabihf/lib/arm-linux-gnueabihf/:/usr/lib/gcc/arm-linux-gnueabihf/10/../../../../arm-linux-gnueabihf/lib/:/usr/lib/gcc/arm-linux-gnueabihf/10/../../../arm-linux-gnueabihf/10/:/usr/lib/gcc/arm-linux-gnueabihf/10/../../../arm-linux-gnueabihf/:/usr/lib/gcc/arm-linux-gnueabihf/10/../../../:/lib/arm-linux-gnueabihf/10/:/lib/arm-linux-gnueabihf/:/lib/:/usr/lib/arm-linux-gnueabihf/10/:/usr/lib/arm-linux-gnueabihf/:/usr/lib/ This is the current PATH: pi@raspberrypi:/usr/include/linux $ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games |
Here is a gist where I am keeping the instructions for how to build everything from scratch. Once I figure out the touchscreen issue I'll add those to it. This isn't meant as a shell script, this is just me copying down the chicken scratch I have been keeping on my notepad with some details filled in for beginners. https://gist.github.com/Zacharyprime/c9d7918eccbbffd7f710ea69f464dd4d |
Bad News: Edit: Qt5 now works for v27 |
Update:
I have to clock out soon, so next time I have time to work on this I will see how difficult it will be to port over to modern opencv4. That might be pretty tricky though as I think the opencv portions of the code might be fairly complex. The good news is this is a roadblock that I at least have a direction to go to solve it. ayush055 started this issue a while back, if I figure out anything I'll probably put it there kipr/botui#94 Edit: |
With the recent ability to build botui with Qt5, I have gotten botui and most of it's dependencies to run on bullseye. Some remaining problems:
|
I've gotten harrogate build and the tsc2007 touch screen sort of works. Here's how I did it: Harrogate: (1) Modified package.json as follows:
(2) installed utf-8-validate and bufferutil as global packages
The server went up w/o error once I corrected the permissions issues and adding workspace.html to
was able to use the IDE and the "hello" program =================================
=======================
|
Sorry for the terseness of my comments, if you need a detailed explanation, please let me know |
This is amazing! Thank you for the work you put into this. |
@EugeneDMyers did you run into space issues when trying to clone into https://github.com/raspberrypi/linux? |
When I built my development system, I used a 32GB SSD to get around space issues. Also, make sure you use the -l1 parameter for the clone (I thank - check the raspberry PI documentation for the kernel build - I'm in an airport so hard for me to verify) otherwise the space needed will be huge. |
You might be able to build on a separate flash drive. We will need to update the SD cards if we want to do ROS for the Create3's, but I've been seeing talk of ROS that can be installed on a flash drive so maybe that will save us some trouble. Your instructions are so close to the process I was using, I just missed the part about editing the .dts files and recompiling them. Erin has been working on this but she hasn't had much luck and I couldn't figure out what went wrong by looking through her files so hopefully a fresh careful start will be more successful. |
Building on a separate flash drive works. One tip, add ~1GB of additional swap space and don't use more than -j3 for the make. I've found instances where the swap space gets maxed out (use top in a separate window to monitor resources). Also, too many processes can cause thrashing and everything will slow to a crawl. |
The old calibration config in /usr/share/X11/xorg.conf.d does not work. Here is a pointer to what needs to be done - https://wiki.archlinux.org/title/Talk:Calibrating_Touchscreen I can't seem to get past three points, they have some tight parameters on positioning the pointer, so a steady hand is needed |
This really isn't for anyone to respond to, just for documentation and my sake when I have to redo things:
|
Erin and I both ran into a permissions issue that I haven't yet resolved. I've found mutliple github issues that report the issue, but no answers have been reported. I'm still working on resolving the issue, but I'm quickly running out of leads. |
Try running make in debug/verbose mode. You'll get a gross amount of output - should be able to localize the fault. |
I had tried that, but it didn't give much more interesting of an output. The only extra information I got is it working through the logic to generate fixdep from fixdep.c It seems like make is creating the file under one user and then the directory is owned by a different user. I could also see the permissions coming from the fact I am building on the flash drive, maybe it's mounted under the wrong user. I'm gonna try to clear some space up so I can fit the repo in /home/pi and hope for better results. I ended up working on RMAs yesterday afternoon so I'll have more time to work on it today. |
Okay - I was in an airport and saw the comment and quickly typed the response. When I get home from work tonight - I'll look at my transcript and see if I did anything special. |
no rush, I got around the permissions issues by cross compiling instead. I think the piece that I was missing was the editing the .dtbs/o I was able to recreate your state of the touchscreen, I see what you mean when you say it works sometimes. I can't make out a pattern, it seems like the bottom left portion of the screen is the least responsive. I'll try playing with ti,poll_period = <5>; and look around for other poll setting commands. Update: I didn't find a polling time but I assume the electrical response time is equivalent (12 ms) Changing the 5 to 12 gave me better results, but still far from adequate. Maybe it's in Hz and not ms...I'll try 60Hz -> Same results. It seems like the cursor is moving to position faster, but it's still only sometimes or in certain portions. -> Same results if I remove the line entirely, but that could be that it is choosing a default. |
A couple of questions: This is the documentation for the driver for the controller: https://www.ti.com/lit/an/sbaa170/sbaa170.pdf?ts=1659549752879 https://www.ti.com/lit/ug/slau199/slau199.pdf?ts=1659550210040 https://www.ti.com/lit/ds/symlink/tsc2007.pdf?ts=1659493983326 I set up the parameters for the dts file based on the drivers for the older versions, which may not be optimal for this touchscreen BTW - when I tried it before, I got three out of the four crosses on the calibration |
I figured out what the issue is with the touchscreen- interrupts. If you check /proc/interrupts on the new os - the interrupts for the tsc2007 are always increasing. On the current OS interrupts occur only when the touchscreen is touched. I have not figured out the reason yet, most likely it is a configuration issue. |
Apologies for how long it takes for me to get back. I work Mon/Tue and I have other lab tasks to do before I do software. The screen and touch input chip (tsc2007) have not changed to my knowledge. However, I already looked around the datasheet for information that doesn't match the overlay used above and it seems like it is setup with the correct values. Also since the screen has not changed, I think reusing the overlay should work. I lost the forum I saw this on, but supposedly the kernel was unstable regarding using interupts like this around v3.x.x. I don't remember the exact kernel version it listed but I know 25.6/26.1 were both on a 3.x.x kernel as well. It's possible that something has changed regarding how to setup interupts. However my later research found a more likely option. Here are some sources that are related. I actually think the original overlay came from the first source since it's identical: I wish he had given more info on what he modified to tell the kernel to disable the interupt before doing an i2c start, especially because as far as I know, those are entirely seperate portions of the kernel. He might also be talking about a regular program he wrote considering you can also handle interupts (and of course i2c) directly inside a python program. I checked raspi-config for any options reguarding i2c or interupts but all I found was the option to enable/disable i2c. |
Thanks for the references, the one on the pen interrupt was quite valuable. Most of the options wrt interrupts need to be handed by the driver. I'll investigate this further as determining the cause (and fix) of the excessive interrupts should result in a functioning touchscreen. |
https://github.com/raspberrypi/linux/blob/rpi-5.15.y/drivers/input/touchscreen/tsc2007_core.c Links saved for later: Update: Later in the tsc2007_core.c disable_irq is used and there is already an object defined for the irq integer. |
I've resolved the touchscreen/tsc2007 issue. In tsc2007.dts , change these lines:
make and cp to /boot/overlay and reboot test by using sudo evtest and you will see lots of events when you tap on the screen. Still to be done - interface with x, it seems that this interface has changed, so some configuring will be needed. |
With the previous fix, and with Botui running, the cruser now follows the pointer around (when the pointer is touching the surface) - "clicks" still seem to be difficult. The Xorg logs indicate a driver issue. |
I have resolved all the issues wrt the Touchscreen. It works really well on my test wombat. Here's what I did: (1) The major issue is that there is a bug in the Linux driver for the tsc2007. In "./drivers/input/touchscreen/tsc2007_core.c" line 231 - return gpiod_get_value(ts->gpiod); ==>becomes==> return !gpiod_get_value(ts->gpiod); Notice the ==>bang<== before the function call, this is how it was in the older driver. When the touchscreen is pressed, the tsc2007 drives its gpios pin to zero. To return true in this case a bang is necessary to indicate the touchscreen is being "touched." No wonder users were having difficulty getting touchscreen using tsc2007 under Linux to work... (2) Minor configuration fixes - the gpios mod I sent earlier was a red herring, but certainly got things to sort of work. Here is the new overlay: ===========snip========snip====== /dts-v1/; / {
}; ========snip======snip========== The major change is that I changed the "interrupts = <25 0x2>" to "interrupts = <25 0x8>" This is what was suggested by TI - 0x8 changes the interrupt to fire when the gpio pin goes low. The driver then polls the tsc2007 for information. 0x2 causes interrupts on an edge/transition, which means when the touchscreen has no pressure, the gpio pin will go high - causing a second interrupt, which is not necessary. The driver is polling the gpio pin and get out when that happens. I also changed the x-plate-ohms to 300 - However, I do not know if this is an optimal number, simply no information to go by. But it seem to work okay with that value. If there are any questions, please let me know. |
Additional information: You will need to install the evdev driver (unless you want to use libinput) sudo apt install xserver-xorg-input-evdev This is the /usr/share/X11/xorg.conf.d/ that I used: pi@raspberrypitest:/usr/share/X11/xorg.conf.d $ cat 40-tsc2007.conf |
Might have to change this somewhat - there was a driver change and a pararmeter added - I will test that tonight. If that works then no need to rebuild the kernel - just the overlay. |
As promised - I have figured out how to get the Wombat touchscreen functioning w/o patching the driver. To figure this out I surveyed the patches generated over the past couple years for tsc2007_core.c and found that removal of the bang was purposeful and to get the not for the gpio line a configuration parameter was needed. Of course in true linux fashion, this fact was not documented very well... Here is the updated overlay: ==========snip========snip============ /dts-v1/; #include <dt-bindings/interrupt-controller/irq.h> / {
}; |
Thank you so much for all the work you have put in Eugene! We have restructured how software is organized and so I am going to be focused on libwallaby for a while. |
Thanks @EugeneDMyers and @Zacharyprime for all the help and time you've both put in to this. @tcorbly and I have been working on the Qt6 upgrade and getting everything to work with our libraries, including this touchscreen adventure. I did everything that was talked about in the above thread and it didn't seem to quite work. I was able to FINALLY get it to work by going into /linux/.config and instead of CONFIG_TOUCHSCREEN_TSC2007=y, I changed it to CONFIG_TOUCHSCREEN_TSC2007=m. I have a suspicion that when doing the menuconfig I didn't set the tsc2007 input device module correctly and did it manually |
The Wombat is still on Jessie, but updating breaks a multitude of things such as the touchscreen drivers.
This is a long deprecated version of Debian (see here).
This was also discussed extensively on this issue: kipr/harrogate#103
I highly recommend reading through that page for more information on the issues.
Edit:
For those new to this thread.
We are trying to get the Wombat software to build completely from a scratch version of the latest piOS.
However, updating such a large version distance has caused a multitude of issues from the touchscreen drivers being incompatible with Linux 5.x.x to harrogate throwing new errors. If you are able to make any progress on these known issues, please report it here.
This gist is where I have been saving the current set of instructions for a scratch build.
https://gist.github.com/Zacharyprime/c9d7918eccbbffd7f710ea69f464dd4d
The text was updated successfully, but these errors were encountered: