Skip to content

reorganize and unify STM32 ports - #50

Open
raiden00pl wants to merge 27 commits into
masterfrom
stm32_refactor_all
Open

raiden00pl wants to merge 27 commits into
masterfrom
stm32_refactor_all

Conversation

@raiden00pl

@raiden00pl raiden00pl commented May 20, 2026 •

Copy link
Copy Markdown
Owner

Summary

If the community considers this change desirable, it should be included in release 13.0, as it's a significant change that causes disruptions. I think this is the best time for this reorganization, even if it will upset many users and probably break something.

This PR is the first step toward unification and reorganisation of STM32 ports. This is a huge, breaking change that impacts many users. It also introduces the standard for STM32 ports described in the documentation page. Any new STM32 port or new STM32 feature should adhere to these rules.

This reorganization allows for the separation of STM32 families with minimal code duplication. Ultimately, we'll be able to eliminate most of the duplication between STM32 families, but this is a long-term task. Subsequent changes won't be as invasive, and most won't require breaking changes.

This PR focuses on the first step in the STM32 redesign, which is the most invasive and includes a lot of breaking changes.

Summary of changes:

  1. Each STM32 family has its own directory.
  2. STM32 families can use the STM32 common directory, which allows them to use common drivers and common hardware definitions shared between families.
  3. Peripheral drivers included by a family depend on the peripheral's IP core version.
  4. STM32 Kconfig option names are unified.
  5. STM32 boards can use common board drivers.
  6. STM32 hardware definition names are unified.
  7. Kconfig files have been split into smaller ones, which makes them much easier to manage. This was proposed several times for new STM32 ports before, but doing it for one STM32 port and leaving the rest untouched didn't make sense. Now it's done for all STM32 ports, as it should be.
  8. Added a documentation page discussing STM32 ports organisation.
  9. Add boards/common/stm32 support for STM32L4

What is not done yet:

  1. Migrate all other families to STM32 arch common directories.
    The stm32f7, stm32h7, and stm32l4 should be easy. The rest, based on the Cortex-M33, will require more time because I'm not familiar with these chips yet. After this migration, support for the missing stm32 families should be much easier.
  2. Migrate all other families to STM32 board common directories.
    This change will later enable us to solve another problem - the standardization of ST boards, so all nucleo board follows the same patterns and provide the same features.
  3. Unify and clean up Kconfig options and families features. Ultimately, each family should support the same features as the hardware allows. At the moment Kconfig has some long and ugly lines, they need to be analyzed and simplified. Kconfig still has a few sections that have not been generalized, mainly due to drift of some families from other implementations.
  4. Some families have driver changes that haven't been propagated to other families. This needs to be properly analyzed and ported where possible.
  5. regenerate CODEOWNERS

I know this PR is huge, but it can't really be done in smaller steps. This is an attempt to fix a problem that's been building for over a decade. I will create a separate PR so it is easier to review, this PR is to show the final effect

For all AI skeptics here - this PR was created with AI assistance and burned hundreds of dollars worth of tokens. There is no other way to do it, doing it manually is unrealistic, especially if you do it yourself, for free :) This PR doesn't add new code, it only organizes the old code, so the code license remains the same as the original code

References:
apache#18894
apache#16172

Impact

Breaking change that impacts many users. There should be no functional changes; users should only need to update defconfig options in theory, but this is a huge change done mostly with AI assistance, so there is some chance that things will be broken.

The larger the PR, the greater the chance that something will break uncontrollably. This change is huge, so something will definitely break. Therefore, if this change is to be implemented upstream, it should be in release 13.0, which already contains a lot of breaking changes.

I tried to preserve the git history as much as possible, but for Kconfig it was not possible.

What we gain from this PR:

  1. Unification and standardization of STM32. Portability between STM32 families will finally be as it should be.
    No more questions about how to create new STM32 ports, everything is set in advance and the user has to comply.
  2. After the migration of the remaining families to common/stm32 is completed, maintaining the families will be much easier. Fewer files to track, less duplicate code.
  3. Adding support for new STM32 families will be easier. Reusable blocks can be easily included by new ports.
  4. All STM32 boards can use the same boards/common, which can significantly simplify boards code. Ultimately, it should be possible to standardize all STM32 boards like nucleo and create common board initialization logic.

