Skip to content

BNO055 not working with iMX I2C #3763

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
grjohn14 opened this issue Nov 25, 2020 · 4 comments
Closed

BNO055 not working with iMX I2C #3763

grjohn14 opened this issue Nov 25, 2020 · 4 comments
Labels
bug mimxrt10xx iMX RT based boards such as Teensy 4.x
Milestone

Comments

@grjohn14
Copy link

grjohn14 commented Nov 25, 2020

Trying to mount an sd card or just a small test on bno055 as below both report: OSError: [Errno 5] Input/output error

code used:

import time
import board
import busio
import adafruit_bno055
 
i2c = busio.I2C(board.SCL, board.SDA)
sensor = adafruit_bno055.BNO055_I2C(i2c)
 
while True:
    print("Temperature: {} degrees C".format(sensor.temperature))
    print("Accelerometer (m/s^2): {}".format(sensor.acceleration))
    print("Magnetometer (microteslas): {}".format(sensor.magnetic))
    print("Gyroscope (rad/sec): {}".format(sensor.gyro))
    print("Euler angle: {}".format(sensor.euler))
    print("Quaternion: {}".format(sensor.quaternion))
    print("Linear acceleration (m/s^2): {}".format(sensor.linear_acceleration))
    print("Gravity (m/s^2): {}".format(sensor.gravity))
    print()
 
    time.sleep(1)

Full error for bno055:

Traceback (most recent call last):
  File "code.py", line 17, in <module>
  File "adafruit_bno055.py", line 385, in magnetic
  File "adafruit_bno055.py", line 141, in __get__
  File "adafruit_register/i2c_struct.py", line 59, in __get__
  File "adafruit_register/i2c_struct.py", line 59, in __get__
  File "adafruit_bus_device/i2c_device.py", line 143, in write_then_readinto
OSError: [Errno 5] Input/output error

Using code for SD card from this:
https://learn.adafruit.com/adafruit-microsd-spi-sdio/adafruit-circuitpython-sd

Full error for SD card:
common_hal_busio_spi_read: status 400
Traceback (most recent call last):
File "code.py", line 24, in
File "adafruit_sdcard.py", line 116, in init
File "adafruit_sdcard.py", line 177, in _init_card
File "adafruit_sdcard.py", line 160, in _init_card
File "adafruit_sdcard.py", line 274, in _cmd
OSError: [Errno 5] Input/output error

Could be related to a similar problem with ESP32 -S2:
#3396

Any input greatly appreciated.

  • George
@tannewt tannewt added bug mimxrt10xx iMX RT based boards such as Teensy 4.x labels Nov 25, 2020
@tannewt tannewt added this to the Long term milestone Nov 25, 2020
@grjohn14 grjohn14 changed the title Teensy 4 busio not working in Circuitpython 6.0.0 with lib 6.x bundle from 20201007 Teensy 4 busio not working at all in Circuitpython 6.0.0 with any lib bundle Dec 15, 2020
@jepler
Copy link

jepler commented Mar 24, 2021

We believe the SPI "status 400" problem has been fixed by #4048. However, we will use this issue to track the reported I2C problem.

@jepler
Copy link

jepler commented Mar 26, 2021

Double checked that sdcardio still works after #4487.

@ladyada
Copy link
Member

ladyada commented Mar 26, 2021

this issue seems specific to the BNO055 which is a wretched chip, may be related to clock stretching

@ladyada ladyada changed the title Teensy 4 busio not working at all in Circuitpython 6.0.0 with any lib bundle BNO055 not working with iMX I2C Mar 26, 2021
@tannewt tannewt self-assigned this Feb 15, 2023
@tannewt tannewt modified the milestones: Long term, 9.0.0 Feb 15, 2023
@tannewt tannewt removed their assignment Feb 16, 2023
@dhalbert
Copy link
Collaborator

The BNO055, and some other BNOxx sensors, have bugs in their I2C implementations. Some chip families handle these better than others. We are going to attempt to work around at least some of these in the CircuitPython libraries, and will add more warnings to the sensor guides. I'll close this now since it does not reflect a bug in our mimxrt10xx I2C implementation itself.

@adafruit adafruit deleted a comment from grjohn14 Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mimxrt10xx iMX RT based boards such as Teensy 4.x
Projects
None yet
Development

No branches or pull requests

5 participants