nuttx/Documentation
Jorge Guzman 30735584a4 risc-v/gd32vw55x: fix I2C master and add gd32vw553k-start sht3x example
The GD32VW55x I2C master (the STM32-style "v2" IP) never completed a real
transfer. Two bugs:

1. Wrong kernel clock. The protocol state machine is clocked by the I2C
   kernel clock selected in RCU_CFG1.I2C0SEL, not by the APB1 bus clock that
   only feeds the register interface. The driver left it at the APB1 default
   and computed TIMING for PCLK1 (~80 MHz); the resulting prescaled period is
   so short that the SDADEL/SCLDEL setup and hold times fall below the
   analog-filter minimum of the IP, so the master latches START but never
   drives SCL (STAT stuck with BUSY set). Route I2C0 to IRC16M (16 MHz) and
   use it as clk_freq, and never let the prescaler drop below the value that
   keeps the prescaled clock at/under 4 MHz (250 ns) so SDADEL/SCLDEL stay in
   spec. This matches the vendor BSP (IRC16M, PSC=3).

2. Transfer timeout was zero. CONFIG_GD32VW55X_I2C_TIMEOTICKS has a Kconfig
   default of 0 ("override when non-zero"), but the driver derived the timeout
   with a plain #ifndef, which never triggers because the symbol is always
   defined. The polled wait loop therefore ran a single iteration and gave
   up. Address probes (NACK on the first pass) still worked and masked it;
   only multi-byte transfers exercised the loop. Honour the "0 means derive
   from seconds/milliseconds" contract.

Also make the interrupt wait immune to the ISR completing between startmsg()
and the wait (do not clobber a posted DONE), and drop a redundant cast.

To exercise this on hardware, add an "sht3x" configuration to the
gd32vw553k-start: the nsh base plus I2C0, the i2ctool and the Sensirion SHT3x
temperature/humidity driver, registered as /dev/i2c0 and /dev/temp0. I2C0 is
routed to PA2 (SCL) / PA3 (SDA) on AF4, the pins broken out on the J1 header
(datasheet Table 2-5); when SPI is enabled it claims PA2, so I2C0 falls back
to PB0/PB1, whose SDA pin is not broken out (the periph case).

Signed-off-by: Jorge Guzman <jorge.gzm@gmail.com>
2026-07-26 13:24:12 +02:00
..
_extensions Documentation: port warnings_filter Sphinx extension from Zephyr 2023-11-28 09:18:29 -08:00
_static
_templates
applications docs/applications/txmorse: Document the txmorse application 2026-07-24 12:03:37 +08:00
components drivers/sensors: add LIS3DSH accelerometer uORB driver 2026-07-25 14:45:40 +02:00
contributing !arch/stm32: move stm32l1 and finalize the directory split 2026-06-24 14:54:44 -03:00
debugging Documentation: Add documentation of SCHED_DUMP_TASKS and SCHED_DUMP_STACK 2026-06-09 08:04:54 -04:00
faq !boards: Remove NSH_ARCHINIT and board_app_initialize 2026-05-02 18:36:46 +08:00
guides arch/arm/src/stm32: unify pulse count driver into common/stm32 2026-07-12 09:35:51 +08:00
implementation Documentation: Fix kernel module wording. 2026-07-05 19:43:23 +02:00
introduction WIP: Documentation: replace first person perspectives 2025-05-19 20:21:33 +08:00
logos style: fix typos 2025-04-30 13:45:46 +08:00
platforms risc-v/gd32vw55x: fix I2C master and add gd32vw553k-start sht3x example 2026-07-26 13:24:12 +02:00
quickstart Documentation: fill in pass1 directory description in organization.rst 2026-07-06 10:18:42 -03:00
reference arch/avr/src/avrdx/avrdx_delay: add custom up_udelay function 2026-06-12 09:55:11 -04:00
ReleaseNotes Documentation: add NuttX 13.0.0 release notes 2026-06-25 19:50:07 +08:00
standards libc/unistd: add getgroups() 2026-06-24 14:55:11 -03:00
testing Documentation/testing: Document MemBrowse integration 2026-06-19 12:21:54 -03:00
.gitignore docs/tags: Introduce tagging feature to the documentation. 2025-04-29 09:18:25 +02:00
conf.py Documentation: conf: Ignore .venv 2026-05-29 01:26:21 +08:00
glossary.rst
index.rst docs/security: Add Security section to the documentation. 2026-01-06 02:17:20 +08:00
known-warnings.txt fs: Add VFS docs 2024-02-20 18:28:09 -08:00
legacy_README.md style: Fix "the the" typo across the codebase. 2026-03-23 11:07:49 +01:00
make.bat
Makefile doc: Improve sphinx build time + add autobuild help info. 2026-01-27 09:50:55 +08:00
Pipfile docs/plantuml: Add PlantUML support to Documentation build 2026-02-15 08:47:23 +01:00
Pipfile.lock build(deps): bump starlette from 1.0.1 to 1.3.1 in /Documentation 2026-06-18 12:49:49 -04:00
security.rst docs/security: Add Security section to the documentation. 2026-01-06 02:17:20 +08:00
substitutions.rst