dcgong2917 opened a new pull request, #19582:
URL: https://github.com/apache/nuttx/pull/19582
## Summary
Adds GPIO character-driver support for the RTL8721F (amebagreen2) and the
RTL8721F EVB board, plus a fix to the shared Ameba GPIO ISR that this port
uncovered on hardware.
Two commits:
1. **arch/arm/common/ameba: fix level-triggered GPIO interrupt storm**
The shared port ISR clears interrupt status with
`GPIO_INTStatusClearEdge()`, which only clears edge latches. For a
level-triggered pin the status stays asserted while the level is active,
so the ISR re-enters forever once the level fires — the system hangs
before the application can service the event. The pin is now masked in
the ISR before the callback and re-enabled by the application via
`go_enable()`. Edge pins are unchanged. This also affects RTL8721Dx
(already in-tree).
2. **arch/arm/rtl8721f: add GPIO character driver support**
Wires the shared `ameba_gpio.c` into the RTL8721F build (three GPIO
ports A/B/C), adds the chip header, board glue, a minimal `gpio` NSH
defconfig, and documentation. On amebagreen2 the ROM `GPIO_Init` does
not call `PAD_PullCtrl`/`GPIO_INTMode`, so the driver now calls both
explicitly (harmless redundant writes on RTL8721Dx).
## Impact
- New feature for RTL8721F; no impact on other architectures.
- Behavioural fix for level-triggered GPIO interrupts on all Ameba ARM
chips (RTL8721Dx, RTL8721F). Edge-triggered and non-interrupt GPIO
behaviour is unchanged.
- New board config: `rtl8721f_evb/gpio`.
## Testing
Hardware-verified on the RTL8721F EVB (`rtl8721f_evb/gpio` config) via
`apps/examples/gpio`:
- Output pin (PA25): drive high/low, read-back confirmed.
- Input pin (PA24): read high/low confirmed.
- Interrupt pin (PA26): all trigger/polarity combinations exercised —
rising edge, falling edge, level high, level low. Level cases confirmed
the storm fix (system survives; without the fix it hangs).
--
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]