SFlash | Cypress Semiconductor
I would like to use the SFlash of the PRoc 4 BLE to save some information and parameters about my device. I need to save information and parameters in this location because I would like to keep them after a bootstraploader ota.
I found the User_SFlash_Write project in Cypress website but I cannot use it because there is a bug... I read in this document project that the BLE address is saved in the ROW0 in first 6 bytes. If I use the debug and go in the address 0x0FFFF200 of the Flash, all bytes are 0x00. why?
I know there a function "CyBle_GetDeviceAddress(&localAddr)" to obtain the address but I would like to do by myself.
I wrote this code to read the ROW0 of the SFlash:
#define ROW0 0x0FFFF200
uint8 * ptrSFlash;
static uint8 memSFlash;
ptrSFlash = (uint8 *)ROW0;
memSFlash[i] = 0xFF;
memSFlash[i] = *ptrSFlash++;
I received all 0x00, so I decided to read the first row of the Flash (@0x00000000), but It doesn't work because the result isn't the same than I can read in the Flash in Debug state and I don't understand why....
Is there any mistake in my code or my understanding about SFlash?