raiden00pl opened a new pull request, #22245:
URL: https://github.com/apache/nuttx/pull/22245
## Summary
- arch/arm/stm32: Use the common I2C v2 driver on STM32F7, STM32H7,
STM32H5 and STM32N6. All STM32 families with the I2C v2 peripheral now
use `stm32_i2c_v2.c` and `stm32_i2c_v2_slave.c`; the local F7 and H7
drivers and the M33M55 driver are removed. The I2C timeout, dynamic
timeout and slave options are now shown on STM32H5.
- arch/arm/stm32: Compute the I2C timing from the kernel clock on all
families. F3, G4, F7 and H7 used a fixed TIMINGR table made for a 16 MHz
HSI: any frequency other than 100 kHz, 400 kHz or 1 MHz gave a 10 kHz
bus, and the F3 (8 MHz HSI) ran at half the requested speed. The kernel
clock defaults to the source that the family RCC code selects; a board
can set `STM32_I2Cn_FREQUENCY` in `board.h`.
- arch/arm/stm32g4: I2C4 set the TIM3 enable and reset bits, so I2C4 was
never clocked.
- arch/arm/stm32n6: Pads in VDDIO4 stayed isolated because
`PWR_SVMCR1_VDDIO4SV` was never set, and the I2C clocks stopped in WFI
because the RCC LPENR bits reset to 0.
- boards: Add I2C1 on the Arduino header of nucleo-g491re, nucleo-h533re
and nucleo-n657x0-q.
BREAKING CHANGE: `CONFIG_STM32_I2Cn_ANFOFF` now defaults to 0 (analog
filter on, was off), which changes the STM32H5 and STM32N6 I2C timing.
Quick fix: set `CONFIG_STM32_I2Cn_ANFOFF=1`.
BREAKING CHANGE: a board whose I2C kernel clock has no default (STM32H7
PLL3 or CSI) stops the build with an `#error`. Quick fix: define
`STM32_I2Cn_FREQUENCY` in `board.h`.
BREAKING CHANGE: the STM32H5 I2C timeout now defaults to
`CONFIG_STM32_I2CTIMEOTICKS=500` instead of 500 ms. Quick fix: set
`CONFIG_STM32_I2CTIMEOTICKS=50` (10 ms tick).
## Impact
STM32F3, G4, F7, H7, H5 and N6 I2C. No in-tree board needs a change; the
breaking changes above affect only out-of-tree boards and configurations.
## Testing
nucleo-f303re, nucleo-f767zi, nucleo-g491re, nucleo-h533re, nucleo-h743zi
and nucleo-n657x0-q with an X-NUCLEO-IKS01A2 shield on I2C1, at 100, 200
and 400 kHz: bus scan (all 5 shield devices found), 2000 register reads
without errors, 300-byte reads with the bus clock measured from the
transfer time, 100 transfers to an absent address followed by good reads,
and two threads reading the bus at the same time.
On master the 200 kHz bus ran at 10 kHz on F7, H7 and G4, and the F3 bus
ran at half the requested speed at every frequency. With this PR the
measured bus clock is about 90-98 % of the requested frequency on all six
boards, and all other checks pass as on master.
All in-tree STM32F3/F7/H7/N6 configurations with I2C build, and so do the
nsh configurations of F3, G4, H5, H7 and F7 with I2C1 enabled.
STM32H7R/S, I2C2-I2C4 and slave mode are not tested on hardware
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]