I think Nucleo-F443RE and also F433RE do not exist so you probably mean Nucleo-F446RE.
I tried your code on my Nucleo with a GPIO expander and it is working.
Console:
Mbed OS version 6.15.1
i2c scanning...
found i2c at:20
i2c scan stop
Yes, you are right, wrong P/N. My board is Nucleo-F446RE.
I am using the mbed-studio 1.4.3 with the mbed-os 6.15.1.
I have try to pull up the wires, but the wires will be pull down in the I2C construct…
DigitalIn sda(SDA_PIN);
DigitalIn scl(SCL_PIN);
sda.mode(PullUp); // wire be pull up
scl.mode(PullUp);
I2C i2c(SDA_PIN, SCL_PIN); // wire be pull down
i2c.frequency(kHZ(400));
You are right, that internal pull-up is not enough and still pull down.
I have to add the external resistors 10K ohm on the wires to pull up, and working.