boschsensortec / BMI270_SensorAPI

This respository contains Bosch Sensortec's BMI270 inertial measurement unit's sensor API. To report issues, go to https://community.bosch-sensortec.com/t5/Bosch-Sensortec-Community/ct-p/bst_community
BSD 3-Clause "New" or "Revised" License
67 stars 52 forks source link

BMI270 Initialization Causes I2C NACK After Writing to Register 0x70 #26

Open Oliver0804 opened 1 month ago

Oliver0804 commented 1 month ago

截圖 2024-09-24 下午1 30 53 Description:

I'm working with the BMI270 sensor and trying to initialize it by writing 0x01 to register 0x70. However, after performing this write operation, all subsequent I2C communications result in a NACK (No Acknowledgment).

Here is the initialization sequence I am using:

Set the BMI270 to sleep mode. Write 0x01 to register 0x70. All subsequent I2C communication results in NACK. I've checked the I2C bus signals, and the initial write seems successful, but any attempt to communicate with the sensor after that point fails.

My setup:

MCU: NRF52840 I2C speed: 100K Has anyone encountered this issue before, or does anyone have suggestions on what might be causing this behavior?

Any insights or help would be appreciated!

Oliver0804 commented 1 month ago
*** Booting nRF Connect SDK 3758bcbfa5cd ***
I2C device i2c@40004000 ready

