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

cross mob
Anonymous
Not applicable

Hi there,

We are looking to store error logging information for the runtime duration of our device. Previously in psoc 4, the user was given the option to modify SFLASH (http://www.cypress.com/file/206621/download​). Is the option still available for psoc 6? We couldn't find any code examples or writings on this for psoc 6, only for psoc 4. If there is a more suitable option for this in psoc 6, we are also open to other suggestions and recommendations.

Best,

Steve

0 Likes
1 Solution

Steve,

SFLASH is programmable similar to Flash. You can use the Cy_Flash_WriteRow or EraseRow/ProgramRow APIs for the purpose. There are 3 rows in SFLASH that is available for user data - 0x16000800, 0x16000A00 and 0x16000C00 (total 512 x 3 = 1536 bytes).

In addition, if you want PSoC Creator (or rather programmer) to place certain data in SFLASH user row, then you can use the "CY_SECTION(".cy_sflash_user_data")". I would recommend using this, as this is much cleaner and manageable for future devices.

Let me know if you have any further questions.

Regards,

Meenakshi Sundaram R

View solution in original post

7 Replies
MeenakshiR_71
Employee
Employee
100 likes received 50 likes received 25 likes received

Steve,

There is a user row in SFLASH  that is available for the user to store his info. But in PSoC 6, I would recommend using the Emulated EEPROM area (32 KB of flash) for this purpose. Please see CE195313 for details.

Regards,

Meenakshi Sundaram R

0 Likes
Anonymous
Not applicable

Hi msur,

Is there documentation on how to program SFLASH in psoc6? We are leaning towards using the Emulated EEPROM as suggested but want to make sure that doing so is the best choice for us. Thank you.

Best,

Steve

0 Likes

Steve,

SFLASH is programmable similar to Flash. You can use the Cy_Flash_WriteRow or EraseRow/ProgramRow APIs for the purpose. There are 3 rows in SFLASH that is available for user data - 0x16000800, 0x16000A00 and 0x16000C00 (total 512 x 3 = 1536 bytes).

In addition, if you want PSoC Creator (or rather programmer) to place certain data in SFLASH user row, then you can use the "CY_SECTION(".cy_sflash_user_data")". I would recommend using this, as this is much cleaner and manageable for future devices.

Let me know if you have any further questions.

Regards,

Meenakshi Sundaram R

Anonymous
Not applicable

Hi msur,

Could you expand on how to use the CY_SECTION(".cy_sflash_user_data")? We have tried searching the project for a reference but have only found other CY_SECTION references like CY_SECTION(".cy_ramfunc").

Best,

Steve

0 Likes

Steve,

You can refer to CE195313 for the usage of CY_SECTION("..."). In that CE, system defines data array(Em_EEPROM.c) in section .cy_em_eeprom for two cores respectively with same initial values. For sflash, it is similar. You need define the required space in .sflash_user_data manually using CY_SECTION("..."). Note be sure the initial value in section .sflash_user_data for two cores are identical. Otherwise the project building may fail.

msur,

I'm looking at the SFlash_Type struct in cyip_sflash.h, and the rows identified as free for users are 0x16000A00, 0x16000C00,and 0x16000E00. Row 0x16000800 is reserved for the BLE Device Address.

When using a non-ble PSoC 6, can row 0x16000800 (or any other BLE/Crypto related space) in SFlash be written to safely?

Jason

0 Likes
Anonymous
Not applicable

Yes, 0x16000800 SFLASH row can be used when not using BLE.

0 Likes