Did you write 0x02?
As JEDEC defined, WEN bit can't be written by the host.
Please try other bits like BP0.
There is a function called sflash_write() that does what you need.
For the 2.4.x SDK it can be found here: Wiced/Platform/common/drivers/spi_flash/spi_flash.c
We've recognized that it isn't easy to find and so we have moved this functionality into the libraries for the 3.0 SDK.
The snip.spi_flash_read app is actually quite misleading, and I raised an action to fix it.
The best way in WICED to access SPI flash is to use the dedicated spi_flash driver.
This is located in the following directory:
You can see the API for the driver in spi_flash.h
To add the sflash driver to your project, you should be able to just add the following to your app makefile:
$(NAME)_COMPONENTS += common/drivers/spi_flash
Then include "spi_flash.h" in your C file.
For an example of using the SPI flash driver, please have a look at Apps/waf/sflash_write/sflash_write.c which is an app that allows us to relay data over JTAG so that it can be stored in the serial flash.
Thanks for your reply.
Is it possible to use full 2MB serial spi flash for data storage.?
Yes, it is fairly easy to redefine sizes etc for the SPI flash storage to allow that.