Cannot access AS7331 from a STM32F401 using STM32duino

I’m not able to run the example “Example01_Basic_OneShot” and I’m getting the error message:

00:15:40.883 → AS7331 UV A/B/C Command (One-shot) mode Example.

00:15:40.997 → Sensor failed to begin. Please check your wiring!

00:15:40.997 → Halting…

I’ve checked my connections and tried all the I2C devices. This is my pin map:

#ifdef HAL_I2C_MODULE_ENABLED

WEAK const PinMap PinMap_I2C_SDA = {

{PB_3, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF9_I2C2)},

{PB_4, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF9_I2C3)},

{PB_7, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},

{PB_9, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},

{NC, NP, 0}

};

#endif

#ifdef HAL_I2C_MODULE_ENABLED

WEAK const PinMap PinMap_I2C_SCL = {

{PA_8, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)},

{PB_6, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},

{PB_8, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)},

{PB_10, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)},

{NC, NP, 0}

};

#endif

Any suggestion is highly appreciated!

How many items are on the i2c bus? Disable all but one set of i2c pull up resistors per bus (cut the trace between pads on rear of board to disable)

Thanks for the prompt reply. I have only the AS7331 connected but I got confused about which I2C device is used on my microcontroller. I thought I had tried all three yesterday, but today I used a scope and found the SCL signal on PB_10 and the SDA signal PB_3. Then the example worked without problem so I guess I glitched when checking the wiring. :roll: