Hi Stewart, On 9/20/23, Stewart Charnell <nu...@charnell.plus.com> wrote: > Hi, > > Has anyone used the I2C functionality on the STM Nucleo-32 board (it > uses the STM32L432 processor)? I think there is an issue with the file > boards/arm/stm32l4/nucleo-l432kc/src/stm32_ina226.c. > > This board can support Arduino NANO pinout compatibility by using links > on the PCB. > Section '6.10 Solder bridges' of doc. 'UM1956 User manual STM32 > Nucleo-32 boards (MB1180)' details these links. > > One option for the I2C1 interface is to use STM32L432 pins PB_7 > (function I2C1_SDA, PCB pin D4) & PA_6 (function I2C1_SCL, PCB pin D5), > which are linked by solder bridges on the PCB to STM32L432 pins PA_6 > (PCB pin A5) & PA_5 (PCB pin A4) to maintain Arduino NANO pinout > compatibility. > > The webpage os.mbed.com/platforms/ST-Nucleo-L432KC has a picture of the > PCB showing the pinout options, and this Information: > > By default the PA_5 (A4) and PA_6 (A5) pins can only be used as Input > floating (ADC function). > Remove SB16 and SB18 solder bridges in order to use these pins as > Digital output and have access > to other functions (DigitalOut, SPI, PWM, etc...). > > The file boards/arm/stm32l4/nucleo-l432kc/src/stm32_ina226.c contains > these lines: > > /* Configure D4(PA5) and D5(PA6) as input floating */ > > stm32l4_configgpio(GPIO_I2C1_D4); > stm32l4_configgpio(GPIO_I2C1_D5); > > Where GPIO_I2C1_D4 & GPIO_I2C1_D5 are defined in > boards/arm/stm32l4/nucleo-l432kc/include/board.h >
Yes, the comments is incorrect since it is defined to pins PB7 and PB6: #define GPIO_I2C1_D4 \ (GPIO_INPUT | GPIO_FLOAT | GPIO_PORTB | GPIO_PIN7) #define GPIO_I2C1_D5 \ (GPIO_INPUT | GPIO_FLOAT | GPIO_PORTB | GPIO_PIN6) > However the device pins PA5 and PA6 correspond to PCB pins A4 and A5 > respectively, not PCB pins D4 and D5. > These calls to the stm32l4_configgpio functions cause the I2C1 lines to > be disabled. > Daniel, since you submitted support to it and could know more about it, could you please help to clarify these things? BR, Alan