RTEMS | stm32h7/spi-support: correct bugs and improve safety in SPI HAL (!1162)
Mohamed Ayman (@mohamedayman23)
gitlab at rtems.org
Tue Apr 14 16:45:37 UTC 2026
Mohamed Ayman commented on a discussion: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1162#note_148545
Hi Dr. @gedare 👋
Thanks for the clarification and let me explain more precisely what I meantt.
I created a standalone test file where I extracted the modified SPI driver logic into a separate compilation unit and replaced all hardware/RTEMS dependencies with mocks (SPI registers, GPIO, and HAL functions). This allows the code paths to run on the host machine (which is Linux) without requiriing STM32H7 hardware.
The goal of these tests is not just to check compilation, but to validate the specific fixes introduced in this MR. For example:
• The off-by-one fix in CS handling (`i == msg_count - 1`) is verified by checking GPIO assert & deassert counts and final state\
• The `ctx->error` reset fix is tested by injecting a stale error and verifying it no longer propagates incorrectly\
• The NULL pointer guard and alignment checks are validated with targeted edge cases\
• Error propagation from HAL status is explicitly tested
So these tests are designed to exercise the exact logic changes and confirm the corrected behavior.
Note that some of these tests fails with the previous implementation (like.. CS deassertion and stale error handling), and pass after this patch.
Please let me know if you’d prefer a different validation approach or additional testing and thank you again :heart:.
--
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1162#note_148545
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/20260414/74c9a6b2/attachment.htm>
More information about the bugs
mailing list