How to use SDA1 and SCL1 properly?

Hello,

I'm trying to use the I2C bus using the SDA1 (GPIO 2 / P0.14) and SCL1 (GPIO 3 / P0.15) pins, but I haven't yet figured out how to "activate" these pins for I2C usage. It looks like everything defaults to the AIN0_A5/SCL (GPIO18 / P0.02) and AIN7_A4/SDA (GPIO 20 / P0.31) pins.

The SDA1 and SCL1 pins are found in the EAGLE files for the Arduino Nano 33 BLE:
https://content.arduino.cc/assets/hw_NANO33BLE.zip

As an example, I made a custom PCB with the Nina B306 and an LSM6DS3. The LSM6DS3's SDA and SCL pins are connected to the SDA1 and SCL1 pins. I've successfully bootloaded the Nina B306 with the Arduino bootloader, and can upload sketches to it no problem. However, when I run any of Arduino's example sketches for the LSM6DS3, the IMU cannot be detected. I suspect it's looking for the device on the "default" I2C lines using A4 and A5.

Any guidance on how to switch these over to SDA1 and SCL1? My searching has come up dry, and I'm beginning to suspect I'm just not using the correct search terms.

Best regards,
lilibug

I suggest you check your defines. In the LSM9DS1.cpp file in the library at the bottom the instance is defined. If ARDUINO_ARDUINO_NANO33BLE is defined it will create the instance using Wire1 (SDA1/SCL1), otherwise it will use the default Wire interface which will be SDA0/SCL0.

#ifdef ARDUINO_ARDUINO_NANO33BLE
LSM9DS1Class IMU(Wire1);
#else
LSM9DS1Class IMU(Wire);
#endif

Sorry, I just realized you are using the 6 axis device rather than the 9. Looking at the library code it looks like it's hard wired to use SDA0/SCL0. I think you should be able to modify the library so that when the instance is created you create it with Wire1 rather than Wire as is the case with the 9 axis device.