-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add STM32H5 QSPI Driver #15351
Add STM32H5 QSPI Driver #15351
Conversation
Register addresses are defined. Bit defintions are still needed. Bitmaps for OCTOSPI peripheral register Incremental updates to qspi files Redefined QSPI/OCTOSPI registers for STM32H5 Fixed register definitions for the STM32H5. However, more work still needs to be done. Some bits that shared registers on the STM32H7 have different register locations on the H5. This still needs to be accounted for. Fixed more differences vs STM32H7 qspi Added ifdef for including stm32_dma.h in stm32_qspi.c. Added stm32_qspi.c to Make.defs. Register fixes. SPI activity but not able to format device yet. Fixed DCYC mask Set HCLK frequency to correct value. Undid ccrconfig debug. Tested Interrupt Mode (single SPI). Added alternate bytes to meminfo and cmdinfo structures. Updated Kconfig variables for STM32H5. Fixed base register in hardware/stm32_qspi.h. Updated qspi_dumpregs. The base register was previously set to STM32_QUADSPI_BASE, changed to the correctly named STM32_OCTOSPI1_BASE. However, these defines for the OCTOSPI registers are not even used. Instead qspi_putreg and qspi_getreg utilize the priv->base value to access OCTOSPI registers. Removed altbytes code, left as before. Moved QSPI clock selection to stm32h5xx_rcc.c Changed STM32H5_QUADSPI to STM32H5_QSPI1 Added hook to define QSPI_CLK_FREQUENCY as STM32_QSPI_FREQUENCY from board.h Removed changes to nuttx qspi.h style fixes
[Experimental Bot, please feedback here] The PR mostly meets the NuttX requirements, but needs improvement in providing specific details. Here's a breakdown: Strengths:
Weaknesses and Required Improvements:
Example of Improved Testing Section:
nsh> qspi_test
nsh> qspi_test
By addressing these weaknesses and providing more specific details, the PR will better meet the NuttX requirements and significantly improve its reviewability. Remember, the goal is to make it as easy as possible for reviewers to understand and verify the changes. |
There were two simple errors when running ci tests on pull apache#15351. These errors were unrelated to that pull. After investigating I found two simple errors. 1. The len variable was likely a typo that should have been the function argument, ien. 2. The spinlock_t lock was defined in a section dependent on CONFIG_SERIAL_TERMIOS. However, the spinlock_t lock was used in code that did not require the SERIAL_TERMIOS config. Therefore errors resulted.
There were two simple errors when running ci tests on pull apache#15351. These errors were unrelated to that pull. After investigating I found two simple errors. 1. The len variable was likely a typo that should have been the function argument, ien. 2. The spinlock_t lock was defined in a section dependent on CONFIG_SERIAL_TERMIOS. However, the spinlock_t lock was used in code that did not require the SERIAL_TERMIOS config. Therefore errors resulted. imxrt_edma_s missing lock variable CI build tests noted that the variable g_edma was referencing a lock variable that did not exist in the structure. This change adds that missing lock as a spinlock_t type.
There were two simple errors when running ci tests on pull apache#15351. These errors were unrelated to that pull. After investigating I found two simple errors. 1. The len variable was likely a typo that should have been the function argument, ien. 2. The spinlock_t lock was defined in a section dependent on CONFIG_SERIAL_TERMIOS. However, the spinlock_t lock was used in code that did not require the SERIAL_TERMIOS config. Therefore errors resulted. imxrt_edma_s missing lock variable CI build tests noted that the variable g_edma was referencing a lock variable that did not exist in the structure. This change adds that missing lock as a spinlock_t type. Remove unused flags variable from imxrt_dmach_stop
There were two simple errors when running ci tests on pull apache#15351. These errors were unrelated to that pull. After investigating I found two simple errors. 1. The len variable was likely a typo that should have been the function argument, ien. 2. The spinlock_t lock was defined in a section dependent on CONFIG_SERIAL_TERMIOS. However, the spinlock_t lock was used in code that did not require the SERIAL_TERMIOS config. Therefore errors resulted. imxrt_edma_s missing lock variable CI build tests noted that the variable g_edma was referencing a lock variable that did not exist in the structure. This change adds that missing lock as a spinlock_t type. Remove unused flags variable from imxrt_dmach_stop Removed extra =
There were two simple errors when running ci tests on pull #15351. These errors were unrelated to that pull. After investigating I found two simple errors. 1. The len variable was likely a typo that should have been the function argument, ien. 2. The spinlock_t lock was defined in a section dependent on CONFIG_SERIAL_TERMIOS. However, the spinlock_t lock was used in code that did not require the SERIAL_TERMIOS config. Therefore errors resulted. imxrt_edma_s missing lock variable CI build tests noted that the variable g_edma was referencing a lock variable that did not exist in the structure. This change adds that missing lock as a spinlock_t type. Remove unused flags variable from imxrt_dmach_stop Removed extra =
Summary
This is an implementation of QSPI for the STM32H5, using the OCTOSPI peripheral. The driver is an adaptation of the STM32H7 QSPI driver, with changes made to accommodate differences in the STM32H5 OCTOSPI register set vs the STM32H7 QSPI registers.
Impact
This will only impact the STM32H5 driver and only if QSPI is enabled.
Testing
Testing was completed using the existing w25q driver as well as utilizing the nxffs file system. Additionally, a logic scope was used to verify correct operation of the QSPI interface. Attached are images of measurements taken with the logic scope and a brief functional test utilizing the w25q driver and nxffs.
qspi_func_test.txt