Hi Daniel,

Thanks for PR #10753, yes that fixed the problem for me. I am using a PCB with the ina260 sensor in place of the ina226, similar functionality and  I2C address.

I am working on a driver for the ina260 which I can submit once I have completed more tests.

Kind regards

Stewart

On 25/09/2023 21:52, Stewart Charnell wrote:
Hi Daniel,

Sorry for not replying earlier, I was away for the weekend. I will test out PR #10753 tomorrow.

Kind regards

Stewart

On 21/09/2023 15:13, Daniel Pereira Carvalho wrote:
Hi Stewart,


You are right, there is a mistake regarding pin definitions in the file
boards/arm/stm32l4/nucleo-l432kc/src/stm32_ina226.c. I tried to fix these pin definitions on PR #10753 but I can't test them. Are you able to test it?

Thanks

Daniel Pereira de Carvalho


Em qua., 20 de set. de 2023 às 13:42, Stewart Charnell <
nu...@charnell.plus.com> escreveu:

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

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.

Kind regards

Stewart Charnell



Reply via email to