cancel
Showing results for 
Search instead for 
Did you mean: 

F446RE QSPI MemoryMapped

OguzhanBalci
Associate III

I have been trying to run memory mapped mode using qspi (dual mode) with w25q32jv on stm32f446re nucleo board for a long time. I wonder if what I am trying to do is possible or if I am just wasting my time?

1 ACCEPTED SOLUTION

Accepted Solutions

The memcpy() is backward

memcpy(buf, (void *)0x90000000, 50); // from mem to buf

>>When I don't use memory mapped mode, I can write and delete in memory without any problem.

You can't use the two modes concurrently. You will need to Abort out memory-mapped mode to get back to direct/command mode.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

9 REPLIES 9

If you can read the data properly in direct (command) mode, it should work in XIP / memory-mapped mode.

STM32Cube_FW_F4_V1.24.0\Projects\STM32446E_EVAL\Examples\QSPI\QSPI_ExecuteInPlace\Src\main.c

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

HAL_StatusTypeDef w25q32_enable_memory_mapped_mode() {

QSPI_CommandTypeDef cmd;

QSPI_MemoryMappedTypeDef s_mem_mapped_cfg;

cmd.Instruction = W25Q32_DQS_CMD_FAST_READ_DUAL_IO;

cmd.InstructionMode = QSPI_INSTRUCTION_1_LINE;

cmd.Address = 0;

cmd.AddressMode = QSPI_ADDRESS_2_LINES;

cmd.AddressSize = QSPI_ADDRESS_24_BITS;

cmd.AlternateBytes = 0xFF;

cmd.AlternateByteMode = QSPI_ALTERNATE_BYTES_2_LINES;

cmd.AlternateBytesSize = QSPI_ALTERNATE_BYTES_8_BITS;

cmd.DummyCycles = 0;

cmd.DataMode = QSPI_DATA_2_LINES;

cmd.DdrMode = QSPI_DDR_MODE_DISABLE;

cmd.DdrHoldHalfCycle = QSPI_DDR_HHC_ANALOG_DELAY;

cmd.SIOOMode = QSPI_SIOO_INST_ONLY_FIRST_CMD;

s_mem_mapped_cfg.TimeOutActivation = QSPI_TIMEOUT_COUNTER_DISABLE;

s_mem_mapped_cfg.TimeOutPeriod = 0;

return HAL_QSPI_MemoryMapped(&hqspi, &cmd, &s_mem_mapped_cfg);

}

Do you think there is an error here?

I'd clear the local/auto variables to ensure consistent operation.

Does this Read command function properly and read the right data when you use it directly? Validate that first.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

When I don't use memory mapped mode, I can write and delete in memory without any problem.


_legacyfs_online_stmicro_images_0693W00000biBGQQA2.png

memcpy not work.

I just realized that I am using memcpy wrong

The memcpy() is backward

memcpy(buf, (void *)0x90000000, 50); // from mem to buf

>>When I don't use memory mapped mode, I can write and delete in memory without any problem.

You can't use the two modes concurrently. You will need to Abort out memory-mapped mode to get back to direct/command mode.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Thanks for help.