84479569de
This demonstrates how to use external QSPI flash in XIP (execute in place) mode. The default configuration has all extmod/ code placed into external QSPI flash, but other code can easily be put there by modifying the custom f769_qspi.ld script.
21 lines
514 B
C
21 lines
514 B
C
#include "drivers/memory/spiflash.h"
|
|
#include "qspi.h"
|
|
|
|
// This configuration is needed for mboot to be able to write to the external QSPI flash
|
|
|
|
const mp_spiflash_config_t spiflash_config = {
|
|
.bus_kind = MP_SPIFLASH_BUS_QSPI,
|
|
.bus.u_qspi.data = NULL,
|
|
.bus.u_qspi.proto = &qspi_proto,
|
|
.cache = NULL,
|
|
};
|
|
|
|
mp_spiflash_t spiflash_instance;
|
|
|
|
// This init function is needed to memory map the QSPI flash early in the boot process
|
|
|
|
void board_early_init(void) {
|
|
qspi_init();
|
|
qspi_memory_map();
|
|
}
|