F446RE QSPI MemoryMapped
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-04-16 2: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.
- Labels:
-
QSPI
-
STM32F4 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-04-16 3: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.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-04-16 2: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
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-04-16 3: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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-04-16 3: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.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-04-16 3:30 PM
When I don't use memory mapped mode, I can write and delete in memory without any problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-04-16 3:40 PM - edited ‎2023-11-20 8:01 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-04-16 3:40 PM
memcpy not work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-04-16 3:43 PM
I just realized that I am using memcpy wrong
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-04-16 3: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.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-04-17 5:17 AM
Thanks for help.
