Page 2 of 2

Re: STM32F407 I2C not Acknowledging

Posted: Tue Aug 24, 2021 9:33 am
by Kunal Gupta
I can't find this macro in hal_pal.h and hal_pal.c.
Do I have to define this macro PAL_STM32_OTYPE_OPENDRAIN in the header file of hal_pal.h???
Or this macro is already defined somewhere and I just have to make it TRUE.

These are my lines dor configuring the GPIO pins for stm32f407 discovery at i2C3

palSetPadMode(GPIOA, GPIOA_PIN8, PAL_MODE_ALTERNATE(4) | PAL_STM32_OSPEED_HIGHEST); /* I2C_SCK PA8 */
palSetPadMode(GPIOC,GPIOC_PIN9, PAL_MODE_ALTERNATE(4) | PAL_STM32_OSPEED_HIGHEST); /* I2C_SDA PC9 */

Re: STM32F407 I2C not Acknowledging

Posted: Tue Aug 24, 2021 9:51 am
by Giovanni
Hi,

The macro is defined in the Low Level Driver, it is STM32-specific, see: os/hal/ports/STM32/LLD/GPIOv2/hal_lld_pal.h

You just need to use it, it is always defined.

Giovanni

Re: STM32F407 I2C not Acknowledging

Posted: Tue Aug 24, 2021 6:49 pm
by Kunal Gupta
Yeah , found it and now it works perfectly fine.
thanks