Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

nrf52840 i2c write with Adafruit Bus Device: unsupported ope
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

nrf52840 i2c write with Adafruit Bus Device: unsupported ope

by stonehippo on Wed Sep 02, 2020 6:29 pm

I'm trying to get an Adafruit NeoTrellis to work with an nrf52840 Express Feather using CP 5.1.0 and the latest libs from the bundle for 5.x. Trying to load the NeoTrellis driver as follows (based on the example code here https://learn.adafruit.com/adafruit-neo ... ython-code) throws an
Code: Select all | TOGGLE FULL SIZE
Unsupported operation
error:

Code: Select all | TOGGLE FULL SIZE
import time

from board import SCL, SDA
import busio
from adafruit_neotrellis.neotrellis import NeoTrellis

# create the i2c object for the trellis
i2c_bus = busio.I2C(SCL, SDA)

# create the trellis
trellis = NeoTrellis(i2c_bus)


Here's the error:

Code: Select all | TOGGLE FULL SIZE
code.py output:
Traceback (most recent call last):
  File "code.py", line 11, in <module>
  File "/lib/adafruit_neotrellis/neotrellis.py", line 77, in __init__
  File "/lib/adafruit_seesaw/keypad.py", line 84, in __init__
  File "/lib/adafruit_seesaw/seesaw.py", line 152, in __init__
  File "/lib/adafruit_seesaw/seesaw.py", line 156, in sw_reset
  File "/lib/adafruit_seesaw/seesaw.py", line 422, in write8
  File "/lib/adafruit_seesaw/seesaw.py", line 451, in write
  File "/lib/adafruit_seesaw/seesaw.py", line 451, in write
  File "/lib/adafruit_bus_device/i2c_device.py", line 102, in write
OSError: [Errno 19] Unsupported operation


I took a look into seesaw.py and i2c_device.py and neither one is doing much unusual. And the same code runs fine on the M4 running on a PyPortal. I haven't seen anything about issues with i2c writes via Adafruit Bus Device here or on Github. Has anyone run into anything like this?

stonehippo
 
Posts: 21
Joined: Sat Aug 28, 2010 9:11 am

Re: nrf52840 i2c write with Adafruit Bus Device: unsupported

by tannewt on Wed Sep 02, 2020 6:48 pm

Could you try with 5.3.1 or the latest 6.0.0? There is a chance it's been fixed internally already.

tannewt
 
Posts: 1784
Joined: Thu Oct 06, 2016 8:48 pm

Re: nrf52840 i2c write with Adafruit Bus Device: unsupported

by stonehippo on Wed Sep 02, 2020 7:55 pm

I made a mistake earlier: this board is already running 5.3.1. I'll give the 6.0.0 alpha a try.

stonehippo
 
Posts: 21
Joined: Sat Aug 28, 2010 9:11 am

Re: nrf52840 i2c write with Adafruit Bus Device: unsupported

by stonehippo on Wed Sep 02, 2020 8:00 pm

Nope, same issue with 6.0.0 alpha 3 and the 6.x versions of the libraries.

stonehippo
 
Posts: 21
Joined: Sat Aug 28, 2010 9:11 am

Re: nrf52840 i2c write with Adafruit Bus Device: unsupported

by tannewt on Thu Sep 03, 2020 2:10 pm

Thanks for trying the latest! I'll ask someone with a NeoTrellis to reproduce and get back to you here. Thanks!

tannewt
 
Posts: 1784
Joined: Thu Oct 06, 2016 8:48 pm

Re: nrf52840 i2c write with Adafruit Bus Device: unsupported

by danhalbert on Thu Sep 03, 2020 2:50 pm

I tried this with a Feather nRF52840 and a NeoTrellis board, and it works for me.

I get "Unsupported operation", as you did, if I reverse the SDA and SCL lines (which seemed like a possible easy wiring error to me). Could you check your wiring for those lines?

danhalbert
 
Posts: 2118
Joined: Tue Aug 08, 2017 12:37 pm

Re: nrf52840 i2c write with Adafruit Bus Device: unsupported

by stonehippo on Thu Sep 03, 2020 6:18 pm

Thanks for the suggestion @danhalbert. I’d thought of that last night, and double checked, but it was SDA/SDA, SCL/SCL as it should be. But that got me thinking, and I pulled out another NeoTrellis that I got at the same time. That one seems to work, so I think I’ve got a dead board issue, not a CP problem. I tried both boards with a PyPortal, and the first one doesn’t seem to be showing up at the expected address. I’ll have to see what’s going on.

Thanks!

stonehippo
 
Posts: 21
Joined: Sat Aug 28, 2010 9:11 am

Please be positive and constructive with your questions and comments.