STM32F407 I2C not Acknowledging

Discussions and support about ChibiOS/RT, the free embedded RTOS.
Kunal Gupta
Posts: 10
Joined: Tue Jul 20, 2021 6:31 pm
Has thanked: 1 time

Re: STM32F407 I2C not Acknowledging

Post 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 */
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM32F407 I2C not Acknowledging

Post 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
Kunal Gupta
Posts: 10
Joined: Tue Jul 20, 2021 6:31 pm
Has thanked: 1 time

Re: STM32F407 I2C not Acknowledging

Post by Kunal Gupta »

Yeah , found it and now it works perfectly fine.
thanks
Post Reply