question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ftdi_spi doesn't appear to support chips with more than 8 GPIO's

See original GitHub issue

System: Ubuntu 22.04 Linux Kernel: 5.15.0-48-generic Python version: 3.10.6

This is potentially an odd one, fringe case or even PICNIC.

I’m trying to utilise a SSD1322 OLED display through an FTDI FT232h USB adapter. The chip on the adapter has 2x GPIO banks (the usual ADBUS pins 0-7 labelled as D0-7, and the secondary ACBUS pins 0-7 labelled as pins C0-7)…

Schematic

This used to work fine under Ubuntu 16.04 using the Adafruit_GPIO Python2.7 module to wrap the SPI interface (it provided an abstraction of FT232H) with the following pin configuration…

CS = 3     #D3 Brown
RESET = 13 #C5 Purple
DC = 14    #C6 White

…however this has been completely dropped and I’ve migrated to pyftdi to try and return to what the luma.core documents state. In migrating, I now find myself with this error:

pyftdi.spi.SpiIOError: No such GPO pins: 0000/2000

This is the code I’ve written to try and initialise it;

from luma.core.interface.serial import ftdi_spi
from luma.core.render import canvas
from luma.oled.device import ssd1322

SPI = ftdi_spi(device='ftdi://ftdi:232h:RP39WI7Z/1', bus_speed_hz=8E6, gpio_CS=3, gpio_DC=14, gpio_RST=13)

To which I get the following traceback;

Traceback (most recent call last):
  File "/root/src/oled-esxi/test.py", line 67, in <module>
    SPI = ftdi_spi(device='ftdi://ftdi:232h:RP39WI7Z/1', bus_speed_hz=8E6, gpio_CS=3, gpio_DC=14, gpio_RST=13)
  File "/root/src/oled-esxi/venv/lib/python3.10/site-packages/luma/core/interface/serial.py", line 495, in ftdi_spi
    serial = spi(
  File "/root/src/oled-esxi/venv/lib/python3.10/site-packages/luma/core/interface/serial.py", line 299, in __init__
    bitbang.__init__(self, gpio, transfer_size, reset_hold_time, reset_release_time, DC=gpio_DC, RST=gpio_RST)
  File "/root/src/oled-esxi/venv/lib/python3.10/site-packages/luma/core/interface/serial.py", line 195, in __init__
    self._gpio.output(self._RST, self._gpio.HIGH)  # Keep RESET pulled high
  File "/root/src/oled-esxi/venv/lib/python3.10/site-packages/luma/core/interface/serial.py", line 427, in output
    self._gpio.write(self._data)
  File "/root/src/oled-esxi/venv/lib/python3.10/site-packages/pyftdi/spi.py", line 316, in write
    return self._controller.write_gpio(value)
  File "/root/src/oled-esxi/venv/lib/python3.10/site-packages/pyftdi/spi.py", line 682, in write_gpio
    raise SpiIOError('No such GPO pins: %04x/%04x' %
pyftdi.spi.SpiIOError: No such GPO pins: 0000/2000

Sadly I cannot simply “rewire” - this was a small run custom PCB made by an Aida64 forum member and as such, immutable.

The pyftdi module references 16-bit wide GPIOs for the 232h so I know this is possible. Richard (or perhaps another developer), please can you look into this when you find yourself with a few mins? 🥰

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
jasongauntcommented, Oct 13, 2022

So Amazon managed to lose it…

Lost package

Have chosen an alternative and it’s on its way; https://www.mouser.co.uk/ProductDetail/895-FT2232HMINIMOD

0reactions
thijstriemstracommented, Oct 16, 2022

Pull request https://github.com/rm-hull/luma.core/pull/257 has been raised

Closing.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Application Note AN_135 FTDI MPSSE Basics
The non-dedicated pins of the FTDI MPSSE port can be used as GPIO. This includes any chip select (CS) signals needed for SPI...
Read more >
Example request combining SPI and GPIO #38 - eblot/pyftdi
I'm using the SpiController and SPI communications are working great. ... Unfortunately, pyftdi does not offer MPSSE-GPIO support (but the /CS signal).
Read more >
FTDI API for Serial Communication Protocols (SPI, I2C)
8. 3.4. D2XX Driver . ... 8. 4. FT4222H Programming Interface (API) . ... Only these configured GPIO pins can support GPIO read/set...
Read more >
FTDI low-level driver — PyFtdi documentation - GitHub Pages
Most of PyFtdi features are available through the dedicated APIs. ... Tell whether the device supports 16-bit GPIO ports (vs. 8 bits). Return...
Read more >
FTDI Chip USB Solutions
FTDI Chip has a full range of USB solutions to get the ... as UART, FIFO, I2C, SPI, PWM and GPIO, where the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found