EmbDev.net

Forum: µC & Digital Electronics CH552 flash writes maximum number far greater than 200


von Bert V. (Company: CruzPro Ltd.) (bertp)


Attached files:

Rate this post
useful
not useful
The CH552 documentation states that the CH552 flash memory can be 
reprogrammed a minimum of "about 200 times under 5V power supply".

I wrote a simple program to write to the same CH552 flash rom location 
multiple times till a failure occurred and logged the data.  The results 
are attached.

13232 18670 0239 0238
13234 38159 0223 0222
13236 52735 0000 0255
13238 02088 0041 0040
13240 22591 0095 0094
13242 39344 0034 0033
13244 52930 0010 0009
13246 53457 0071 0070
13248 06893 0238 0237
13250 16494 0111 0110
13252 24287 0160 0159

The format of the data is:
xxxxx yyyyy aaaa bbbb where xxxxx is the flash memory location, yyyyy is 
how many times the write was successful before a read error occurred, 
aaaa is the data that was written to the flash memory location and bbbb 
was the value that was read back from that location.

Basically I found that you can write to the same location more than 2000 
times before an error occurred.

Regards,

Bert

von Marc X. (marc_x)


Rate this post
useful
not useful
Tests like this are not very expressive, 200 write cycles are the 
specified amount of write cycles, where the manufacturer specified data 
retention time should be valid if programmed according the 
specification.

Additionally a single fail during data verification doesn‘t mean the 
memory cell is defective, it is also possible that something went wrong 
during programming.

: Edited by User
von Thomas Z. (usbman)


Rate this post
useful
not useful
Your test ignores that flash writing is a 16 bit operation and therefore 
allways 16 bit are written on even addresses. So its more likely the 
flash may fail earlier especially when writing 0xFFFF and 0x0000.

Note that flashing a app with wchisptool allways eats 2 cycles because 
for security reasons some cells have to be erased to enable the flash 
programming.
This erase is part fo the bootloader and more serious since v2.31

https://www.wch.c n/bbs/thread-83327-1.html

: Edited by User
von Bert V. (Company: CruzPro Ltd.) (bertp)


Rate this post
useful
not useful
I'm using flash memory as a large non volatile storage space for 
variables.

The main CH552 application software will only get programmed a few times 
but when using the application some variables need to be stored when the 
user changes them.  There are about 32 bytes that need storing.

Since the internal data flash is limited to 10,000 writes I'm using the 
normal flash storage area instead.  Currently limiting the writes to 256 
per location then moving the start location of the non-volatile flash 
storage.

von Lothar M. (Company: Titel) (lkmiller) (Moderator)


Rate this post
useful
not useful
Bert V. wrote:
> Basically I found that you can write to the same location more than 2000
> times before an error occurred.
Did you do a power-off-power-on cycle after each write?

Bert V. wrote:
> Currently limiting the writes to 256 per location then moving the start
> location of the non-volatile flash storage.
>
> There are about 32 bytes that need storing.
Sounds like you need some simple wear-leveling on the flash cells.

Thomas Z. wrote:
> So its more likely the flash may fail earlier especially when writing
> 0xFFFF and 0x0000.
A "flash erase" is "change all 0 bits to 1". An empty flash has all bits 
set to 1. So the flash will fail much faster, when writing 0 to it, 
because then the silicon insulation barrier will be stressed in both 
ways always: first by deleting to 1, then by changing the bits to 0. 
There is no stress to the falsh when writing 0xffff to an empty cell.

von Thomas Z. (usbman)


Rate this post
useful
not useful
Lothar M. wrote:
> A "flash erase" is "change all 0 bits to 1"
> ...
I know that. CH552 flash is not the usual flash. The cells dont need any 
erase cycle. You can simply write 0xFFFF (or any other value) even when 
all bits are clear. Other controller from WCH have 64 bytes pages then 
empty is all zero programmed all óne.

: Edited by User
Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.