Black Lives Matter - Action and Equality. ... Adafruit is open and shipping.
0

Metro M4 QSPI Flash Memory Address?
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Metro M4 QSPI Flash Memory Address?

by Adafruit_UMjT7KxnxP8YN8 on Sat Mar 30, 2019 1:08 pm

Microchip's SAM-D5x/E5x Family Datasheet says in 37. QSPI - Quad Serial Peripheral Interface:

"The QSPI allows the system to execute code directly from a serial Flash memory (XIP) without code
shadowing to SRAM. The serial Flash memory mapping is seen in the system as other memories (ROM,
SRAM, DRAM, embedded Flash memories, etc.,)."

Can the QSPI flash on the Metro M4 be read in the processor address space like any other flash memory? If so, to what address range is it mapped?

Adafruit_UMjT7KxnxP8YN8
 
Posts: 137
Joined: Tue Jul 17, 2018 1:28 pm

Re: Metro M4 QSPI Flash Memory Address?

by danhalbert on Sat Mar 30, 2019 1:19 pm

If QSPI peripheral is set up in the right mode, yes, it's in the address space. We do this in CircuitPython, though not to execute code (just to read). See Figure 8-1 in the SAMD51 datasheet.
Selection_075.png
Selection_075.png (43.73 KiB) Viewed 134 times

danhalbert
 
Posts: 2035
Joined: Tue Aug 08, 2017 12:37 pm

Re: Metro M4 QSPI Flash Memory Address?

by Adafruit_UMjT7KxnxP8YN8 on Sat Mar 30, 2019 2:41 pm

If data is stored there, does that make it accessible via the USB port when booting?

Adafruit_UMjT7KxnxP8YN8
 
Posts: 137
Joined: Tue Jul 17, 2018 1:28 pm

Re: Metro M4 QSPI Flash Memory Address?

by danhalbert on Sat Mar 30, 2019 3:12 pm

No, the bootloader doesn't store into QSPI, and random binary data stored in QSPI is not accessible via USB. There has to be an onboard program that talks USB and reads/writes to the QSPI. In CircuitPython the QSPI chip is used as CIRCUITPY. For Arduino we have a raw access library: https://github.com/adafruit/Adafruit_QSPI.

danhalbert
 
Posts: 2035
Joined: Tue Aug 08, 2017 12:37 pm

Please be positive and constructive with your questions and comments.