GD32W51x User Manual
723
22.3.2.
QSPI command format
The QSPI communicates with the Flash memory using commands in various formats. There
are totally 5 phases which can be included or not: instruction, address, alternate byte, dummy
and data. Any of these phases can be configured to be omitted or not, but at least one of the
instructions, address, alternate byte, or data phase must be present, this must be guaranteed
by software, hardware is not designed to provide any protection methods. In addition
,
the
most-significant-bit always occupies the highest IO line number.
Figure 22-2. QSPI command format
SCK
IO_0
CSN
Instruction
Address
Alternate
Dummy
Data
7
6
5
4
3
2
1
0
IO_1
IO_2
IO_3
6
4
5
7
0
1
2
3
4
5
6
7
0
1
2
3
4
5
2
7
3
6
1
0
4
0
2
1
5
6
7
3
Instruction phase
In this phase, the 8-bit instruction, configured in INSTRUCTION field (QSPI_TCFG register)
is sent to the flash memory.
IMOD field (QSPI_TCFG register) defines the instruction phase mode (no instruction, 1-line,
2-lines, or 4-lines).
Address phase
In this phase, 1-4 bytes of address are sent to the flash memory.
In Indirect mode, ADDR field (QSPI_ADDR register) defines the information of address.
ADDRSZ field (QSPI_TCFG register) defines the number of address by te to be sent.
ADDRMOD field (QSPI_TCFG register) defines the address phase mode (no address, 1-line,
2-lines, or 4-lines).
When QSPI FMC mode use and TZEN is set , in this phase QSPI also judges if current indirect
address with CPU secure working status is an accessable transfer.If not qspi will generate an
interrupt and set a transfer error flag.
Alternate-bytes phase
In this phase, 1-4 alternate-bytes are sent to the flash memory.
ALTE field (QSPI_ALTE register) defines the information of alternate bytes , ALTESZ field
(QSPI_TCFG register) defines the number of alternate-bytes to be sent, ALTEMOD field