- 
                Notifications
    
You must be signed in to change notification settings  - Fork 8.2k
 
drivers: add STM32 Quad SPI driver #25806
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
Conversation
Add functions to read Serial Flash Discovery Parameters (SFDP). Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
This commit adds bindings for Quad SPI module (st,stm32-quadspi) and corresponding DTS node for stm32l4 series. Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
Add Quad SPI pin definitions for stm32l4x series SoC. Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
| 
           @arvid-r, @QSQCaito  | 
    
| 
           All checks are passing now. checkpatch (informational only, not a failure)Tip: The bot edits this comment instead of posting a new one, so you can check the comment's history to see earlier messages.  | 
    
Add support for peripherals controlled by AHB3 register, e.g. Quad SPI. Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
This commit adds support for STM32 Quad SPI driver targeting single, dual or quad SPI Flash memories. Signed-off-by: Piotr Mienkowski <piotr.mienkowski@gmail.com>
| 
           Thanks! Interesting. sfdp.h looks like it could be reused by others too, right? Correct me if I'm wrong, but this is a slightly different approach than the current Nordic driver, by using   Or is this case different somehow?  | 
    
          
 Yes, sfdp.h is meant to be used on all platforms. So far, I didn't have a chance to test it on a big-endian system but it's supposed to work there too. There are quite a lot of parameters that can be extracted from SFDP table and this file is going to grow a lot. I've decided to use inline functions that take a dedicated  
 The   | 
    
          
 That's not entirely accurate.   
 Assuming we do move to using SFDP we may be able to reduce the differences in the devicetree descriptions and use  I haven't yet looked at this driver nor the NXP one but I would expect moving to SFDP would allow those to be described compatibly as well. Thanks for kicking this off. It's past time we started widening the support for flash devices in Zephyr.  | 
    
| 
           Ok, makes sense. I think I will try to rework the NXP case then, to use   | 
    
| 
           Will this work with MCUBOOT? It looks for   | 
    
          
 The device tree specification states: While we don't use the value of the compatible property to select the device driver in Zephyr (yet), we shouldn't purposefully violate the specification. That said, in Linux the spi-nor driver is able to handle both SPI and QSPI flash devices and they consistently use   | 
    
| 
           @mnkp, about the issue reported on QSPI mode, can you raise an issue in https://github.com/STMicroelectronics/STM32CubeL4/issues ?  | 
    
          
 Let's move the discussion regarding compatible property to #25958 since the problem is not limited to a single driver.  | 
    
          
 Thanks, I will. However, considering the amount of data QSPI module needs to transfer I reckon that using DMA is the only viable option for this driver. I didn't do it in this first, draft PR version since setting up DMA is more complex. I will try to update the implementation for the non draft PR.  | 
    
| 
           @mnkp FYI I'm looking at adding QSPI support for the SAME51 to control the 2 MiB NOR flash on the ItsyBitsy M4. I did it by forking spi_nor.c as the QSPI peripheral has a very different interface to the Zephyr SPI API. The WIP commits are at a803bd1 and b1743bd I'd much rather not fork though, such as having a common NOR flash library or driver and only having the low level command and address code be SAM0 specific.  | 
    
| 
           Hi, I am trying mx25r6435f via QSPI to run on disco_l475_iot1 board, but i do not see signal acitivty on CS, SO, SI, SCLK. I used the correct pinmux for BSP, any idea about that? };  | 
    
| 
           @mnkp Your branch is working well on our STM32L462VE based custom board with AT25SL641 flash memory,  | 
    
          
 it works with disco_l475_iot1 with single SPI. thanks. but I am not able to write desired data to flash. it writes only '0' with PP flash command. someone has some idea what is wrong with writing.  | 
    
          
 @mnkp When our  branch https://github.com/giansta/zephyr/tree/flash_stm32_qspi_gs was rebased to latest Zephyr master, we needed no more any change to have a running bootloader (thanks to commit 07fd283). So your branch just needs alignment to latest Zephyr (like we did in our commit f4fb6cd) to be merged.  | 
    
| 
           @mnkp Do you have any plans to continue work on this PR?  | 
    
| 
           This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.  | 
    
| 
           Superseded by #30864.  | 
    
This commit adds support for STM32 Quad SPI driver targeting single, dual or quad SPI Flash memories.
The driver is functional, basic tests were performed on a custom board with AT25SL641 flash memory, however in the current state it is still a proof of concept.
New features:
Limitations:
The DTS node describing external flash connected to Quad SPI peripheral is defined as
where
qspi-nor-flash@0is fixed. This should be reworked, however requires further discussion.