Everything posted by Cyryl Sochacki
-
GPIO libraries for the Banana Pi / Banana Pro (A20) fixed for current Armbian, with .deb packages
Hi all, I fixed the old LeMaker GPIO libraries so they work again on current Armbian (Debian 13 trixie, mainline kernel 6.18), and I built ready .deb packages for armhf. They were written for the old sunxi 3.4 kernel and had not been updated since 2016-2019. What's included: WiringBP (WiringPi for C, with gpio readall): kernel GPIO numbers for sysfs and interrupts, I2C bus detection, and PWM no longer switches off the LCD backlight. LMK.GPIO (RPi.GPIO for Python): works with Python 3.13, with board detection, edge events and callbacks fixed. lg (lgpio/rgpio by joan2937, the successor of pigpio, which can't run on the A20): one fix for alerts on GPIO numbers above 255. Most header pins on these boards are in bank PI (256 and up), so Python callbacks on them never ran. Packages (Debian 13 armhf): wiringbp, python3-lmk-gpio, lgpio, python3-lgpio cd /tmp wget https://github.com/cyryllo/banana-a20/raw/master/gpio/pakiety/dist/wiringbp_2.0-1_armhf.deb wget https://github.com/cyryllo/banana-a20/raw/master/gpio/pakiety/dist/python3-lmk-gpio_0.0.1-1_armhf.deb wget https://github.com/cyryllo/banana-a20/raw/master/gpio/pakiety/dist/lgpio_0.2.2-1_armhf.deb wget https://github.com/cyryllo/banana-a20/raw/master/gpio/pakiety/dist/python3-lgpio_0.2.2-1_armhf.deb sudo apt install ./wiringbp_2.0-1_armhf.deb ./python3-lmk-gpio_0.0.1-1_armhf.deb ./lgpio_0.2.2-1_armhf.deb ./python3-lgpio_0.2.2-1_armhf.deb Documentation with a pinout, examples (C, Python, libgpiod) and the list of changes: https://github.com/cyryllo/banana-a20/blob/master/gpio/README.md Boards: Banana Pro: everything was tested on my board. Banana Pi M1 (the original Banana Pi) and M1+: the packages install and lg and libgpiod work, because they use kernel GPIO numbers. WiringBP and LMK.GPIO only know the Banana Pro header. On the M1/M1+ pins 7, 8, 10 and 12 (and 29-40 on the M1+) are wired to different SoC pins, so use those two libraries only on the pins that match, or use lg/libgpiod there. The details are in the README. If someone with an M1 or M1+ can test, I'm happy to add proper support for those headers. If something doesn't work, write here or open an issue on GitHub: https://github.com/cyryllo/banana-a20/issues
-
Banana Pi Pro: LeMaker LCD panels (3.5"/5"/7" + touch) on mainline kernel, WIP
Hi @randomperson007, I made a small tool for the LeMaker LCD panels on the Banana Pi / Banana Pro with Armbian. It's called lemaker-screen, and with it you don't need to edit /boot/armbianEnv.txt by hand. It can: choose the screen: no LCD (HDMI only), 5", 7", or 7" together with an HDMI monitor, set the backlight brightness, reset the touch controller when touch stops working or reacts on its own, turn on the HDMI 1920x1080 mode needed when the LCD and HDMI work together. There is a small window (menu → Settings → LeMaker screen) and the same functions as commands, for systems without a desktop or over SSH. Description: https://github.com/cyryllo/banana-a20/tree/master/lemaker-screen To install it on the board: wget https://github.com/cyryllo/banana-a20/raw/master/lemaker-screen/dist/lemaker-screen_1.0.1_all.deb sudo apt install --install-recommends ./lemaker-screen_1.0.1_all.deb It needs an up-to-date Armbian with the lemaker-lcd overlays (sudo apt update && sudo apt full-upgrade). If something doesn't work for you, let me know.
-
Banana Pi Pro: LeMaker LCD panels (3.5"/5"/7" + touch) on mainline kernel, WIP
Hi, and thank you for the kind words! Official Armbian images I have already submitted the LCD and touchscreen support directly to the Armbian project, and all of it has been accepted and merged into their repository. Armbian builds its images automatically, so it is only a matter of time before the official Armbian images (Debian and Ubuntu based) include this support out of the box. I can’t give you an exact date, because that depends on Armbian’s build schedule, not on me. Until then, you can use the ready images from my repository: https://github.com/cyryllo/banana-a20 (Releases page). They work the same way as the official ones will. How to switch the LCD today Armbian has a standard way of turning hardware features on and off: one line in a configuration file. Open it: sudo nano /boot/armbianEnv.txtFind (or add) the overlays= line and set your panel, for example: overlays=lemaker-lcd7Then save and reboot (sudo reboot). The available values are: lemaker-lcd5: 5" panel (works together with HDMI) lemaker-lcd7: 7" panel, without HDMI lemaker-lcd7-hdmi: 7" panel, when an HDMI monitor is also connected To turn the LCD off, remove the lemaker-lcd... value and reboot. The touchscreen is included and turns on and off together with the panel, so there is nothing extra to install. If you prefer menus over editing files, sudo armbian-config can switch overlays too. A few tips: Use only one lemaker-lcd... value at a time. If you use LCD and HDMI together, keep HDMI at 1920x1080 or 1280x720, otherwise the LCD may flicker. The /boot folder is on the Linux partition, so you can’t edit it from Windows. Boot once with an HDMI monitor, or log in over SSH, to change the setting. The official kernel update available right now does not contain the LCD support yet. If you use my image, keep its kernel until a newer official one is released: sudo apt-mark hold linux-image-current-sunxi linux-dtb-current-sunxi Easy scripts are coming Thank you for the idea with the scripts, it makes a lot of sense for beginners. When I have some free time, I will add them to my repository as a .deb package. It will let you switch the LCD and touchscreen on and off with simple commands, and it will come with instructions in English. I’ll post an update here when it’s ready. Everything also works on the original Banana Pi (non-Pro). More details are in the README. Thanks again, and enjoy your Banana Pi!
-
BananaPi Pro 7" TouchLCD with Debian Buster and Mainline-Kernel 5.XX.XX
Hi all, I have published new Armbian images for the Banana Pi Pro (LeMaker Banana Pro) with working LeMaker LCD panels and touch on the current kernel: https://github.com/cyryllo/fex_configuration/releases/tag/v0.6-trixie-6.18.62 - XFCE desktop with the 7" panel enabled - minimal image (no desktop) with the LCD disabled, HDMI only - Debian 13 trixie, kernel 6.18.62 (current) What is new: I have also submitted the LCD support to Armbian itself, so that the default Banana Pi Pro images can use the panels without any extra steps: 1. #11293 sunxi: enable the EDT FT5x06 touchscreen driver - https://github.com/armbian/build/pull/11293 2. #11294 sunxi: edt-ft5x06: retry identification after I2C bus recovery - https://github.com/armbian/build/pull/11294 3. #11296 sunxi: add overlays for the LeMaker 5" and 7" LCD panels (A20) - https://github.com/armbian/build/pull/11296 The new images are built from the official Armbian build framework with exactly these three changes, so they already work the way official Armbian will once the PRs are merged. The panel is enabled with one line in /boot/armbianEnv.txt: overlays=lemaker-lcd7 Options: lemaker-lcd5 (5" RGB), lemaker-lcd7 (7" LVDS, without HDMI) and lemaker-lcd7-hdmi (7" together with an HDMI monitor). With HDMI connected also add extraargs=video=HDMI-A-1:1920x1080@60, because the LCD and HDMI share a clock and HDMI has to stay at 1080p or 720p. Tested so far: - 7" LVDS: picture and touch OK, also together with HDMI 1920x1080 - 5" RGB: picture OK, also with HDMI; touch could not be fully tested because my panel has a cracked touch glass - 3.5": not included, I do not have this panel Test reports are welcome, especially from anyone with a working 5" or a 3.5" panel. Please post what you see on the screen, whether touch works, and the output of: cat /proc/device-tree/lemaker-lcd-panel/compatible; echo dmesg | grep -iE "sun4i|lvds|panel|edt|hdmi" Until the PRs are merged, keep the kernel from being replaced by apt upgrade: sudo apt-mark hold linux-image-current-sunxi linux-dtb-current-sunxi Thanks, Cyryl
-
Banana Pi Pro: LeMaker LCD panels (3.5"/5"/7" + touch) on mainline kernel, WIP
@sgei New images are up: v0.5, with the LCD and an HDMI monitor working at the same time. Thanks for reporting the flickering. The cause was in the kernel: the LCD and HDMI share one clock source (PLL3) on the A20. When HDMI starts, it changes that clock after the LCD has already set it, so the LCD ends up with a wrong pixel clock and the picture flickers or isn't stable. The LCD clocks are now chosen so that they come from the same 297 MHz that HDMI uses, so they no longer fight over it. HDMI is set to 1920x1080 by default (1080p and 720p are the modes that match the LCD). There are two images. The XFCE image has the 7" panel enabled by default (the new 7-hdmi variant, it works with and without an HDMI monitor, about 50 Hz). The minimal image has no desktop and the LCD disabled, as a base for your own setup. You can switch panels with sudo lemaker-lcd 7-hdmi (or 7, 5, 35, off) followed by a reboot. If you don't need HDMI at all, there's also an overlay that turns it off. The release notes also explain how to change the brightness. I've tested the 7" together with an HDMI monitor and it works fine for me now. Could you please flash the new image and confirm that the flickering is gone on your setup too? If something is still wrong, please tell me which panel you use, which HDMI resolution, and post the output of dmesg | grep -iE "sun4i|lvds|panel|hdmi" and cat /boot/armbianEnv.txt. Download: https://github.com/cyryllo/fex_configuration/releases The 5" panel got the same fix (29.7 MHz instead of 30 MHz), but I haven't tested it with HDMI yet, so reports from 5" users are very welcome too.
-
Banana Pi Pro: LeMaker LCD panels (3.5"/5"/7" + touch) on mainline kernel, WIP
Thanks a lot for the kind words and for the report! I found the cause: in the mainline kernel the LCD and HDMI share the same clock (PLL3). When HDMI is connected at boot, it reprograms that clock after the LCD has been set up, so the LCD ends up with a wrong pixel clock and the picture becomes unstable. I’ll fix this in the next version of the overlays. Until then, the simplest workaround is to boot without the HDMI cable connected. Could you tell me which screen you are using (5" or 7")? That will help me test the fix.
- Banana Pi Pro: LeMaker LCD panels (3.5"/5"/7" + touch) on mainline kernel, WIP
-
Banana Pi Pro: LeMaker LCD panels (3.5"/5"/7" + touch) on mainline kernel, WIP
Update: touch works now! The LeMaker 7" panel works completely on the Banana Pi Pro with a current kernel (Armbian Debian 13 trixie, kernel 6.18): display, backlight and touch. The 5" panel works too (display confirmed, touch uses exactly the same controller and wiring as the 7"), and the same image also runs on the original Banana Pi. Getting touch to work needed two fixes. First, the pin called ctp_wakeup in the old fex files (PH7) is actually the RESET line of the FT5x06 controller. Described as a "wake" pin, the edt-ft5x06 driver only waits 5 ms after power-up, and the controller doesn't answer yet. Described as reset-gpios, the driver waits 300 ms and the controller responds. Second, at boot the driver's first probe always fails with an I2C bus error (mv64xxx Ctlr Error, status 0x0, error -11), while the same probe a moment later succeeds. For now a small systemd service retries binding the driver after boot, so touch works right away. If anyone has an idea what causes that first I2C error on the A20, I'd be happy to hear it. There's now a single image for all panels with the XFCE desktop. The 7" panel is enabled by default, and you can switch panels with sudo lemaker-lcd 5 (or 35, 7, off) followed by a reboot, or by uncommenting one line in /boot/armbianEnv.txt. Image, overlays and build scripts: https://github.com/cyryllo/fex_configuration/releases https://photos.app.goo.gl/pM8WR9rU6tHn9ESh9
-
Banana Pi Pro: LeMaker LCD panels (3.5"/5"/7" + touch) on mainline kernel, WIP
Quick update: the LeMaker panels work on current kernels! I've tested the 5" and 7" panels on real hardware, and both work on the Banana Pi Pro as well as on the original Banana Pi (non-Pro), using the same image (Armbian Debian 13 trixie, kernel 6.18). The picture appears as soon as the kernel starts, the backlight works too. The 3.5" panel is still untested since I don't have it, but it shares almost everything with the 5" one, so it will most likely work as well. The minimal image has no desktop, so I couldn't check touch yet. I'm now preparing an image with the XFCE desktop, which also includes a simple script to switch panels after boot (sudo lemaker-lcd 5 / 7 / 35 / off), so a single image will work with every panel. I'll post soon whether touch works too. Overlays, build scripts and images: https://github.com/cyryllo/fex_configuration
-
BananaPi Pro 7" TouchLCD with Debian Buster and Mainline-Kernel 5.XX.XX
Hi everyone, After a long break I'm coming back to this topic. Since the old fex/script.bin files only work with the sunxi-3.4 kernel, I've prepared a new configuration for current mainline kernels: device tree overlays for all LeMaker LCD panels for the Banana Pi Pro (LeMaker Banana Pro): - 3.5" RGB 320x240 (BL035-RGB-002) - 5" RGB 800x480 - 7" LVDS 1024x600 - FT5x06 capacitive touch for all of them (edt-ft5x06 driver) All timings, pins, power, backlight and touch settings were taken 1:1 from the original LeMaker fex files. Looking back at my posts from 2023, the missing piece was partly what I suspected: the panel has to be connected to tcon0_out in the device tree, and on A20 the display controller only switches to LVDS mode when the panel is described as "panel-lvds". The overlays handle both. The current Armbian sunxi kernel also includes the fix for the inverted LVDS polarity (the "red screen / backlight but no picture" problem some of you reported). What I have ready: - .dts overlays for each panel (install with armbian-add-overlay) - ready-to-flash images: Armbian Debian 13 (trixie) minimal, kernel 6.18.58, built with the Armbian build framework, one image per panel (3.5", 5", 7"), with the touch driver already enabled and the selected panel turned on in armbianEnv.txt Repository (overlays + build scripts): https://github.com/cyryllo/fex_configuration Important: so far I've only verified that the overlays compile and apply correctly to the Banana Pro device tree. I'll test them on real hardware tomorrow (I have the 5" and 7" panels, I don't have the 3.5"). If anyone still has one of these displays and would like to help with testing, let me know and I'll share the image for your panel. A short report of what you see on the screen (black / backlight only / picture OK) plus the output of this command would help a lot, especially for the 3.5" panel: dmesg | grep -iE "sun4i|lvds|panel|edt|pwm" I'll post the results of my own tests here. Test img: https://github.com/cyryllo/fex_configuration/releases
-
Banana Pi Pro: LeMaker LCD panels (3.5"/5"/7" + touch) on mainline kernel, WIP
Hi, I'm working on bringing back support for the original LeMaker LCD panels on the Banana Pi Pro (LeMaker Banana Pro, A20) with current Armbian kernels. The old script.bin / fex files only worked with sunxi-3.4, so I ported the settings to device tree overlays: - 3.5" RGB 320x240 (BL035-RGB-002, already in panel-simple) - 5" RGB 800x480 (panel-dpi) - 7" LVDS 1024x600 (panel-lvds) - FT5x06 touch for all three (edt-ft5x06 driver) Repository: https://github.com/cyryllo/fex_configuration The overlays compile and apply cleanly to sun7i-a20-bananapro.dtb (kernel 6.18). I'm now building a Debian 13 (trixie) minimal image with the Armbian build framework that includes the overlays and the edt-ft5x06 module, and I'll test it on my 5" and 7" panels. I don't have the 3.5" panel, so testers are welcome. Plan once it's tested: - enable CONFIG_TOUCHSCREEN_EDT_FT5X06=m in the sunxi kernel config - submit the overlays, so the panels work on standard images I've also applied to become the maintainer of this board, as it currently has none. Feedback and test reports are very welcome.