From your previous replies I can figure out that the 4QOR (6Ch) command is working fine without errors.
For the Single SPI READ (13h) command, I would like to point out that this command DOES NOT need any dummy cycles. In your previous reply you have mentioned that you have provided 8 dummy bytes(should be dummy cycles, I am assuming it is a typing mistake). You might be losing the first byte of data while providing the 8 dummy cycles, which is then leading to your code reading the first byte of the next page.
Hi ApurvaS_36, but I'm not PeSt_3919641.
You need to get Peter to show his program code.
You need to find out the full name of the used external memory, as well as the full name of the microcontroller chip. From these clarifications, program requirements may change.
For example: it is impossible to rewrite a small part of the external memory data - if the sector size of the external memory is larger than the size of the internal RAM of the MK. A complete rewrite is possible, with the loss of old data. This imposes restrictions on working with external memory as an active data storage device. In this case, it does not make sense to create program recording functions. Here you need an external hardware programmer.
My program code is working. I provided it as a template. For use with another ST microprocessor, a number of parameters need to be changed. The qspi peripheral block will have similar settings, but the rest of the environment may change slightly.
However, the very procedure for using commands when working with external memory will be useful for Peter as a template.
But I'm not sure that Peter saw the link.