🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    IMU Pro Mini Unit fails to Init on Core2

    Units
    1
    2
    317
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • C
      ChrisFSB
      last edited by

      Summary
      Using a U171 IMU Pro Mini with Core2, the U171 fails to initialize, returning error:

      OSError: [Errno 19] ENODEV
      

      Repro Steps

      Initialize the bus and U171

      i2c0 = I2C(0, scl=Pin(33), sda=Pin(32), freq=100000)
      print(i2c0.scan())
      imupro_0 = IMUProUnit(i2c0)
      

      i2c0.scan() returns BMI270 (0x68) and BMP280 (0x76); the BMM150 is behind the BMI270.

      Trace for the constructor's failure is :

      Traceback (most recent call last):
        File "main.py", line 24, in <module>
        File "main.py", line 17, in setup
        File "unit/imu_pro.py", line 36, in __init__
        File "driver/bmi270_bmm150.py", line 720, in __init__
        File "driver/bmi270_bmm150.py", line 539, in __init__
        File "driver/bmi270_bmm150.py", line 622, in _write_reg
      OSError: [Errno 19] ENODEV
      

      Looking at the underlying code :

      Constructor calls:

      super().__init__(i2c, address=bmi270_address, aux_address=address)
      

      Which does a soft reset, then attempts to write a register:

      # Perform initialization sequence.
      # 0.Soft-reset
      self.soft_reset()
      
      # 1.Disable power save mode.
      self._write_reg(PWR_CONF, 0x00)
      time.sleep_ms(10)
      

      The write fails:

      self._i2c.writeto_mem(self.address, reg, val)
      

      I patched the following and added i2c0.scan() after each i2c write:

      IMUProUnit.soft_reset
      IMUProUnit._write_reg
      IMUProUnit.new_write_burst
      

      Scanning the bus after each write, stops the ENODEV error. However init never completes.

      Any ideas how to get U171 to work?

      C 1 Reply Last reply Reply Quote 0
      • C
        ChrisFSB @ChrisFSB
        last edited by

        @ChrisFSB Any ideas here folks? Thx!

        1 Reply Last reply Reply Quote 0
        • First post
          Last post