Q-Code User Manual
Ver. 7.0 2021/11/30
180
2. This command is applicable to the SPI Flash of N25Q series; the instruction is 0x20.
3. This command will automatically set WEL bit to 1, users do not need to execute SPI_WREN
command additionally.
4. Depending on the number of the erased sector, erasing may take tens of milliseconds to
seconds. All commands are invalid during erasing process except SPI_RDSR command.
5. After the erasing is completed, the “SPI_EraseEnd” path is automatically executed. User
will know the SPI_EraseEnd completing time through this path to perform subsequent
actions.
Ex.
SPI_SE(0x4321, 3)
; Erase the data in address 0x4000~0x6FFF of SPI Flash through SPI1.
R0=0x2, R1=0x1, SPI_SE(R1:R0, 2, SPI2)
; Erase the data in address 0x12000~0x13FFF of SPI Flash through SPI2.
Erase: X0=0x23, R2=0x1, SPI_SE(R2:X0, SPI1), R3=1
SPI_EraseEnd: R3=0
; Erase the data in address 0x123000~0x123FFF of SPI Flash through SPI1. When the erase is in
progress, set R3 as 1. When the erase is completed, set R3 as 0.
4.9.10 SPI_BE(Addr, Count, SPIGroup)
Transmit Block Erase command to SPI Flash and erase block(s). The size of a block is 64KB. Users
can specify the amount of block to be erased once.
The system will not enter sleep mode when the erase action is executing. After the erasing is
completed, the “SPI_EraseEnd” path will be automatically executed. User can read the WIP bit (bit0)
status of the status register by using the SPI_RDSR command. When the erase is in progress, the
WIP bit is 1; when the erase is completed, the WIP bit is 0.
Addr
:
Specify the address to be erased which can be an immediate value or specified by variable. The
size of a block is 64KB. When using immediate value addressing, user needs to fill in the 24-bit
address, but Bit[15: 0] is invalid. When using variable addressing, user only needs to fill in the
valid bit Bit[23:16].
Count:
The amount of block to be erased, the range is from 1 to 16; default is 1 if omitted.
SPIGroup:
Select the corresponding SPI channel.
NY6 does not support SPIGroup parameter.
NY7 supports SPI1 or SPI2; default is SPI1 if omitted.
Note:
1. NY4 / NY5 / NY5+ / NY6A / NY9T / NX1 do not support this command.
2. This command is applicable to the SPI Flash of N25Q series, the instruction is 0xD8.
3. This command will automatically set WEL bit to 1, users do not need to execute SPI_WREN
command additionally.