-
Notifications
You must be signed in to change notification settings - Fork 7.4k
STM32: QSPI: Dual Flash mode not always supported #68449
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
Comments
Ok, got it. So the actual issue is that QSPI Dual Flash mode is not supported on L47x/L48x devices, this is why I'm converting this into an issue. |
I put a commit 712aa5a68af6a10d69e3ccfcd50ba6ec833ee05a in my PR #68607 to accept the DualFlash Mode of dual qspi configuration (when the DTS has no ) |
Converting to enhancement. |
The stm32L47x and stm32L48x does NOT support the Dual-flash Mode So we cannot ask for QUADSPI_CR_DFM QUADSPI_CR_FSEL bits for the stm32L476x or stm32L486x |
However we could still add a check on bitfield QUADSPI_CR_FSEL diff --git a/drivers/flash/flash_stm32_qspi.c b/drivers/flash/flash_stm32_qspi.c
index 326c1129a36..6c6ab7fd6cf 100644
--- a/drivers/flash/flash_stm32_qspi.c
+++ b/drivers/flash/flash_stm32_qspi.c
@@ -1283,7 +1283,8 @@ static int flash_stm32_qspi_init(const struct device *dev)
HAL_QSPI_Init(&dev_data->hqspi);
-#if DT_NODE_HAS_PROP(DT_NODELABEL(quadspi), flash_id)
+#if DT_NODE_HAS_PROP(DT_NODELABEL(quadspi), flash_id) && \
+ defined(QUADSPI_CR_FSEL)
uint8_t qspi_flash_id = DT_PROP(DT_NODELABEL(quadspi), flash_id);
HAL_QSPI_SetFlashID(&dev_data->hqspi, |
Discussed in #68423
Originally posted by tt0776 February 1, 2024
Maybe a Q & A for @erwango ?
In advance a apology on the way doing this, I am new in reporting this kind of things.
A the issue text directed me to make a discussion first before continue, this is it :-)
qspi is failing in compile stm32l476xx + stm32l486xx
Reported error is
warning: implicit declaration of function 'HAL_QSPI_SetFlashID'
Is missing define of bits QUADSPI_CR_DFM (also missing QUADSPI_CR_FSEL ..)
Fix is needed to be added after
#define QUADSPI_CR_SSHIFT QUADSPI_CR_SSHIFT_Msk /*!< Sample Shift */
Fix is to place bits missing (Copied from stm32l496xx.h)
That result is tested to work on board stm32l476g_disco
Still having what looks to be a known warning and I see it also when compiling on other ST boards.
Looks to works anyway on my stm32l476g_disco
There is 2.6 QUADSPI errata.
Not sure it is a valide reason for not including bits and the option for getting samples working :-)
Using sample samples/drivers/spi_flash
"stm32l476g_disco.conf" added to "boards" in sample
CONFIG_SPI=n
"stm32l476g_disco.overlay" added to board in sample
The text was updated successfully, but these errors were encountered: