Skip to content
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

ospi: driver is more restrictive than necessary #77

Open
sageve opened this issue Oct 31, 2024 · 1 comment
Open

ospi: driver is more restrictive than necessary #77

sageve opened this issue Oct 31, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request hal HAL-LL driver-related issue or pull-request. xspi XSPI-related (QSPI, OSPI, HSPI) issue or pull-request.

Comments

@sageve
Copy link

sageve commented Oct 31, 2024

According to my tests the the OSPI supports not only instruction phase only, but also data phase only. However, the HAL driver does not allow this configuration.

I guess that the focus at the OSPI was on flash devices, where a single data phase is not intended, But there are other use cases.

I kindly ask for allowing single data phase instead of throwing an error. This won't break any software, but allows a broader usage of the OSPI. I am aware that this is an undocumented feature.

I can submit a pull request if you agree.

https://github.com/STMicroelectronics/stm32h7xx-hal-driver/blob/6f5e35e30ac09ba7bf44139a97b289d3df53cf9c/Src/stm32h7xx_hal_ospi.c#L3076C1-L3079C1

+      if (cmd->DataMode != HAL_OSPI_DATA_NONE)
+      {
+        /* ---- Command with data ---- */
+
+        /* Configure the CCR register with all communication parameters */
+        MODIFY_REG((*ccr_reg), (OCTOSPI_CCR_DMODE  | OCTOSPI_CCR_DDTR),
+                   (cmd->DataMode | cmd->DataDtrMode));
+      }
+      else
+      {
+        /* ---- invalid command configuration (no instruction, no address, no data) ---- */
+
+        status = HAL_ERROR;
+        hospi->ErrorCode = HAL_OSPI_ERROR_INVALID_PARAM;
+      }
+      /* MODIFIED */
+
       /* ---- Invalid command configuration (no instruction, no address) ---- */
-      status = HAL_ERROR;
-      hospi->ErrorCode = HAL_OSPI_ERROR_INVALID_PARAM;
@KRASTM KRASTM self-assigned this Nov 1, 2024
@KRASTM KRASTM added enhancement New feature or request xspi XSPI-related (QSPI, OSPI, HSPI) issue or pull-request. labels Nov 1, 2024
@KRASTM
Copy link
Contributor

KRASTM commented Nov 1, 2024

Hello @sageve,

Thank you for the report.

As you said and according to the RM0468, for single phase command, the only case supported is instruction phase Any of these phases can be configured to be skipped but, in case of single-phase command, the only use case supported is instruction-phase-only.

However, I will share your proposal with our team in order to confirm it, and I will keep you informed.

With regards,

@ALABSTM ALABSTM moved this from To do to Analyzed in stm32cube-mcu-hal-dashboard Nov 4, 2024
@ALABSTM ALABSTM added the hal HAL-LL driver-related issue or pull-request. label Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hal HAL-LL driver-related issue or pull-request. xspi XSPI-related (QSPI, OSPI, HSPI) issue or pull-request.
Projects
Development

No branches or pull requests

3 participants