Saving Data to Flash
Posted: Thu Feb 19, 2015 8:17 am
Hi,
i would like to save data to the flash, so i can have this data even if the power was off.
i tried to use spi_flash_write but i got an error
does anyone know how/if i can do it ?
Thanks
i would like to save data to the flash, so i can have this data even if the power was off.
i tried to use spi_flash_write but i got an error
Code: Select all
char ssid[32] = SSID;
char test[32];
SpiFlashOpResult result = spi_flash_write(0x40200000, (uint32 *)&ssid[0], 4);
os_printf("Write result - %d\n", result); // i get 1
result = spi_flash_read(0x40200000, (uint32 *)&test[0], 4);
os_printf("spi_flash_read - %s", test); // no string...
os_printf(" read result - %d\n", result); // i get 1
does anyone know how/if i can do it ?
Thanks