uart:~$ Successfully wrote data 0xB6 to register 0x7E
Successfully wrote data 0x02 to register 0x7C
Successfully wrote data 0x00 to register 0x59
Successfully wrote data 0x00 to register 0x5B
Successfully wrote data 0x00 to register 0x5C
Successfully wrote data 0xC8 to register 0x5E
Successfully wrote data 0x2E to register 0x5F
Successfully wrote data 0x00 to register 0x60
Successfully wrote data 0x2E to register 0x61
Successfully wrote data 0x80 to register 0x62
Successfully wrote data 0x2E to register 0x63
Successfully wrote data 0x3D to register 0x64
Successfully wrote data 0xB1 to register 0x65
Successfully wrote data 0xC8 to register 0x66
Successfully wrote data 0x2E to register 0x67
Successfully wrote data 0x00 to register 0x68
Successfully wrote data 0x2E to register 0x69
Successfully wrote data 0x80 to register 0x6A
Successfully wrote data 0x2E to register 0x6B
Successfully wrote data 0x91 to register 0x6C
Successfully wrote data 0x03 to register 0x6D
Successfully wrote data 0x80 to register 0x6E
Successfully wrote data 0x2E to register 0x6F
Successfully wrote data 0xBC to register 0x70
Successfully wrote data 0xB0 to register 0x71
Successfully wrote data 0x80 to register 0x72
Successfully wrote data 0x2E to register 0x73
Successfully wrote data 0xA3 to register 0x74
Successfully wrote data 0x03 to register 0x75
Successfully wrote data 0xC8 to register 0x76
Successfully wrote data 0x2E to register 0x77
Successfully wrote data 0x00 to register 0x78
Successfully wrote data 0x2E to register 0x79
Successfully wrote data 0x80 to register 0x7A
Successfully wrote data 0x2E to register 0x7B
Successfully wrote data 0x00 to register 0x7C
Successfully wrote data 0xB0 to register 0x7D
Successfully wrote data 0x00 to register 0x5B
Successfully wrote data 0x01 to register 0x5C
Successfully wrote data 0x50 to register 0x5E
Successfully wrote data 0x30 to register 0x5F
Successfully wrote data 0x21 to register 0x60
Successfully wrote data 0x2E to register 0x61
Successfully wrote data 0x59 to register 0x62
Successfully wrote data 0xF5 to register 0x63
Successfully wrote data 0x10 to register 0x64
Successfully wrote data 0x30 to register 0x65
Successfully wrote data 0x21 to register 0x66
Successfully wrote data 0x2E to register 0x67
Successfully wrote data 0x6A to register 0x68
Successfully wrote data 0xF5 to register 0x69
Successfully wrote data 0x80 to register 0x6A
Successfully wrote data 0x2E to register 0x6B
Successfully wrote data 0x3B to register 0x6C
Successfully wrote data 0x03 to register 0x6D
Successfully wrote data 0x00 to register 0x6E
Successfully wrote data 0x00 to register 0x6F
Successfully wrote data 0x00 to register 0x70
Successfully wrote data 0x00 to register 0x71
Successfully wrote data 0x08 to register 0x72
Successfully wrote data 0x19 to register 0x73
Successfully wrote data 0x01 to register 0x74
Successfully wrote data 0x00 to register 0x75
Successfully wrote data 0x22 to register 0x76
Successfully wrote data 0x00 to register 0x77
Successfully wrote data 0x75 to register 0x78
Successfully wrote data 0x00 to register 0x79
Successfully wrote data 0x00 to register 0x7A
Successfully wrote data 0x10 to register 0x7B
Successfully wrote data 0x00 to register 0x7C
Successfully wrote data 0x10 to register 0x7D
Successfully wrote data 0x00 to register 0x5B
Successfully wrote data 0x02 to register 0x5C
Successfully wrote data 0xD1 to register 0x5E
Successfully wrote data 0x00 to register 0x5F
Successfully wrote data 0xB3 to register 0x60
Successfully wrote data 0x43 to register 0x61
Successfully wrote data 0x80 to register 0x62
Successfully wrote data 0x2E to register 0x63
Successfully wrote data 0x00 to register 0x64
Successfully wrote data 0xC1 to register 0x65
Successfully wrote data 0x80 to register 0x66
Successfully wrote data 0x2E to register 0x67
Successfully wrote data 0x00 to register 0x68
Successfully wrote data 0xC1 to register 0x69
Successfully wrote data 0x80 to register 0x6A
Successfully wrote data 0x2E to register 0x6B
Successfully wrote data 0x00 to register 0x6C
Successfully wrote data 0xC1 to register 0x6D
Successfully wrote data 0x80 to register 0x6E
Successfully wrote data 0x2E to register 0x6F
Successfully wrote data 0x00 to register 0x70
Successfully wrote data 0xC1 to register 0x71
Successfully wrote data 0x80 to register 0x72
Successfully wrote data 0x2E to register 0x73
Successfully wrote data 0x00 to register 0x74
Successfully wrote data 0xC1 to register 0x75
Successfully wrote data 0x80 to register 0x76
Successfully wrote data 0x2E to register 0x77
Successfully wrote data 0x00 to register 0x78
Successfully wrote data 0xC1 to register 0x79
Successfully wrote data 0x80 to register 0x7A
Successfully wrote data 0x2E to register 0x7B
Successfully wrote data 0x00 to register 0x7C
Successfully wrote data 0xC1 to register 0x7D
Successfully wrote data 0x00 to register 0x5B
Successfully wrote data 0x03 to register 0x5C
Successfully wrote data 0x80 to register 0x5E
Successfully wrote data 0x2E to register 0x5F
Successfully wrote data 0x00 to register 0x60
Successfully wrote data 0xC1 to register 0x61
Successfully wrote data 0x80 to register 0x62
Successfully wrote data 0x2E to register 0x63
Successfully wrote data 0x00 to register 0x64
Successfully wrote data 0xC1 to register 0x65
Successfully wrote data 0x80 to register 0x66
Successfully wrote data 0x2E to register 0x67
Successfully wrote data 0x00 to register 0x68
Successfully wrote data 0xC1 to register 0x69
Successfully wrote data 0x80 to register 0x6A
Successfully wrote data 0x2E to register 0x6B
Successfully wrote data 0x00 to register 0x6C
Successfully wrote data 0xC1 to register 0x6D
Successfully wrote data 0x80 to register 0x6E
Successfully wrote data 0x2E to register 0x6F
Successfully wrote data 0x00 to register 0x70
Successfully wrote data 0xC1 to register 0x71
Successfully wrote data 0x80 to register 0x72
Successfully wrote data 0x2E to register 0x73
Successfully wrote data 0x00 to register 0x74
Successfully wrote data 0xC1 to register 0x75
Successfully wrote data 0x80 to register 0x76
Successfully wrote data 0x2E to register 0x77
Successfully wrote data 0x00 to register 0x78
Successfully wrote data 0xC1 to register 0x79
Successfully wrote data 0x80 to register 0x7A
Successfully wrote data 0x2E to register 0x7B
Successfully wrote data 0x00 to register 0x7C
Successfully wrote data 0xC1 to register 0x7D
Successfully wrote data 0x00 to register 0x5B
Successfully wrote data 0x04 to register 0x5C
Successfully wrote data 0x80 to register 0x5E
Successfully wrote data 0x2E to register 0x5F
Successfully wrote data 0x00 to register 0x60
Successfully wrote data 0xC1 to register 0x61
Successfully wrote data 0x80 to register 0x62
Successfully wrote data 0x2E to register 0x63
Successfully wrote data 0x00 to register 0x64
Successfully wrote data 0xC1 to register 0x65
Successfully wrote data 0x80 to register 0x66
Successfully wrote data 0x2E to register 0x67
Successfully wrote data 0x00 to register 0x68
Successfully wrote data 0xC1 to register 0x69
Successfully wrote data 0x80 to register 0x6A
Successfully wrote data 0x2E to register 0x6B
Successfully wrote data 0x00 to register 0x6C
Successfully wrote data 0xC1 to register 0x6D
Successfully wrote data 0x80 to register 0x6E
Successfully wrote data 0x2E to register 0x6F
Successfully wrote data 0x00 to register 0x70
Successfully wrote data 0xC1 to register 0x71
Successfully wrote data 0x80 to register 0x72
Successfully wrote data 0x2E to register 0x73
Successfully wrote data 0x00 to register 0x74
Successfully wrote data 0xC1 to register 0x75
Successfully wrote data 0x80 to register 0x76
Successfully wrote data 0x2E to register 0x77
Successfully wrote data 0x00 to register 0x78
Successfully wrote data 0xC1 to register 0x79
Successfully wrote data 0x80 to register 0x7A
Successfully wrote data 0x2E to register 0x7B
Successfully wrote data 0x00 to register 0x7C
Successfully wrote data 0xC1 to register 0x7D
Successfully wrote data 0x00 to register 0x5B
Successfully wrote data 0x05 to register 0x5C
Successfully wrote data 0x80 to register 0x5E
Successfully wrote data 0x2E to register 0x5F
Successfully wrote data 0x00 to register 0x60
Successfully wrote data 0xC1 to register 0x61
Successfully wrote data 0x80 to register 0x62
Successfully wrote data 0x2E to register 0x63
Successfully wrote data 0x00 to register 0x64
Successfully wrote data 0xC1 to register 0x65
Successfully wrote data 0x80 to register 0x66
Successfully wrote data 0x2E to register 0x67
Successfully wrote data 0x00 to register 0x68
Successfully wrote data 0xC1 to register 0x69
Successfully wrote data 0x80 to register 0x6A
Successfully wrote data 0x2E to register 0x6B
Successfully wrote data 0x00 to register 0x6C
Successfully wrote data 0xC1 to register 0x6D
Successfully wrote data 0x80 to register 0x6E
Successfully wrote data 0x2E to register 0x6F
Successfully wrote data 0x00 to register 0x70
Successfully wrote data 0xC1 to register 0x71
Successfully wrote data 0x80 to register 0x72
Successfully wrote data 0x2E to register 0x73
Successfully wrote data 0x00 to register 0x74
Successfully wrote data 0xC1 to register 0x75
Successfully wrote data 0x80 to register 0x76
Successfully wrote data 0x2E to register 0x77
Successfully wrote data 0x00 to register 0x78
Successfully wrote data 0xC1 to register 0x79
Successfully wrote data 0x80 to register 0x7A
Successfully wrote data 0x2E to register 0x7B
Successfully wrote data 0x00 to register 0x7C
Successfully wrote data 0xC1 to register 0x7D
Successfully wrote data 0x00 to register 0x5B
Successfully wrote data 0x06 to register 0x5C
Successfully wrote data 0x80 to register 0x5E
Successfully wrote data 0x2E to register 0x5F
Successfully wrote data 0x00 to register 0x60
Successfully wrote data 0xC1 to register 0x61
Successfully wrote data 0x80 to register 0x62
Successfully wrote data 0x2E to register 0x63
Successfully wrote data 0x00 to register 0x64
Successfully wrote data 0xC1 to register 0x65
Successfully wrote data 0x80 to register 0x66
Successfully wrote data 0x2E to register 0x67
Successfully wrote data 0x00 to register 0x68
Successfully wrote data 0xC1 to register 0x69
Successfully wrote data 0x80 to register 0x6A
Successfully wrote data 0x2E to register 0x6B
Successfully wrote data 0x00 to register 0x6C
Successfully wrote data 0xC1 to register 0x6D
Successfully wrote data 0x80 to register 0x6E
Successfully wrote data 0x2E to register 0x6F
Successfully wrote data 0x00 to register 0x70
Successfully wrote data 0xC1 to register 0x71
Successfully wrote data 0x80 to register 0x72
Successfully wrote data 0x2E to register 0x73
Successfully wrote data 0x00 to register 0x74
Successfully wrote data 0xC1 to register 0x75
Successfully wrote data 0x80 to register 0x76
Successfully wrote data 0x2E to register 0x77
Successfully wrote data 0x00 to register 0x78
Successfully wrote data 0xC1 to register 0x79
Successfully wrote data 0x80 to register 0x7A
Successfully wrote data 0x2E to register 0x7B
Successfully wrote data 0x00 to register 0x7C
Successfully wrote data 0xC1 to register 0x7D
Successfully wrote data 0x00 to register 0x5B
Successfully wrote data 0x07 to register 0x5C
Successfully wrote data 0x80 to register 0x5E
Successfully wrote data 0x2E to register 0x5F
Successfully wrote data 0x00 to register 0x60
Successfully wrote data 0xC1 to register 0x61
Successfully wrote data 0x80 to register 0x62
Successfully wrote data 0x2E to register 0x63
Successfully wrote data 0x00 to register 0x64
Successfully wrote data 0xC1 to register 0x65
Successfully wrote data 0x80 to register 0x66
Successfully wrote data 0x2E to register 0x67
Successfully wrote data 0x00 to register 0x68
Successfully wrote data 0xC1 to register 0x69
Successfully wrote data 0xE0 to register 0x6A
Successfully wrote data 0x5F to register 0x6B
Successfully wrote data 0x00 to register 0x6C
Successfully wrote data 0x00 to register 0x6D
Successfully wrote data 0x00 to register 0x6E
Successfully wrote data 0x00 to register 0x6F
Successfully wrote data 0x01 to register 0x70
Failed to write data 0x00 to register 0x71 (Error -5)
BMI270 initialization failed with error code -2
BMI270 sensor initialization failed
Failed to write register address 0x03 (Error -5)
fail
Failed to write register address 0x03 (Error -5)
fail
Failed to write register address 0x03 (Error -5)
fail
Failed to write register address 0x03 (Error -5)
fail
Failed to write register address 0x03 (Error -5)