rpi-rgb-led-matrix icon indicating copy to clipboard operation
rpi-rgb-led-matrix copied to clipboard

is it possible to use with a rockpro64 from pine64 with a rk3399

Open hannescam opened this issue 2 years ago • 16 comments

i want to use this amazing library with the rockpro64 becaue all of my raspberries died

hannescam avatar Dec 23 '22 21:12 hannescam

https://github.com/hzeller/rpi-rgb-led-matrix/issues/1460

anandrajgupta avatar Dec 24 '22 02:12 anandrajgupta

so is it possible to run this code with a led panel on a rk3399? should i just try

hannescam avatar Dec 24 '22 08:12 hannescam

@anandrajgupta i tried and there was a not a raspberry pi error and a premission error

hannescam avatar Jan 30 '23 16:01 hannescam

@hannescam : At first glance, it may be possible. At minimum, you will need:

  • new HardwareMapping
  • update gpio.cc / gpio.h to use rk3399 pin access registers -
    • INP_GPIO/OUT_GPIO
    • s_GPIO_registers (possibly gpio_*bits_low too)
  • disable all code related to timer/pwm/input

Thinking of it, it may be relatively easy to do...

ledvinap avatar Jan 30 '23 18:01 ledvinap

GPIO implementation is quite different on rk3399, there is no SET/CLEAR register and 3 IO blocks are connected to 40pin header. High-performace implementation will be more difficult and cooperation with other software using GPIO access will be problematic.

ledvinap avatar Jan 31 '23 12:01 ledvinap

and what about the allwinner a64 or d1

hannescam avatar Jan 31 '23 14:01 hannescam

Both have very similar GPIO implementations as Rockchip ...

ledvinap avatar Jan 31 '23 15:01 ledvinap

what other options are ecxept than a raspberry pi that could work with this software with little/no modification

hannescam avatar Jan 31 '23 16:01 hannescam

Seems that Broadcom has quite unique GPIO implementation, probably caused by CPU being far prom GPIO (GPU is first-class citizen). rk3399 should be possible, at least as proof-of-concept version. It should be quite easy to rewrite current code to unpack framebuffer data and write it into corresponding registers. Just check usage of other IO in used banks (only GPIO OUT mode is important)

ledvinap avatar Feb 01 '23 15:02 ledvinap

cool it would be great if this project could be opend up to other platforms (not just these stupid expensive fast braking things i broke 5 allready) but i am not smart egnuth to implement this

hannescam avatar Feb 01 '23 19:02 hannescam

There may be a way of working around the GPIO issues with a kernel module. However, the GPIO does work differently. This code base uses a kernel module to gain access to the GPIO or bypasses with /dev/mem.

Has anyone tried using /dev/mem with GPIO to see what the performance is on RockChip?

bluelasers avatar Feb 11 '23 13:02 bluelasers

@bluelasers : this project does access GPIO directly, both in /dev/gpiomem and /dev/mem case. Problem is cooperating with kernel (or other) code that uses pins in GPIO mode. But is quite possible that no such pins are vital for this use case (pins that use other GPIO mux setting are fine).

ledvinap avatar Feb 11 '23 20:02 ledvinap

i think with the kernel module it will be too slow i didnt ever develop any kernel modules so correct me if i am wrong

hannescam avatar Feb 11 '23 20:02 hannescam

Hi @hannescam, any update on this 5 months later? I am running into the same issue using a pine64 OSQuartz. Would love to use a raspberry pi compute module but still, none are available :(

andytheengineerguy avatar Jul 19 '23 07:07 andytheengineerguy

@ledvinap, did you ever try the proof of concept version for any rockchip CPU?

andytheengineerguy avatar Jul 19 '23 07:07 andytheengineerguy

@andytheengineerguy : Sorry, I didn't even try, I have no use for RK boards.

ledvinap avatar Jul 19 '23 09:07 ledvinap