Getting HAL_ERROR while using I2C in Fast mode pulse
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2023-11-07 1:52 AM
Hi All,
I trying to interface MAX6651 Device using I2C module using STM32F410C8U6 MCU.
Device address is 0x36 But when i'm using
HAL_FMPI2C_IsDeviceReady(&hfmpi2c1, 0x36 , 2, 100); this API returning the value
HAL_ERROR.
Here are some snaps
Anybody look into it send some solutions
- Labels:
-
I2C
-
STM32CubeMX
-
STM32F4 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2023-11-21 8:46 AM
Hello @Advance_tech,
Here some possible solution for your issue :
- First, can you check the trace scope SCL & SDA ? The slave most likely don't ACK the master (which wait until the end of timeout) and return your "HAL_FMPI2C_ERROR_TIMEOUT" error.
- What is your STM32F4xx HAL Drivers version ? I checked on the V1.8.0 and there are no such function HAL_FMPI2C_IsDeviceReady(). Please use the last software version and call HAL_I2C_IsDeviceReady().
- Maybe you are not writing at the good address ? Check your ADD value.
Also, Can you try to write in the component memory with HAL_I2C_Mem_Write() and then read it thanks to HAL_I2C_Mem_Read(). Choose any register existing in the doc.
Best Regards,
Pierre
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2023-11-22 1:36 AM
hello @Pierre_Paris
- We have checked the SDA and SCL signals in scope refer the attached pic.
- we cannot use HAL_I2C_IsDeviceReady(). because we are using FMPI2C In STM32F410C8U6
only we can use HAL_FMPI2C_IsDeviceReady(). - we have connected the 10k to ADD pin so our address becomes the 3E
please refer to waveform only serial clock coming but there is not serial data
- Is there any chance that IC's I2C peripheral not working???
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2023-11-22 8:46 AM
Hello @Advance_tech,
- "Is there any chance that IC's I2C peripheral not working??? " : If you comply the absolute maximum ratings given in the Datasheet, it should work.
- Understood, have you respected the following initialization of the FMPI2C before using HAL_FMPI2C_IsDeviceReady() to check if target device is ready?
- Enable the FMPI2Cx interface clock
- FMPI2C pins configuration (Enable the clock for the FMPI2C GPIOs + Configure FMPI2C pins as alternate function open-drain)
- NVIC configuration if you need to use interrupt process
- DMA Configuration if you need to use DMA process
- Configure the Communication Clock Timing, Own Address1, Master Addressing mode, Dual Addressing mode, Own Address2, Own Address2 Mask, General call and Nostretch mode in the hfmpi2c Init structure.
- Initialize the FMPI2C registers by calling the HAL_FMPI2C_Init(), configures also the low level Hardware (GPIO, CLOCK, NVIC...etc) by calling the customized HAL_FMPI2C_MspInit(&hfmpi2c) API.
- "Pease refer to waveform only serial clock coming but there is not serial data" : It seems that's the opposite but I don't understand this behavior. You can find here the errata sheet. Please read the I2C chapter.
Best Regards,
Pierre
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

- « Previous
-
- 1
- 2
- Next »