Writing and Loading Code from QSPI Flash Memory from RP2040

1.4k Views Asked by At

I bought an RP2040 board with 16MB QSPI Flash Memory in the board:

PINout.png

The Flash Memory w25q128 is connected to QSPI dedicated pins of the RP2040:

SHOT.png

I was finding out how to access this data from the RP2040 datasheet:

Screenshot-1.png

But I didn't find out how to:

  • Initialize XIP memory in rp2040 boot;
  • To flash/access data into the w25q128; and
  • Run instructions from the External Flash Memory.

I was looking for sample codes at GitHub but I didn't find anything useful for these two items I want.

I also found the 2.6.3.1 section of the RP2040 datasheet but I don't know if XIP cache is what I am looking for...

Does someone have done anything related to that? I am a newbie in this subject, so I would like to sorry if I did something wrong.

Thanks in advance!

1

There are 1 best solutions below

0
On

In the datasheet there is an hint that this configuration is done by the SDK automatically if certain conditions are met:

enter image description here

Following the github link we get to the assembly source for the second stage bootloader. This answers the question on how to initialize the memory. It's not done by you (unless you are not using the SDK).

Here are the configuration steps:

enter image description here

enter image description here

SSI stands for Synchronous Serial Interface and it's what has to be configured to use the flash as XIP. It's described in the datasheet:

enter image description here