Hi all,
after several days of struggling I finally have Jetson Nano devkit working with XPT2046 based Waveshare 4inch HDMI LCD (resistive touchscreen, SKU 12030). More, there is no need a single small solder!
Prerequisites:
- a recent Jetson Nano development board;
- Waveshare 4inch HDMI LCD, 800x480, IPS SKU: 12030
Steps from scratch (a bit excessive, omit unneeded steps at your own):
- Plug the display onto the J41 header, starting from pin 1. Thank you Nvidia guys who made it compatible with RasPi!
- Connect Jetson and display with HDMI cable.
- Falsh a 32+Gb SD card with balenaEtcher as described in Jetson Nano quick start. (I had to unzip sd_blob_b01.img from jetson-nano-developer-kit-sd-card-image.zip first), insert the card into Nano
- Power up the board. At this point the screen will show Ubuntu setup. Follow the wizard, reboot as needed. Set up networking for future downloads.
apt update && apt upgrade
cd buildKernelAndModules
- Edit getKernelSources.sh: set L4T_TARGET=â32.4.3â (as of Aug 2020)
./getKernelSources.sh
As expected, this will download kernel sources :)
9.
apt install libncurses-dev && ./editConfig.sh
In Device drivers - Input device suppiort - Touchscreens select âADS7846/TSC2046/AD7873 and AD(S)7843 based touchscreensâ and mark it with asterisk (driver built into kernel). Exit, exit, exit, exit, yes. Way too boring :)
10.
./makeKernel.sh
- In the case of error-free build,
./copyImage.sh
â At this point we have a new kernel built abd installed in system. â
â Now letâs update device tree â
12. (This step is best of all done over ssh, in extended window)
sudo /opt/nvidia/jetson-io/jetson-io.py
Configure 40-pin expansion header
Mark âspi1â with asterisk
Back
Save and exit without rebooting
At this step copy resulting file location. It will be something like /boot/tegra210-p3448-0000-p3449-0000-b00-user-custom.dtb
- Decompile device tree:
dtc -O dts -o tegra.dts /boot/tegra210-p3448-0000-p3449-0000-b00-user-custom.dtb
- Replace
spi@1 { compatible = "spidev"; reg = <0x1>; spi-max-frequency = <0x1f78a40>; controller-data { nvidia,enable-hw-based-cs; nvidia,rx-clk-tap-delay = <0x7>; }; };
with
spi@1 { compatible = "ti,ads7846"; reg = <0x1>; // CS1 of SPI spi-max-frequency = <0x7a120>; nvidia,enable-hw-based-cs; nvidia,rx-clk-tap-delay = <0x7>; interrupt-parent = <0x56>; // phandle of "gpio@6000d000" interrupts = <0x0d 0x1>; // pin 22 is gpio13, IRQ13 pendown-gpio = <0x56 0x0d 0x0>; vcc-supply = <0x47>; // phandle of "regulator@2" //ti,swap-xy = <0x1>; // uncomment to swap axes ti,x-min = [00 00]; ti,x-max = [1f 40]; ti,y-min = [00 00]; ti,y-max = [12 c0]; ti,x-plate-ohms = [00 28]; ti,pressure-max = [00 ff]; wakeup-source; controller-data { nvidia,cs-setup-clk-count = <0x1e>; nvidia,cs-hold-clk-count = <0x1e>; nvidia,rx-clk-tap-delay = <0x1f>; nvidia,tx-clk-tap-delay = <0x0>; }; };
- Build device tree blob then copy it into /boot. This is where you will need the loooong previously copied file name:
dtc -O dtb tegra.dts -o tegra210-p3448-0000-p3449-0000-b00-user-custom.dtb
cp /boot/tegra210-p3448-0000-p3449-0000-b00-user-custom.dtb /boot/tegra210-p3448-0000-p3449-0000-b00-user-custom.dtb.orig
cp tegra210-p3448-0000-p3449-0000-b00-user-custom.dtb /boot
apt install xinput_calibrator
- Reboot.
- (from screen and keyboard, use Ctrl+Alt+T to open terminal)
xinput_calibrator
Enjoy :)