FLASH data cannot be read as expected using Memory Mapped Mode
I would like to read external FLASH data using Memory Mapped mode, which is a function of OctoSPI.
The environment is as follows.
Use Board : nucleo l4r5zi
IDE : Atollic TrueSTUDIO® for STM32, Built on Eclipse Neon.1a.(Version: 9.3.0)
FLASH : W25Q64JV
Currently, when FLASH data is read using Memory Mapped Mode, some data is unreadable.
Specifically, 0xFF, 0xCC, and 0x88 are read.
I have already confirmed that the data can be read as expected when read in indirection mode.
The procedure is as follows.
1. Set for Memory Mapped Mode
Specifically, the register settings are as follows.

2. Reading FLASH data
The offset from 0x9000_0000 is stored in argv[2], and the program reads 256 bytes of data from that location.
static void flash_mng_cmdt_mem_mapped_read(int argc, char *argv[])
{
uint8_t *base_addr = (uint8_t*)0x90000000;
uint32_t i, j, k;
uint8_t data;
ofst = atoi(argv[2]);
base_addr = base_addr + ofst;
for (i = 0; i < 16; i++) {
for (j = 0; j < 16; j++) {
k = i*16+j;
data = *(base_addr+k);
}
}
}
3. Reading Results
I have implemented a console in my own work, and I can access the flash by executing commands from the console. In the following case, 256 bytes of data are read from 0x9000000 + 0x200 (512). The values up to 0x49 below are as expected, but after that they are 0xFF and not as expected.
command>flash_mng mem_mapped_read 512
==================== read ============================
| 0 1 2 3 4 5 6 7 8 9 A B C D E F
------------------------------------------------------
0x00 | 01 2B 00 2A FB D1 18 1A 01 38 70 47 80 B4 00 AF
0x10 | 03 4B 1B 68 18 46 BD 46 5D F8 04 7B 70 47 00 BF
0x20 | A0 07 04 20 80 B4 00 AF 04 4B DB 68 1B 0A 03 F0
0x30 | 07 03 18 46 BD 46 5D F8 04 7B 70 47 00 ED 00 E0
0x40 | 80 B4 83 B0 00 AF 03 46 39 60 FF FF FF FF FF FF
0x50 | FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
0x60 | FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
0x70 | FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
0x80 | FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
0x90 | FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
0xA0 | FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
0xB0 | FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
0xC0 | FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
0xD0 | FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
0xE0 | FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
0xF0 | FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
When a breakpoint is placed at line 14 of the above program and the program is stopped and executed every time 1 byte is read, the value goes from 0xFF to 0x88.
I assume there is a timing issue based on the above, but please let me know if you know anything.
