RTEMS | bsps/arm/stm32h7: group SPI CS GPIO initialization by port (!1161)

Mohamed Ayman (@mohamedayman23) gitlab at rtems.org
Wed Mar 25 04:57:23 UTC 2026



Mohamed Ayman created a merge request: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1161

Project:Branches: mohamedayman23/rtems:stm32h7-spi-group-cs-gpio to rtems/rtos/rtems:main
Author:   Mohamed Ayman



bsps/arm/stm32h7: group SPI CS GPIO initialization by port

Group SPI chip select (CS) GPIO pins by GPIO port during MSP initialization. This allows multiple CS pins belonging to the same GPIO block to be configured and updated together using a single operation.

Previously, each CS pin was initialized and set individually, even when multiple pins shared the same GPIO port. This change combines such pins into a single mask per port, improving efficiency and aligning better with the STM32 GPIO hardware design.

Additionally, CS pins are set to the inactive (high) state before configuring them as outputs to reduce the risk of unintended active-low glitches during initialization.

Basic validation checks are also added to guard against NULL SPI handles and missing configuration data.

This change addresses the existing TODO regarding handling multiple pins within a single GPIO block.

AI Usage: yes

AI Prompt: how can i improve this file neglect the TODO i will do it and till me how SPI is important but also optional.

AI model: gemini pro

How AI used: to clarify production improvement of code's goals

-- 
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1161
You're receiving this email because of your account on gitlab.rtems.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20260325/e8236f3d/attachment.htm>


More information about the bugs mailing list