user sflash configuration/settings - PSoC 4100S (CY8C4125LQI-S422)

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

cross mob
FlPi_1580126
Level 1
Level 1

Hi guys,

I'm working on storing config data in user supervisory flash on a 4100S.

I've already implemented user flash config storage in a CYBLE Module based on the sflash_example but I don't get it running on the 4100S MCU.

I copied the WriteUserSFlash.c & .h from my working CYBLE project and changed settings like this:

Block Size: 128

Adress: 0x0FFFF200

Number of Blocks: 4

Write function (from sflash example) returns success, reading sflash addresses returns zeros.

Any ideas what's going wrong here?

Thanks for your help,

Florian

0 Likes
1 Solution
Vison_Zhang
Moderator
Moderator
Moderator
First comment on KBA 750 replies posted 250 sign-ins

You called uint32 CySysSFlashWriteUserRow(uint32 rowNum, const uint8 rowData[]) API to write the SFLASH row, right? If this API returns success, there has no reason the SFLASH ROW is still empty.  Are you sure you read from the correct address?

If you have a Miniprog3, i recommend you run the "PSoC4-BLE-SFLASH-Update.exe" tool locate in path C:\Program Files (x86)\Cypress\Programmer\Examples\Misc\PSoC4-BLE-SFLASH-Update\Executable,  write some bytes into SFLASH of PSOC4100S(this tool can be used for PSOC 4000S/4100S SFLASH update also), then read the SFLASH content out use your own code, if the result still empty, maybe you don't read from correct address i think.

View solution in original post

0 Likes
2 Replies
Vison_Zhang
Moderator
Moderator
Moderator
First comment on KBA 750 replies posted 250 sign-ins

You called uint32 CySysSFlashWriteUserRow(uint32 rowNum, const uint8 rowData[]) API to write the SFLASH row, right? If this API returns success, there has no reason the SFLASH ROW is still empty.  Are you sure you read from the correct address?

If you have a Miniprog3, i recommend you run the "PSoC4-BLE-SFLASH-Update.exe" tool locate in path C:\Program Files (x86)\Cypress\Programmer\Examples\Misc\PSoC4-BLE-SFLASH-Update\Executable,  write some bytes into SFLASH of PSOC4100S(this tool can be used for PSOC 4000S/4100S SFLASH update also), then read the SFLASH content out use your own code, if the result still empty, maybe you don't read from correct address i think.

0 Likes

thanks for the answer, I'll check that out.

Update:

I updated the file WriteUserSFlash.c with the one from the example (not the one from my other project).

Difference: number of bytes written (changed from 0xFF to 0x7F ... of course, 128 Bytes Row Size)

checked addresses (seemed to be ok)

Watched memory blocks in debugger and the rows were updated.

So, seems to work, thanks you for your help.

0 Likes