cancel
Showing results for 
Search instead for 
Did you mean: 

Reading from external Flash with QSPI not working.

KMaen
Associate III

I am working with STM32F&508-DISCO, which is said to have external Flash of size 16MB connected through QSPI. I am trying to read from it, but it is not working.

I tried running this: https://github.com/STMicroelectronics/STM32CubeF7/blob/master/Projects/STM32F7508-DISCO/Examples/QSPI/QSPI_ReadWrite_IT/Src/main.c

With the code as it is, it works fine. However, it is reading from address = 0, which is not the external Flash connected through QSPI (I wonder why is the example like that? Isn't address 0 internal Flash and not through QSPI?).

Anyway, I wanted to access external Flash which I think is located at 0x9000_0000 (I couldn't find the memory address in the user guide, so I just googled it).

However, when I simply change the above code from address = 0 to address = 0x9000_0000, it simply does not work.

I also tried with BSP libraries, but the result is the same.

Is there an external Flash at 0x9000_0000 for my board? If so, what additional steps do I have to take to make it work?

Also, I am super confused; why is all the example for QSPI accessing memory region 0x0 or 0x50? Isn't that internal Flash? Is internal flash also going through QSPI?

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
Andreas Bolsch
Lead II

The referenced code does indirect reads/writes, for the these the address written to QSPI_AR is actually the address *offset*, i.e. the difference of target address minus flash start. Hence in the range 0x00000000 to 0x01000000 - 1, sent as is to the flash (the external flash doesn't know anything else).

What you're looking for is probably (read-only) memory mapped mode where the external flash appears within the processor's memory map at 0x90000000. For that no special code is required, just write the appropriate communication parameters to QSPI registers. Then the flash is readable like any internal memory.

View solution in original post

1 REPLY 1
Andreas Bolsch
Lead II

The referenced code does indirect reads/writes, for the these the address written to QSPI_AR is actually the address *offset*, i.e. the difference of target address minus flash start. Hence in the range 0x00000000 to 0x01000000 - 1, sent as is to the flash (the external flash doesn't know anything else).

What you're looking for is probably (read-only) memory mapped mode where the external flash appears within the processor's memory map at 0x90000000. For that no special code is required, just write the appropriate communication parameters to QSPI registers. Then the flash is readable like any internal memory.