Arm Mbed OS support forum

I2C doesn't work on NUCLEO-F410RB with mbed-os 5.15.6

I am using Mbed Studio: 1.4.3 with mbed-os 5.15.6. Used FMPI2C_1 on PA_8 (SCL) and PC_9 (SDA). However it doesn’t work at all. It works on mbed OS2 (online) very well.

Hi if you take a look here mbed-os/targets.json at mbed-os-5.15 · ARMmbed/mbed-os · GitHub and look up the NUCLEO-F410RB you will see that I2C is not in the supported interfaces for this version.
E.g.

    "device_has_add": [
            "ANALOGOUT",
            "SERIAL_ASYNCH",
            "TRNG",
            "FLASH",
            "MPU"
        ],

Hello Anna,

that is not exact. ST usually uses this way of configuration for not standard equipment. So you also need to check what is inherited, in this case FAMILY_STM32.Under that, you will find standard equipment for all ST targets and I2C is part of it.

BR, Jan

Thank you Anna and Jan for replies.

Anna: I agree with Jan. We use many other controllers, one of it is NUCLEO_L053R8. That also shows no I2C, however the I2C works on it without any difficulty. See below copied from the same file.
“NUCLEO_L053R8”:
“device_has_add”: [
“ANALOGOUT”,
“CRC”,
“SERIAL_ASYNCH”,
“FLASH”,
“MPU”
],

There is a difference in between “device_has”: and “device_has_add”:. As Jan rightly mentioned “add” must be representing additional to the original.

The F410RB list also does not have “ANALOGIN”, “PORTIN”, “PORTINOUT” or “PORTOUT”. Do you mean to say the DigitalIN and DigitalOut also will not work?

Still awaiting your response. It is a serious issue.

Regards,
John

Hello John,

maybe can be cool to provide more information.
The simple sentence " it doesn’t work at all" is not ideal.

  • how did you find out?
  • did you try also another I2C interface? For example on PB_8 & PB_9 pins.

BR, Jan

Although I had only reported about the two pins which are not working, later I tried other pins as well as you mentioned. It didn’t work. So the fault is not only limited to those two pins or the FMPI2C_1. Tried other I2C also.

And how does it show itself? You still not provide a prove or how to reproduce your issue.

For example, I tried my i2c display and it works, with F446RE.
I do not have F410RB but I have F446RE. It is from same family and that use same HAL drivers = same implementation of I2C only settings will be little bit different, probably.

BR, Jan

Thank you Jan. When you respond, I feel supported.

I too have F446RE and it works without any difficulty.

I used EEPROM for testing on F410RB but it doesn’t even generate a clock on the SCL line nor there is any data on the SDA line which was observed on oscilloscope. Both the lines have proper pullup resistors. It indicates that the hardware is not responding to the instructions. I tried another set of F410RB as well. I think this is a sufficient proof for registering the issue.

Incidentally if I replace the I2C in the EEPROM function with SoftI2C (software I2C) it works smoothly on the same pins without making any change. This is another proof of hardware I2C not working.

I tried FMPI2C_1, I2C_1 and also I2C_2. None of the I2C worked.

I have not yet tried SPI.

UART on the device worked.

Best regards,
John

Hmm, that is strange.
You can try to downgrade MbedOS version (your → 5.15.0 → 5.14 → and so on) and check if that issue is also in older versions. When you find functional version then you can compare the sources and find the problem.
You can also check Issues · ARMmbed/mbed-os (github.com) whether it has not been reported and if not, you can do it by yourself.

BR, Jan

Many thanks Jan. I am using Mbed Studio. How do I select the OS version for downloading? I am not sure but I think it download only the latest version. Please guide me.

Best Regards,
John.

You are welcome.

Of course I will show you - Managing libraries - Managing libraries | Mbed Studio Documentation
But if you do it this way, it will take a long time (change library and download it, recompile whole project and so on). So, I recommand you to use Online Compiler or KeilStudio online (very much similar to MbedStudio), but it will take much less time. However, this only applies if you will try more than approx two versions of MbedOS.

BR, Jan