Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STM32F4: FMPI2C doesn't work #15413

Open
mikrodust-henrikp opened this issue May 3, 2023 · 6 comments
Open

STM32F4: FMPI2C doesn't work #15413

mikrodust-henrikp opened this issue May 3, 2023 · 6 comments

Comments

@mikrodust-henrikp
Copy link
Contributor

mikrodust-henrikp commented May 3, 2023

Description of defect

When trying to use I2C with pins connected to FMPI2C1 on an STM32F412 the code compiles without warnings and no assert is raised while trying to communicate over said I2C bus, but no output is observed on the pins configured.

Debugging a bit more, I've noted that RCC, clocks, pin states, etc are correctly set up, but it seems that the I2C HAL API in mbed doesn't work for FMPI2C. Noted also that it fails silently without warning. Just doesn't do anything.

I tested by calling the HAL_FMPI2C_Init() and HAL_FMPI2C_Master_Transmit() functions with appropriate settings and it then works, so there is nothing wrong with the HAL or the pinmap.

Target(s) affected by this defect ?

STM32F4

Toolchain(s) (name and version) displaying this defect ?

GCC

What version of Mbed-os are you using (tag or sha) ?

6.17.0

What version(s) of tools are you using. List all that apply (E.g. mbed-cli)

mbed-cli2

How is this defect reproduced ?

Connect I2C bus to FMPI2C1 on an STM32F4, try to use it via the I2C interface.

@mbedmain
Copy link

mbedmain commented May 3, 2023

@mikrodust-henrikp thank you for raising this issue.Please take a look at the following comments:

What toolchain(s) are you using?

NOTE: If there are fields which are not applicable then please just add 'n/a' or 'None'. This indicates to us that at least all the fields have been considered.
Please update the issue header with the missing information.

@mikrodust-henrikp
Copy link
Contributor Author

Maybe it's known, since I found mentions regarding this in the forums: https://forums.mbed.com/t/not-working-fmpi2c1-stm32f446re-nucleo-f446re-fmpi2c/7890

But it seems wrong that it fails silently, and of course would be even better if it actually worked.

@0xc0170
Copy link
Contributor

0xc0170 commented May 5, 2023

@jeromecoutant would you know about FMPI2C1 ?

@jeromecoutant
Copy link
Collaborator

@jeromecoutant would you know about FMPI2C1 ?

No... maybe this is why it has not been supported yet with mbed-os :-)

@jeromecoutant
Copy link
Collaborator

@mikrodust-henrikp
Copy link
Contributor Author

We have a custom target and the STM32_gen_PeripheralPins.py will happily generate FMPI2C definitions in PeripheralPins. So..maybe solved for some targets that way, but not all. Also the https://github.com/ARMmbed/mbed-os/blob/master/targets/TARGET_STM/i2c_api.c has some clock setup and things related to FMPI2C which sort of indicates that it should work, but maybe it should be made to fail with MBED_ERROR or something if FMPI2C1 is encountered, or something.

Even better would be to fix i2c_read/i2c_write to use the fmpi2c HAL API that seems to be working just fine, but I don't know how well that'll work with the i2c_byte_read et al..if at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants