Question on the RockPro64 RK3399 GPIOs...
#1
Photo 
Are the (4) groups of GPIOs A, B, C, D in the same 32-bit register?
Example:
GPIO1
3
1 0
[----D----][----C----][----B----][----A----]
7 4 1
I can toggle GPIO1A1, 4, 7 on/off but not GPIO1Bs.

TIA,
/Faradn

...Any way to set a fixed width font in this BBS?
#2
How are you planning on controlling the GPIO Devices ? Via the legacy /sys/class/gpio driver ?

I am currently trying to write a GPIO kernel driver to the new standard. There are a lot of anomalies in the documentation but I am composing a complete spreadsheet of the PMU/GRF Registers if thats how you where planning on doing it ?

I am almost finished.

There are 5 GPIO Banks supporting a total of 122 GPIO's only a few of which can be accessed by user space;
They all have PAD designation A,B,C,D each with its own IOMUX Register

gpio0 Allocated to PMU Registers as can be used for wake-up.
gpio1 Allocated to PMU Registers as can be used for wake-up.
gpio2 GRF Registers and used for SPI/12C/PMW etc as well as exposed GPIO
gpio3 GRF Registers and used for SPI/12C/PMW etc as well as exposed GPIO
gpio4 GRF Registers and used for SPI/12C/PMW etc as well as exposed GPIO
#3
Howdy,

Not using the /sys/class file IO method.
I'm mmap-ing the RK3399's IO and using address offsets
to read/write the IO. I've got the GPIO, I2C, SPI, 
I2S, & UART all mapped out. Whatever's available at
the 40-pin GPIO header is accessible via mmap'd IO.

Basically it's the methods used in the BCM2835 Library
for low-level IO. I've just translated the methods to 
work for an RK3399 instead of a BCM2835/7 that's used in 
a Pi 2/3B. 
https://www.airspayce.com/mikem/bcm2835/

So far so good...the methods work fine, I just can't get
GPIO3D[0]..[7] and GPIO4C[3]..[5] & GPIO4D[1]..[4]
to toggle. I'll have to check the schematic to verify
they're not used by any other devices.

/Faradn
#4
(04-10-2019, 06:02 PM)Faradn Wrote: Howdy,

Not using the /sys/class file IO method.
I'm mmap-ing the RK3399's IO and using address offsets
to read/write the IO. I've got the GPIO, I2C, SPI, 
I2S, & UART all mapped out. Whatever's available at
the 40-pin GPIO header is accessible via mmap'd IO.

Basically it's the methods used in the BCM2835 Library
for low-level IO. I've just translated the methods to 
work for an RK3399 instead of a BCM2835/7 that's used in 
a Pi 2/3B. 
https://www.airspayce.com/mikem/bcm2835/

So far so good...the methods work fine, I just can't get
GPIO3D[0]..[7] and GPIO4C[3]..[5] & GPIO4D[1]..[4]
to toggle. I'll have to check the schematic to verify
they're not used by any other devices.

/Faradn
I attach the spreadsheet ... its WIP as There are still a couple of anomalies that I am still looking into.


Attached Files
.xls   GPIORegisters.xls (Size: 70.5 KB / Downloads: 531)
#5
A momentous achievement!
Thank you.
Attached is what i"ve gleaned so far from 
theRK3399 Technical Reference Manual.


Now how to translate PI2/3B (BCM2835/7) GPIO pin numbers
to RK3399 GPIO pin numbers. Along with a function select
method.
/Faradn


Attached Files
.txt   rockpro64_gpio_mapping_01_032919.txt (Size: 15.47 KB / Downloads: 441)
#6
Hello,
I have been busy with the same problem for some time - Handling the GPIO pins directly in C.
According to my experience two steps are critical for enabling a pin:
-      Set the relevant multiplexer to GPIO function
-      Enable GPIO clock of this GPIO section. On my board, only GPIO1 is enabled by default. Maybe used for some other functions. Others require enabling.
Then, you need to set pin direction, according to intended usage as input or output.
While playing with GPIO on this board, I have met a problem of avoiding race conditions at some operations. Notable, when setting pin output state. So, I had to solve this in more systematic way, and finally written a small library of functions to operate GPIO on ROCKPro64. It is still in experimental phase and documentation is very ‘sparse’, but you may look in this coding, if you would like to see how I propose to operate GPIO. It is attached below.
I will be grateful for advices how to make it better!
Best regards,
Gienek.

.tar   GPIOsrc.tar (Size: 180 KB / Downloads: 420)


Possibly Related Threads…
Thread Author Replies Views Last Post
  Powering on the Rockpro64 JPT223 1 826 09-24-2023, 12:23 PM
Last Post: hoarfrosty
  ROCKPro64 Battery Power Supply hoarfrosty 11 1,627 09-23-2023, 04:17 PM
Last Post: hoarfrosty
  ROCKPro64 with 16 ports SATA controller ZeblodS 19 25,258 12-18-2022, 06:25 PM
Last Post: heyghoge
  Using RPI hat on RockPro64? misterc 0 798 12-16-2022, 02:05 PM
Last Post: misterc
  PCIe bifurcation support (on RK3399) Arn 1 1,248 11-28-2022, 05:12 PM
Last Post: tllim
  GPIO on the RockPro64 - all pins high? colinmarc 2 1,523 11-18-2022, 10:20 AM
Last Post: colinmarc
  ROCKPro64 DOA ajtravis 8 6,350 11-08-2022, 03:40 AM
Last Post: ajtravis
  RockPro64 not booting up mvicha@gmail.com 0 1,091 09-19-2022, 07:35 AM
Last Post: mvicha@gmail.com
  GPIO Expander HAT for ROCKPro64 and Quartz64 CounterPillow 7 5,187 07-18-2022, 10:05 PM
Last Post: zer0sig
  RockPro64 premium aluminium casing justwantin 2 2,071 05-27-2022, 06:51 PM
Last Post: justwantin

Forum Jump:


Users browsing this thread: 1 Guest(s)