- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am using SFLASH to record user preferences but I would like to erase it when I reprogram.
Is it possible to erase SFLASH memory in each proggraming with Psoc programmer? I am using psoc4.0 .
Solved! Go to Solution.
- Labels:
-
PSoC 4 Architecture
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
The SFLASH does not get automatically erased when you program your device using PSoC Programmer. It is possible to erase SFLASH memory in each programming by using any of the two methods given below:
1) You can make use of the CySysSFlashWriteUserRow() API to write 0 to the desired SFLASH rows at the beginning of each program. This will be same as erasing the SFLASH.
#include <project.h>
uint8 sFlashData[CYDEV_FLS_ROW_SIZE];
int main(void)
{
uint16 i;
for(i=0;i<CYDEV_FLS_ROW_SIZE;i++)
{
sFlashData= 0;
CySysSFlashWriteUserRow(0, sFlashData);
}
for(;;)
{
}
}
This can be done for all the four flash rows.
2) You can also use the SFLASH Update tool which gets downloaded as a part of PSoC Programmer to program the SFLASH.
Regards
Ekta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
The SFLASH does not get automatically erased when you program your device using PSoC Programmer. It is possible to erase SFLASH memory in each programming by using any of the two methods given below:
1) You can make use of the CySysSFlashWriteUserRow() API to write 0 to the desired SFLASH rows at the beginning of each program. This will be same as erasing the SFLASH.
#include <project.h>
uint8 sFlashData[CYDEV_FLS_ROW_SIZE];
int main(void)
{
uint16 i;
for(i=0;i<CYDEV_FLS_ROW_SIZE;i++)
{
sFlashData= 0;
CySysSFlashWriteUserRow(0, sFlashData);
}
for(;;)
{
}
}
This can be done for all the four flash rows.
2) You can also use the SFLASH Update tool which gets downloaded as a part of PSoC Programmer to program the SFLASH.
Regards
Ekta