2023-04-16 02:21 PM
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?
Solved! Go to Solution.
2023-04-16 03:45 PM
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.
2023-04-16 02:57 PM
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
2023-04-16 03:08 PM
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?
2023-04-16 03:17 PM
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.
2023-04-16 03:30 PM
When I don't use memory mapped mode, I can write and delete in memory without any problem.
2023-04-16 03:40 PM - edited 2023-11-20 08:01 AM
2023-04-16 03:40 PM
memcpy not work.
2023-04-16 03:43 PM
I just realized that I am using memcpy wrong
2023-04-16 03:45 PM
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.
2023-04-17 05:17 AM
Thanks for help.