STM32 QSPI Flash memory mapped mode #77875
Replies: 3 comments 6 replies
-
@FRASTM ^^ |
Beta Was this translation helpful? Give feedback.
-
@RIPHeisenberg if you want to implement memory mapped mode, you can have a look at this sample https://github.com/zephyrproject-rtos/zephyr/tree/main/samples/application_development/code_relocation_nocopy I have already used this sample with a nucleo_h745zi_q and an external flash memory and it worked like a charm. The only think you would keep in mind is the linker needed for the flash memory. I dont know if it is implemented for your board. |
Beta Was this translation helpful? Give feedback.
-
The stm32 qspi driver cannot write or erase in memory mapped mode. Only reading is possible (memcopy). With the spi_flash sample, setting memory mapped and aborting memory mapped mode can disturb the access to the quad-spi flash. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone,
I am currently trying to use the QSPI Flash API of the STM32H747I_DISCOVERY_M7 chip.
Zephyr version 3.7 LTS
Board STM32H747I_DISCOVERY_M7
What I have tried so far:
KCONFIG:
CONFIG_STDOUT_CONSOLE=y
CONFIG_FLASH=y
CONFIG_SPI=y
CONFIG_GPIO=y
CONFIG_FLASH=y
CONFIG_FLASH_STM32_QSPI=y
CONFIG_STM32_MEMMAP=y
CONFIG_PRINTK=y
CONFIG_SHELL=y
CONFIG_LOG=y
CONFIG_FLASH=y
CONFIG_FLASH_SHELL=y
CONFIG_FLASH_SHELL_TEST_COMMANDS=y
Device Tree:
quadspi: quadspi@52005000 {
compatible = "st,stm32-qspi";
#address-cells = < 0x1 >;
#size-cells = < 0x0 >;
reg = < 0x52005000 0x34 >;
interrupts = < 0x5c 0x0 >;
clocks = < &rcc 0xd4 0x4000 >;
status = "okay";
pinctrl-0 = < &quadspi_clk_pb2 &quadspi_bk1_ncs_pg6 &quadspi_bk1_io0_pd11 &quadspi_bk1_io1_pf9
&quadspi_bk1_io2_pf7 &quadspi_bk1_io3_pf6 &quadspi_bk2_io0_ph2 &quadspi_bk2_io1_ph3 &quadspi_bk2_io2_pg9 &quadspi_bk2_io3_pg14 >;
pinctrl-names = "default";
dual-flash;
mt25ql512ab1: qspi-nor-flash-1@90000000 {
compatible = "st,stm32-qspi-nor";
reg = < 0x90000000 0x4000000 >;
qspi-max-frequency = < 0x44aa200 >;
spi-bus-width = < 0x4 >;
status = "okay";
partitions {
compatible = "fixed-partitions";
#address-cells = < 0x1 >;
#size-cells = < 0x1 >;
slot0_partition: partition@0 {
reg = < 0x0 0x200000 >;
label = "image-0";
};
};
};
Example: samples/drivers/spi_flash
Following output is generated:
I tried it with region offset 0x990000000 and 0x0.
neither of which worked.
SPI Sector size 4096
Is it possible to use the QSPI flash in Memory mapped mode? What am I missing? Some help is highly appreciated.
Best regards
Maikel Schuurmans Stekhoven
Beta Was this translation helpful? Give feedback.
All reactions