cancel
Showing results for 
Search instead for 
Did you mean: 

W25 NOR flash OCTOSPI, memtype Micron - change to work with Winbond

Fededeg
Visitor

I am using a w25q256jvfq ainbond chip and cube mx to setup octospi1 on the stm32h723vgt6. However after the HAL_OSPI_INIT and HAL_OSPIM_Config commands, what other commands and settings should I write to make it match the characteristics of the w25 winbond chip?

Thank you

3 REPLIES 3

Probably use SR2.QE to enable 4-pin mode

And also switch to type 4-byte addressing as part is larger than 16MByte

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

okay so since the chip i have ends with a Q in the name it should mean that QE = 1 (fixed) in Status register-2. Therefore I should only enter 4 byte address mode but nevertheless it still doesn't work. The code is very simple, it's just trying to execute the command to unlock all sectors, but it prints an error. For debugging i print the messages on the lcd of the board as seen from the code. I'll share the files as I have really ran out of ideas on what could be wrong. The problem is that HAL_OSPI_Command returns HAL_ERROR every time. I think the error is either in how i setup the members of the structs in either the init struct or the regularcmdtypedef struct, so the error maybe is in either the octospi init or the w25init, w25swreset (both called at the end of the init function) or the unlockall function in the main code. As a final note i must mention that i am using a library for the w25 in qspi mode which is in the file w25q_mem.c /.h files, i had to basically convert all the qspi names to ospi and adjust some settings as the members in the structs are not exactly the same, but maybe i missed a few. The point is i don't know if i mangaed to "translate" this library to octospi successfully. Unfortunately I wasn't able to find one online that already used octospi in quad spi mode. 

P.S. If I get it working my intent is to then erase write and read data from the chip as external memory.

 

Thank you

for more detal the error code is 16 which sould be as found in the stm32h7xx_hal_ospi.h file 

#define HAL_OSPI_ERROR_INVALID_SEQUENCE ((uint32_t)0x00000010U) /*!< Sequence of the state machine is incorrect */

but i don't know how to fix this