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

Postby Kunal Gupta » Tue Aug 24, 2021 9:33 am

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: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: STM32F407 I2C not Acknowledging

Postby Giovanni » Tue Aug 24, 2021 9:51 am

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

Postby Kunal Gupta » Tue Aug 24, 2021 6:49 pm

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


Return to “ChibiOS/RT”

Who is online

Users browsing this forum: No registered users and 4 guests