cancel
Showing results for 
Search instead for 
Did you mean: 

Hello , i want to use QSPI MEMORY(MT25Q128) with STM32L476RE MCU Later, I tried to storage data to above FLASH in Single-SPI MODE(EXTENDED SPI) and That's work is good BUT I hope to storage data USING QUAD-SPI MODE so, tried to below steps

WJung.1
Associate

I don't use Interrupt and STM32CUBEIDE HAL LIBRARY

1. SEND ENTER QUAD IO MODE COMMAND(0x35)

-> 2. SEND WRITE ENHANCED VOLATILE RESISTER COMMAND(0x65)

-> 3. Transmit data 0x7f (This register MSB bit set LOW) because ENABLE QUAD MODE

-> 4. SEND WIRTE ENABLE COMMAND and TRNASMIT DATA

-> 5. TRNASMIT DATA USE QUAD INPUT FAST PROGRAM COMMAND (0x32)

below is my code anyone please help me thank you

i guess write any resister command or function is error thank for reading

ps. If i write resister data , how to use below function

MODIFY_REG(reg, 0xF0, (DUMMY_CLOCK_CYCLES_READ_QUAD << POSITION_VAL(0xF0)));

EX) I want to write resister data 0x7f how to use above function

1 REPLY 1
Andreas Bolsch
Lead II

Not sure but I think you'me mixing up different operation modes:

1) normal SPI mode: all instructions on single line, 0x03/0x02 read and program with data on single line. But 0x32 program uses four data lines for the data only, instruction and address still with one line.

2) Clearing bit 7 in Enhanced Vol. Conf. reg. *immediately* switches to QPI mode, in this mode *ALL* instructions, addresses and data use 4 lines, even the 0x03/0x02 commands. No need to send "Enter QPI mode".

I'd suggest to use RDID and MIORDID to check that flash and QSPI interface use compatible modes after each of your steps. There is a pitfall however: If the flash receives RDID 0x9F while in QPI mode, it switches back to SPI mode. Apparently an undocumented feature ... So, if you expect the flash to be in SPI mode, use 0x9F, and 0xAF otherwise.