CH552 flash writes maximum number far greater than 200

OP (Company: CruzPro Ltd.) #7645313
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

Attached files:
#7645315
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.

#7645329
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

OP (Company: CruzPro Ltd.) #7645335
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.

Moderator (Company: Titel) #7645371
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.

Reply

A question of your own? This thread is over 2 years old. Ask it in a thread of its own – more people read along there, and it gets answered more often and sooner.

Start a new thread

A fix, an addition or feedback on this thread? Then reply here.

Formatting
  • [c]C-Code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]
  • [[Title]] – link to an article
  • Link to another post: right-click its post ID (#8078628), copy the address, paste it into the text

More about formatting

Post long source code as an attachment, not in the text.

Already registered? Log in

Not shown to anyone. We send you a link; your post appears once you confirm it there.

By submitting you create a free account and accept the terms of use.