Testing

CI

TODO upstream build and test:

  • nucleo-l073rz:nsh - OK
  • nucleo-f103rb:nsh
  • nucleo-l152re:nsh
  • nucleo-f091rc:nsh
  • nucleo-c071rb:jumbo
  • nucleo-h743zi2:jumbo
  • nucleo-f446re:jumbo

Later I will do tests with my Dawn project (https://github.com/railab/dawn) where I have a lot of HW automated tests based on NTFC, so it should catch most of the regressions.

@raiden00pl
raiden00pl force-pushed the stm32_refactor_all branch 3 times, most recently from de77ce2 to af80efa Compare June 10, 2026 18:34
…config files

Replace STM32_COMMON_* composite symbols with capability flags in
Kconfig.memory, Kconfig.sai, Kconfig.dfsdm, Kconfig.i2c, Kconfig.ltdc
and Kconfig.dma:

- STM32_COMMON_SRAM2_OPTIONS -> STM32_HAVE_SRAM2_HEAP; the
  STM32_SRAM2_INIT select condition folds away because the U5 leg of
  the new flag already requires STM32_SRAM2
- SAI PLL options -> STM32_HAVE_SAI1PLL / STM32_HAVE_SAI2PLL
- DFSDM filter options -> STM32_HAVE_IP_DFSDM_V1
- I2C v1-only options (I2C_ALT, DUTY16_9) -> STM32_HAVE_IP_I2C_M3M4_V1;
  this drops F37x/G4 from the visibility set, which select the I2C v2
  IP and never build the v1 driver these options belong to
- LTDC_REGDEBUG -> STM32_HAVE_IP_LTDC_M3M4_V1 / new
  STM32_HAVE_IP_LTDC_M7_V1; LTDC_USE_DSI composite dropped as DSIHOST
  is only selectable on F7
- STM32_DMACAPABLE -> new STM32_HAVE_DMACAPABLE driver-feature flag;
  ASSUME_CACHE_ALIGNED composite dropped as ARMV7M_DCACHE already
  implies F7/H7 within STM32

Verified .config equivalence with olddefconfig on F3/F4/G4/F7/H7/H5/
L4/U5/WB/WL5 boards: only the new capability symbols appear.

Signed-off-by: raiden00pl <[email protected]>
Assisted-by: Claude Code
….eth

- legacy-only PTP/enhanced-descriptor options -> existing
  STM32_HAVE_IP_ETHMAC_M3M4_V1 (selected by all legacy families with
  ETHMAC)
- H7/H5 descriptor-count and NO_PHY options -> new STM32_HAVE_IP_ETHMAC_V2
  (the newer Synopsys MAC shared by H7/H5)
- MII/RMII MCO1/MCO2 clock options -> new STM32_HAVE_MCO1/STM32_HAVE_MCO2
  hardware-capability flags
- STM32_PHYADDR default inverted to key off STM32_HAVE_IP_ETHMAC_V2
- STM32_PHY_POLLING composite dropped: STM32_PHY_HAVE_POLLED is only
  selected for non-legacy chips, so the family condition was redundant

Verified .config equivalence with olddefconfig on eth-enabled F4/F7/H7
configs and the full board matrix: only the new capability symbols
appear.

Signed-off-by: raiden00pl <[email protected]>
Assisted-by: Claude Code
…HAVE_ETHMAC

Three overlapping flags described the same capability:
STM32_HAVE_ETHMAC (legacy families), STM32_HAVE_ETHRNET (F7, typo) and
STM32_HAVE_ETHERNET (H7/H5 + bridge selects from the other two).

Keep STM32_HAVE_ETHMAC as the canonical flag: F7/H7/H5 chips now select
it directly, the legacy bridge selects are dropped, the STM32_ETHMAC
gate in Kconfig.periph and the chip.h STM32_NETHERNET definitions use
it, and the two redundant flags are deleted.

Verified .config equivalence on eth-enabled F4/F7/H7 configs plus the
full board matrix: only the flag rename appears. Built
nucleo-f767zi:netnsh and nucleo-h743zi:netnsh.

Signed-off-by: raiden00pl <[email protected]>
Assisted-by: Claude Code
…c/usb/system/flash Kconfig

- Kconfig.sdio: legacy SDIO options need no family gate (STM32_SDIO is
  only selectable on legacy chips); SDMMC options move to new
  STM32_SDMMC_HAVE_DMA / _HAVE_IDMA / _HAVE_SDIO_MODE feature flags
- Kconfig.rtc: MAGIC_REG range keyed to the RTCC IP flags; LSE drive
  capability options move to new STM32_HAVE_RTC_LSE_AUTO_DRV /
  STM32_HAVE_RTC_LSE_DRV / STM32_HAVE_RTC_LSE_DRV_LOWER; redundant
  legs folded (the AUTO option can only be enabled where implemented)
- Kconfig.usb: host debug options gate on STM32_USBHOST (legacy-only
  symbol) or new STM32_USBHOST_HAVE_DEBUG; USBFS/USBDEV REGDEBUG and
  OTG ID-pin options move to per-driver feature flags; host menus drop
  the redundant LEGACY condition
- Kconfig.system: idle-sleep option -> STM32_HAVE_DISABLE_IDLE_SLEEP;
  DFU -> DFUMODE IP flags (new M0_V1 for the Cortex-M0 group);
  tickless timer/channel -> STM32_HAVE_TICKLESS_UPTO_TIM14/_TIM17
  (encode both the family set and the timer-number range); SysTick
  clock choice keys off ARCH_CORTEXM0 per the naming rules
- Kconfig.flash: override/prefetch/progmem conditions move to
  STM32_HAVE_FLASH_OVERRIDE / _PREFETCH / _PROGMEM / _PROGMEM_MTD

Verified .config equivalence with olddefconfig on 13 configs across
F3/F4/G4/F7/H7/H5/L4/U5/WB/WL5: only new capability symbols appear.

Signed-off-by: raiden00pl <[email protected]>
Assisted-by: Claude Code
….spi

- STM32_SPI_INTERRUPTS -> new STM32_HAVE_SPI_INTERRUPTS
- SPIn DMA buffer options -> new STM32_HAVE_SPI_DMA_BUFFER (plus a
  per-instance STM32_SPI6_HAVE_DMA_BUFFER, since SPI6 DMA is reachable
  on F4 but its buffer option was F7/H7/H5-only)
- SPI4/5/6 DMA gates collapse onto the existing
  STM32_HAVE_SPI_DMA_FAMILY, whose family set is identical
- Cortex-M0 group DMA legs -> new STM32_HAVE_SPI_DMA_M0
- COMMTYPE options -> new STM32_HAVE_SPI_COMMTYPE
- I2S options: LEGACY legs -> existing STM32_HAVE_IP_I2S_M3M4_V1 (the
  F7 legs stay until the F7 I2S driver is unified)

The undefined STM32_SPI_INTERRUPT (singular) references are left
untouched; they predate this change.

Verified .config equivalence with olddefconfig on 13 configs: only new
capability symbols appear.

Signed-off-by: raiden00pl <[email protected]>
Assisted-by: Claude Code
…/periph Kconfig

- Kconfig.adc: F7/H7/H5/L5/U5 composites expand to explicit family
  names (they die when the remaining family ADC drivers are unified);
  the L4_L5_U5 tails collapse onto STM32_HAVE_ADC_L4, since L5 cannot
  reach STM32_ADCn and U5 never sets STM32_ADC
- DAC DMA-timer options -> new STM32_HAVE_DAC_DMA_TIMER
- Kconfig.periph:
  - I2S/I2S3 selects key off STM32_HAVE_IP_I2S_M3M4_V1
  - DMA2D FB selects drop the redundant LEGACY and HAVE_DMA2D terms
  - BBSRAM -> new STM32_HAVE_BBSRAM (BBSRAM IP flag or F7/H7)
  - AES ALGTEST selects simplify to STM32_HAVE_AES && CRYPTO_ALGTEST;
    this now also covers L4, which uses the same common AES driver but
    was left out of the family lists
  - drop the USBFS 'select USBDEV if ...' line shadowed by the
    unconditional select above it
  - STM32_USBHOST gates on the OTG host IP flags instead of LEGACY
  - STM32_SDIO gates on STM32_HAVE_IP_SDIO_M3M4_V1; this removes the
    dead SDIO option from G4, which has no SDIO hardware (the F1
    connectivity/value-line exclusions are encoded at the select)
  - USARTn_SERIALDRIVER selects -> new STM32_HAVE_USART_SERIALDRIVER
  - PHY_HAVE_POLLED select keys off the ETHMAC IP flag; LCD USBDEV
    select keys off ARCH_CORTEXM0

Verified .config equivalence on 13 configs: only new capability
symbols appear, plus the intended STM32_SDIO removal on G4.

Signed-off-by: raiden00pl <[email protected]>
Assisted-by: Claude Code
….tim

Replace all 160 STM32_COMMON_* references with capability flags:

- wrappers: STM32_PULSECOUNT/ONESHOT/FREERUN/PWM_LL_OPS gate on new
  STM32_HAVE_PULSECOUNT / STM32_HAVE_TIM_ONESHOT / STM32_HAVE_TIM_FREERUN /
  STM32_HAVE_PWM_LL_OPS; the L4-lineage tickless defaults use new
  STM32_HAVE_TICKLESS_ONESHOT; the ONESHOT_MAXTIMERS family condition is
  dropped as it repeats the STM32_ONESHOT availability set
- per-channel polarity/idle options (76 lines) -> new
  STM32_HAVE_TIM_PWM_POLARITY; the redundant STM32_TIM term is dropped
  since CHxOUT already implies it through TIMn_PWM -> STM32_TIMn
- TIM12-14 and TIM15-17 option groups -> new STM32_HAVE_TIM_PWM_TIM12_14
  / STM32_HAVE_TIM_PWM_TIM15_17
- channel 5/6 (internal) -> new STM32_HAVE_TIM_PWM_CHANNEL5/_CHANNEL6;
  the L5/U5 channel-mode quirk pairs reuse STM32_HAVE_TIM_PWM_CHMODE_LIMITED
  (equivalent: the M0 members of that flag cannot enable TIMn_CHANNEL5)
- GP-timer extended channel-mode ranges -> new
  STM32_HAVE_TIM_PWM_CHMODE_GP_EXTENDED
- capture options -> new STM32_HAVE_TIM_CAP; remaining
  L4/L5/U5/H7/H5-only capture and LPTIM legs expand to explicit family
  names that die when those family drivers are unified

Verified .config equivalence with olddefconfig on 18 configs including
PWM/FOC/capture-heavy ones (nucleo-h743zi:pwm, nucleo-f302r8:ihm07m1_f32,
nucleo-l432kc:spwm, b-g474e-dpow1:buckboost, nucleo-f302r8:qenco): only
the new capability symbols appear. Built nucleo-h743zi:pwm and
nucleo-f302r8:ihm07m1_f32.

Signed-off-by: raiden00pl <[email protected]>
Assisted-by: Claude Code
Complete the composite removal:

- expand the remaining STM32_COMMON_* references inside Kconfig.have
  and Kconfig.qspi to explicit ARCH_CHIP_* lists (family names are
  tolerated in the capability-flag definitions, which are the single
  family->capability map)
- gate the legacy Cortex-M3/M4 system-core source block in Make.defs /
  CMakeLists.txt with new STM32_HAVE_IP_SYSCORE_M3M4_V1 instead of
  STM32_COMMON_LEGACY, and switch the stm32_dma2d.h / stm32_exti_pwr.h /
  stm32_usbhost.h facade dispatch to the same flag
- delete the composite definitions from the common Kconfig;
  'grep -r STM32_COMMON_ arch/ boards/' is now clean (modulo the
  STM32_COMMON_SRCDIR make variable)
- update the stm32_ports.rst Kconfig-simplification section

Verified .config equivalence on 18 configs: only the composite symbols
disappear and STM32_HAVE_IP_SYSCORE_M3M4_V1 appears on legacy families.
Built stm32f4discovery:nsh (make and CMake/ninja) and nucleo-f722ze:nsh.

Signed-off-by: raiden00pl <[email protected]>
Assisted-by: Claude Code
… names

Pure renames per the Kconfig naming rules (STM32_HAVE_* must describe
capabilities or IP versions, not families):

- STM32_HAVE_ADC_L4    -> STM32_HAVE_IP_ADC_M3M4_V3
- STM32_HAVE_ADC_H5    -> STM32_HAVE_IP_ADC_M33_V1
- STM32_HAVE_FDCAN_H7  -> STM32_HAVE_IP_FDCAN_M7_V1
- STM32_HAVE_OTG_H7    -> STM32_HAVE_IP_OTG_M7_V1

The flags still mark not-yet-unified family drivers; the final IP
mapping is decided when each driver moves to common/stm32.
STM32_HAVE_I2C_H5 and STM32_HAVE_USART_H5 are intentionally left: they
die with the I2C and serial unifications. STM32_HAVE_IP_CRYPTO_H7 is
renamed together with the CRYP driver move.

Verified .config equivalence on 18 configs (rename-only diffs); built
nucleo-h743zi:nsh, b-l475e-iot01a:nsh, nucleo-h563zi:nsh.

Signed-off-by: raiden00pl <[email protected]>
Assisted-by: Claude Code
…IP names

These IP blocks are about to be selected by Cortex-M7 (F7/H7) and
Cortex-M33 (H5) families as their local drivers are retired into
common/stm32. An IP version names the silicon only and must not encode
the CPU core it sits next to, so drop the transitional m3m4 prefix
before extending them:

- STM32_HAVE_IP_RNG_M3M4_V1   -> STM32_HAVE_IP_RNG_V1
- STM32_HAVE_IP_WDG_M3M4_V1   -> STM32_HAVE_IP_WDG_V1
- STM32_HAVE_IP_DMA2D_M3M4_V1 -> STM32_HAVE_IP_DMA2D_V1
- STM32_HAVE_IP_I2C_M3M4_V2   -> STM32_HAVE_IP_I2C_V2

with the matching source renames (stm32_rng_v1.c, stm32_iwdg_v1.c,
stm32_wwdg_v1.c, stm32_dma2d_v1.c/h, stm32_i2c_v2.c,
stm32_i2c_v2_slave.c). IP names still carrying a core prefix remain
used by a single core class only; each drops the prefix when it first
crosses cores, at which point the per-core version spaces are merged
deliberately.

Signed-off-by: raiden00pl <[email protected]>
Assisted-by: Claude Code
Retire the F7/H5/H7/L4 copies of the RNG driver in favor of
common/stm32/stm32_rng_v1.c. The H7 copy was byte-identical
except the header comment; F7/H5/L4 differed only in naming style,
interrupt-enable placement, and the ISR error handling.

The common ISR now adopts the F7/H5/L4 error recovery unconditionally:
clock error (CEIS) is cleared and retried, and seed error (SEIS) is
cleared with an RNGEN toggle, instead of silently discarding the
sample. The L4 copy also ignored the nxsem_wait() return value; the
common driver's handling is kept.

The four families select STM32_HAVE_IP_RNG_V1 (if STM32_HAVE_RNG)
from their family peripheral block. The common Make.defs/CMakeLists
RNG gate moves out of the STM32_HAVE_IP_SYSCORE_M3M4_V1 legacy block
to the top level so non-legacy families reach it.
stm32l4/hardware/stm32l4_rng.h is renamed to stm32_rng.h to match the
include used by the common driver.

Built nucleo-l496zg:nsh (make and CMake), stm32f769i-disco:netnsh,
stm32f4discovery:nsh, and nucleo-h743zi/nucleo-h563zi with RNG
force-enabled.

The common driver already clears the SEIS/CEIS flags and restarts the
generator on a seed error; the STM32H7 fix for a missing RNG kernel
clock (abort the read with -EIO instead of retrying forever) is carried
over.

Signed-off-by: raiden00pl <[email protected]>
Assisted-by: Claude Code
The F7 stm32_dma2d.c/h were formatting-only forks of
common/stm32/stm32_dma2d_m3m4_v1.c/h. F7 now selects
STM32_HAVE_IP_DMA2D_V1 (if STM32_HAVE_DMA2D), the common facade
and build gates dispatch on that IP flag instead of the legacy SYSCORE
flag, and the gate moves out of the legacy-only Make.defs block.

Built stm32f746g-disco:fb with DMA2D force-enabled and
stm32f429i-disco:fb as the F4 regression control.

Signed-off-by: raiden00pl <[email protected]>
Assisted-by: Claude Code
stm32h7/stm32_aes.c drives the CRYP peripheral (not the AES IP); move
it to common/stm32/stm32_aes_cryp_v1.c with its register definitions
relocated to common hardware/stm32_cryp_v1.h, and rename
STM32_HAVE_IP_CRYPTO_H7 to STM32_HAVE_IP_CRYP_V1 accordingly. The
common stm32_aes.h facade dispatches on the new flag.

The cryptodev wrapper stm32_crypto_m3m4_v1.c adopts the H7 version:
it takes the IV from crp->crp_iv, which is where NuttX cryptodev
delivers the user IV (the old crd->crd_iv read an unset field), and it
accepts 192/256-bit AES-CTR keys, which the backend validates.

Built nucleo-h753zi:crypto (exercises both moved files); .config
equivalence verified on 18 configs.

Signed-off-by: raiden00pl <[email protected]>
Assisted-by: Claude Code
The stm32h7 SPI slave driver tests CONFIG_STM32H7_SPIx_SLAVE and
CONFIG_STM32H7_SPI_SLAVE_QSIZE, which no Kconfig defines.  Add the
common STM32_SPIx_SLAVE and STM32_SPI_SLAVE_QSIZE options and use them.
The queue size now comes from Kconfig with a range, so drop the size
check from the driver.

Make the SPI menu and the COMMTYPE options visible when only a slave
instance is enabled, and fix an undeclared identifier in spi_bind()
that was never seen because the driver was never built.

Signed-off-by: raiden00pl <[email protected]>
Assisted-by: Claude Code
Several options depend on or select symbols that no Kconfig defines, so
they can never be selected:

  - STM32_SPI_INTERRUPT is a misspelling of STM32_SPI_INTERRUPTS, used in
    the dependencies of the seven SPIx_DMA options, so the guard against
    combining DMA with interrupt driven SPI did not work.
  - STM32_LTDC_L1_ARGB15555 has one 5 too many.
  - STM32_BLE_LS_CLKSRC_HSE is spelled STM32_BLE_LS_CLK_SRC_HSE.
  - STM32_HAVE_ICACHE_REMAP is selected by the H5 families and guards the
    four ICACHE remap options, but was never defined.

Signed-off-by: raiden00pl <[email protected]>
Assisted-by: Claude Code
The LTDC driver tests CONFIG_STM32_LCD_BACKLIGHT and the OTG drivers
test CONFIG_STM32_OTGFS_SOFOUTPUT and CONFIG_STM32_OTGHS_SOFOUTPUT,
which no Kconfig defines, so the backlight control and the SOF output
pin were never built.  Use CONFIG_STM32_LTDC_BACKLIGHT and
CONFIG_STM32_OTG_SOFOUTPUT.

Also correct the trailing comments of the OTG device drivers, which
name a CONFIG_STM32_OTGxSDEV symbol that never existed.

Signed-off-by: raiden00pl <[email protected]>
Assisted-by: Claude Code
Two options are spelled differently in Kconfig and in the drivers, so
the option is unreachable and the code is dead:

  - STM32_HRTIM_CAP is tested as STM32_HRTIM_CAPTURE, which the per timer
    capture options also depend on.
  - STM32_HRTIM_AUTODELAY is tested as STM32_HRTIM_AUTODELAYED.

Rename the Kconfig symbols to the names the code uses.

Signed-off-by: raiden00pl <[email protected]>
Assisted-by: Claude Code
The ARM LLVM 17.0.1 toolchain used by CI selects its runtime libraries
from the target, architecture, FPU and ABI flags. It does not ship the
armv7em_*.cfg files requested by the ARMv7-M CMake toolchain, causing
Cortex-M7 builds with the FPU enabled to fail before compilation.

Use the existing platform flags for runtime selection, as the other ARM
CMake toolchains do. Verify full STM32F4, STM32F7 and STM32H7 firmware
builds with Clang and the FPU enabled.

Signed-off-by: raiden00pl <[email protected]>
The M33 GPIO driver is the MODER/AFR GPIO used by most STM32 families.
Rename it to GPIO v2 so families of other core classes can use it.
No functional change.

Signed-off-by: raiden00pl <[email protected]>
Assisted-by: Claude Code
Rename GPIO_SPEED_xxMHZ to GPIO_SPEED_xxMHz, the spelling used by all
other STM32 GPIO headers and the common I2C drivers.

Signed-off-by: raiden00pl <[email protected]>
Assisted-by: Claude Code
Configure PUPDR, OSPEEDR, OTYPER and AFR before MODER, as described in
RM0316 section 11.3.2, so a pin never runs in its new mode with its old
configuration.  The alternate function is cleared after the pin leaves
alternate function mode.  ST HAL HAL_GPIO_Init/DeInit use the same order.

Signed-off-by: raiden00pl <[email protected]>
Assisted-by: Claude Code
Replace the local GPIO driver with the common GPIO v2 driver.  The
common driver gains the SYSCFG EXTICR port selection and the analog
switch control (ASCR) of STM32L47x/L48x that the L4 driver had.

Signed-off-by: raiden00pl <[email protected]>
Assisted-by: Claude Code
Replace the local GPIO driver with the common GPIO v2 driver.  Port
numbers now match the SYSCFG EXTICR encoding (PD=3, PE=4, PH=7).  The
local driver numbered the existing ports consecutively, so EXTI on PH
selected the wrong port, and on parts without PD the PE and PH pins were
configured in the registers of another port.

Signed-off-by: raiden00pl <[email protected]>
Assisted-by: Claude Code
Replace the local GPIO driver with the common GPIO v2 driver.  Port
numbers now match the SYSCFG EXTICR encoding (PH=7).  The local driver
numbered PH as port 3, so EXTI on PH selected port D.

Signed-off-by: raiden00pl <[email protected]>
Assisted-by: Claude Code
STM32_NPORTS is the GPIO port count used by the common GPIO v2 driver
and all other families that use it.  No functional change.

Signed-off-by: raiden00pl <[email protected]>
Assisted-by: Claude Code
Replace the local GPIO driver with the common GPIO v2 driver.  The
common driver gains ports J and K and stm32_iocompensation().

Signed-off-by: raiden00pl <[email protected]>
Assisted-by: Claude Code
Replace the local GPIO driver with the common GPIO v2 driver.  The
common driver gains ports M-P and the SBS EXTICR and compensation cell
registers of STM32H7RS.  Ports F and G of parts without them are no
longer rejected by stm32_configgpio(), the memory map defines them.

Signed-off-by: raiden00pl <[email protected]>
Assisted-by: Claude Code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arch: arm Area: Documentation Improvements or additions to documentation Board: arm Size: xl

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant