Adafruit_Blinka: Pin numbers for Rock 4C Plus not available

I am using the library on a Rock 4C Plus. I am trying to use GPIO 73 and 74 (pin 31 and 29)

Blinka version = ‘8.15.2’ Python version = 3.8.10 OS = Ubuntu 20.04 arm64

>>> board.board_id
'ROCK_PI_4C+'

Pin assignment:

outPin = board.B1
AttributeError: module 'board' has no attribute 'B1'

As I understand the mapping is available here: https://github.com/adafruit/Adafruit_Blinka/blob/main/src/adafruit_blinka/microcontroller/rockchip/rk3399/pin.py#L24-L25

My assumption is that I need to use pin board.B1 and board.B2, but they don’t show up. All available pins are shown below:

board.ADC_IN0   board.D27       board.D8        board.SDA7
board.CS        board.D28       board.I2C(      board.SPI(
board.D10       board.D29       board.MISO      board.UART2_RX
board.D11       board.D3        board.MOSI      board.UART2_TX
board.D12       board.D31       board.PWM0      board.UART4_RX
board.D13       board.D32       board.SCK       board.UART4_TX
board.D15       board.D33       board.SCL       board.UART_RX
board.D16       board.D35       board.SCL2      board.UART_TX
board.D18       board.D36       board.SCL6      board.ap_board
board.D19       board.D37       board.SCL7      board.board_id
board.D21       board.D38       board.SCLK      board.detector
board.D22       board.D40       board.SDA       board.pin
board.D23       board.D5        board.SDA2      board.sys
board.D24       board.D7        board.SDA6

board.pin
<module 'adafruit_blinka.microcontroller.rockchip.rk3399_t.pin' from '/home/rock/.local/lib/python3.8/site-packages/adafruit_blinka/microcontroller/rockchip/rk3399_t/pin.py'

@wgroeneveld Tagging you if you don’t mind. Do you happen to know what the problem is?

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 16 (16 by maintainers)

Most upvoted comments

@Gerriko Thanks for spotting this error. I made a PR for it.

@Gerriko make sure you have SPI enabled. Part of the issue is that Blinka was built to kind of emulate the basic CircuitPython modules and it typically only has a single I2C and SPI port (with the exception of boards like the pico where it’s configurable). To easily get around this limitation, we have the Extended Bus library here: https://github.com/adafruit/Adafruit_Python_Extended_Bus. It allows you to easily use any /dev/spidexX.X devices by directly initializing them and faking anything the base system thinks it needs. It also works for I2C in the same manner.

I can confirm my 4C+ is version 1.2.

Will see what I can do about the mapping and board version detection.

Edit: @makermelissa Do you have any tips on how to change the pin.py to test the different GPIOS?

What I don’t get is for example pin 73 and 74 are defined but they don’t show up in the board info:

GPIO2_B1 = Pin(73)
GPIO2_B2 = Pin(74)