🤖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

    Scheduled Pinned Locked Moved Units
    2 Posts 1 Posters 1.6k Views
    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 Offline
      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 Offline
        ChrisFSB @ChrisFSB
        last edited by

        @ChrisFSB Any ideas here folks? Thx!

        1 Reply Last reply Reply Quote 0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • First post
          Last post