Check the status register of SPI Whether Write Protect Bit enabled.
First please make sure that the SPI flash is being written. This can be done by using the USBFlash prog example in the SDK to write some bytes in the Flash, next read and verify that it got written in the flash.
Next, please check FLash datasheet and confirm that the following instruction set matches:
Read data: 03h with 3-byte addressing
Read Status register: 05h
Write Enable: 06h
Write data (Page Program): 02h
Sector Erase: D8h