Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
spwr_4322411
Level 1
Level 1

Using PSoC 4200 BLE.  I Would like to store a few bytes in SFLASH and read them.  I'm using the Cypress provided function CySysSFlashWriteUserRow(.., ...) function to write to SFLASH.  However it's unclear how to read from SFLASH.  I believe I would access the memory directly by reading the contents at the SFLASH user defined row address.  I'm struggling to find the SFLASH address for the user defined rows.  Any help &/or code example is appreciated.  An example for reading from SFLASH would be most beneficial as I'm able to write just fine to SFLASH. 

Thanks,

Spencer

0 Likes
1 Solution
GeonaP_26
Moderator
Moderator
Moderator
250 solutions authored 100 solutions authored 50 solutions authored

User can directly read the SFlash user address space to access the content. For SFlash user space base address, please use CY_SFLASH_USERBASE or CYREG_SFLASH_MACRO_0_FREE_SFLASH0. The SFlash macro 1 address are provided in Table 1-1 of Programming Specifications.

View solution in original post

0 Likes
2 Replies
spwr_4322411
Level 1
Level 1

After writing to flash, I was able to read directly from SFLASH by using the following code.  I will leave this open for comment and for others to find answers when searching for same issue.

uint32 s_flash_read = 0;

s_flash_read = (uint32)(*(reg8*)CYREG_SFLASH_MACRO_0_FREE_SFLASH0);

0 Likes
GeonaP_26
Moderator
Moderator
Moderator
250 solutions authored 100 solutions authored 50 solutions authored

User can directly read the SFlash user address space to access the content. For SFlash user space base address, please use CY_SFLASH_USERBASE or CYREG_SFLASH_MACRO_0_FREE_SFLASH0. The SFlash macro 1 address are provided in Table 1-1 of Programming Specifications.

0 Likes