STM8S003 flash endurance - Page 1
Forum section: electronics / general

author: HwAoRrDk
author_rank: Super Contributor
timestamp: August 20, 2022, 11:21:43 am
content: I have a project where I plan to use an STM8S003. But, a potential problem with that from a development point of view is the low flash endurance of only 100 (yes, one hundred) writes stated in the datasheet.I am concerned that this is going to be a problem during development - too many re-flashes wearing out the memory. Is this a realistic concern? Am I worrying too much about something that's unlikely to be a problem in reality?Yes, I know the datasheet figure is aminimumguarantee for the specified operating conditions, and it could be greater. But by how much? 101, 1000? Knowing my luck I get a chip that starts corrupting data at only a few dozen writes over the mark.Now, the STM8S103 is essentially an identical pin-compatible drop-in substitute (but with more EEPROM and a unique ID register) that has 100,000 writes flash endurance that I could use for development prototypes, but these are for some reason much harder to find at the moment. Stocks are intermittent and the price is 4x or more of the '003 chips.

author: wek
author_rank: Frequent Contributor
timestamp: August 20, 2022, 12:31:17 pm
content: > Yes, I know the datasheet figure is a minimum guarantee for the specified operating conditions, and it could be greater. But by how much? 101, 1000?Endurance and retention go hand in hand, temperature is their sister and statistics is their mother. The physical reason for ("lack" of) endurance is damage to the memory transistor's oxide through which electrons are "shot" during programming. The consequence is leakage, i.e. the memory cell tends to forget its state. and this gets worse by increasing temperature (exponentially).Note, that the 100 cycle endurance is given for 20 years of retention at 55deg.C. This means roughly that if you subject the mcu to 100 erase/program cycles and then keep it 20 years at 55deg.C, the probability of failure is still low enough so that only a few devices will fail. Note, that these devices are used in products which are sold in millions, and nobody wants to see them starting to return in large volumes within several years.Also note, that the EEPROM in the same chip has quoted 10k cycles endurance for 20y retention, and 100k for 1y retention (the latter even at elevated temperature to 85deg.C).In other words, if you'll keep your device at room temperature and won't require retentions beyond a few days, 1000 cycles is absolutely OK and 10k cycles is probably fine, too.JW

author: HwAoRrDk
author_rank: Super Contributor
timestamp: August 20, 2022, 04:46:39 pm
content: Quote from: wek on August 20, 2022, 12:31:17 pmHmm, true I had kind of overlooked the condition on the 100 cycles was for retention over that period in those conditions. But we're just guessing as to how the failures curve looks for shorter time periods in less harsh conditions. Could be logarithmic, could be linear, we don't know.Quote from: wek on August 20, 2022, 12:31:17 pmSo you think I should not worry about it, and just do development on the '003 and forget about trying to get some '103?

author: wek
author_rank: Frequent Contributor
timestamp: August 20, 2022, 07:10:34 pm
content: > But we're just guessingIndeed. Did you expect ST to chime in with hard data?And guess what: they're guessing, too. Or do you expect them conducting a 20 year experiment? ;-)But it's true that I have no firm data.I once performed anexperiment- with different mcu, different conditions, so completely irrelevant to this case. The nominally 100k endurance EEPROM leaked after cca 8M cycles so badly that it could not hold value until readback after a few us, and heating it up by touching the chip by finger changed the readback value significantly :-) So yes, in that case obviously there wasn't a 2 orders of magnitude reserve.> So you think I should not worry about it, and just do development on the '003 and forget about trying to get some '103?Let's put it in this way: how many times you expect to overwrite the FLASH? How big a program fits into the 'S003? Let's say, a dozen of features, each requiring say a dozen of rewrites; and then another dozen of bugs times a dozen of rewrites? That's 288. I don't think you should be very concerned.Meantime, why not trying to get the 'S103, through moderate means. You need how much, and how expensive that is? Is this the very last project you're going to do with the STM8s?JW

author: Alti
author_rank: Frequent Contributor
timestamp: August 21, 2022, 12:08:25 am
content: I think you should not do a development on a final target, first place. It does not make sense since you need 2x or 3x that much memory to run development firmware with all the checks, buffers and -g optimization.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: August 21, 2022, 10:17:40 am
content: Quote from: HwAoRrDk on August 20, 2022, 04:46:39 pmYou can do bothWhy not have some spare '003 and keep an eye open for flash failures, and if you suspect an issue, swap in a new one to check.Relative to development costs, MCUs prices are in the noise floor.You can also get some '103 on longer lead times, to qualify code on.There are also many vendors offering '003 pinout alternatives, tho if you are coding in ASM porting to those would be more work.

author: wek
author_rank: Frequent Contributor
timestamp: August 21, 2022, 12:15:59 pm
content: Quote from: PCB.Wiz on August 21, 2022, 10:17:40 amCan you please elaborate, perhaps in a new thread?Thanks,JW

author: PCB.Wiz
author_rank: Super Contributor
timestamp: August 21, 2022, 11:00:14 pm
content: Quote from: wek on August 21, 2022, 12:15:59 pmIf you go to LCSC and search for '003' in Microcontrollers, that's now a common suffix for TSSOP20 'pin compatible' parts. (at least VSS and VDD are on pins 7 and 9, often VCAP is another port pin )eg 8051 coresX003N76E003SC9xFx003HC89S003OB38S003W20EPRJM8L003F6P6R 32kF 4kRAM 16bit multiplication and division and 32/16bit division seehttps://www.runjetic.com/product/769.htmlES7P003OB38S003,OB38S013,OB38S023,OB38S033and some parts have less obvious compatible nameseg Nuvoton MS51FB9AEand some are showing with a M0 corePY32F003FAPT32S003F8PTCW32F003x3/x4APM32F003F6P6MM32F003TWAn example table is herehttps://sinomicon.com/about/newsDetail/3

author: wek
author_rank: Frequent Contributor
timestamp: August 22, 2022, 06:40:42 am
content: Thanks. Didn't occur to me that the STM8 may be *that* popular to define a defacto standard... Good to know that there is at least one solid brand replacement among the Chinese smaller-village-made stuff.Sorry for hijacking the thread, this is over.JW