1 of 1 people found this helpful
We usually recommend to store the data in APP DCT for this type of use-case. As you need to store a large amount of data, you can investigate the staging area concept for sflash. sflash related details for WICED SDK can be found at SFLASH support addition in WICED
Thank you. I did run across that thread. Are there any further details or examples of the function calls that would be made to write/read free sectors of the sflash device?
Here is an update: I did examine further the very informative file \waf\sflash_write\sflash_write.c I was able to use its examples to decipher the following:
1. First, initialize the sflash for writing (sflash_handle is declared in the header file "spi_flash.h")
init_sflash( &sflash_handle, 0, SFLASH_WRITE_ALLOWED)
2. The functions to read, sector erase and write to sflash are as follows.
sflash_read(&sflash_handle, addr_start, buffer, num_bytes_read);
sflash_write(&sflash_handle, addr_start, buffer, num_bytes_write)
The other missing piece was the answer to "what sectors are avail"? The file /platforms/CYW943907AEVAL1F/ota2_image_defines.mk provides a bit of background.
I see that just before 0x600000, some sectors may be unused. For the bit of memory I need, 0x580000 to 0x600000 works just fine. However, it won't work very well if the linker ends-up plunking down some data in that space.
Question: Is there a way to block the linker from putting anything in a specific range (say 0x580000 to 0x600000)? My forte is definitely not linkers. If anyone knows, it would be greatly appreciated!