But I think it's reasonable to assume that even on a 10c Chinese chip the specs aren't completely made up and 500 or 1000 rewrites is not going to be the limit when they claim 10000.
As DavidAlfa said, they claim 100k cycles, but, they only specify the retention for 20 years after 10k cycles. I said retention and not "data retention" because acording to the datasheet, they guarantee "date retention", whatever that means.

Besides that, i believed it was reasonable to trust on the ADC accuracy, and then i found that the 4 LSBs out of 12 are very noisy (no matter how much sample time or ADC clock speed), almost random. Thanks god that i don't need high speed so i can oversample and extract the 4 remaining bits or even more bits by aggressive low pass filtering.
Run the experiment and write the flash until it wears out.
I thought of it, but as some stated, it's not how many times a flash section can be erased, but how long will hold the new programmed data. I would test if 10k cycles is enought, by doing one cycle every 10 seconds in order to let some settling time, then i would know if 10k cycles are reached by waiting a week or so. Anyhow, this wouldn't be a serious test, as you know. Anyway this is not a life supporting device, although i don't want the user to get a bricked thing if the flash eventually fails retaining user data.
Now if very frequent writes are expected, using an external EEPROM or FRAM may be warranted
Not the case, having the settings stored in memory is more of a convenience rather than a need. Many users won't deviate so much from the default configuration. In fact, i programmed almost all features before thinking of this issue. Some users will replace the standard sensor with a non standard one, or one from a different application, or just want to fine tune the sensing range, then having customized parameters is a good thing.
I don't know about the 002B variant, the 002A datasheet guarantees 100K cycles.
I'm planning to go to the IOT world congress next month (from 13th to 15th in Barcelona). If you aim to go there aswell, we can meet and i'll swap a tube with you by a coffee. That's at least 10 "PY32F002B" chips

(i've got SOT16 and SOT14 variants for replacing old PIC16 projects), and, speaking of Barcelona, easily 20 chips

Edit: Stopped the test at 1.3M cycles... No issues.
Some time ago i read in hackaday about a guy that did such a test with a PIC that claimed to guarantee about 100k cycles, the test reached about 5 Million before the IC failed... Of course more of a curiosity than a workbench test.
Puya's main products are flash and eeprom
I don't worry too much about their flash endurance.
I know, that is one point towards the "trust the datasheet" consideration. However i don't forget 25 years back when the Microchip's PIC16F84A failed programming after no more than 50 cycles but they guaranteed a minimun of 1000 cycles.
But be careful if settings can be adjusted through some interface (uart, modbus, IoT, whatever). Then, even if you thought it's just a "setting" and not "operating parameter", some user will find it useful as real-time operating parameter and write it once a second automatically.
Very good advice. I was just casting the relevant structs to a RAM buffer, then format the buffer and save it to flash (then, when reading, casting some pointers back to the flash to compare the current parameters with the stored ones). In my code there is a function that compares the RAM buffer with what is stored in flash, and if they are different after the user leaves the main menu, then such buffer is programmed, but then i save an erase/program cycle if the function returns that both buffers have the same content... After i read you i recalled that some parameters within the structs are not changed by the user but by the operating conditions (ADC, Timers...), so the function was returning always "different content" unnecessarily. I changed that to just look up the user settings. Thanks.
I have been thinking about it for some days, and i finally found a nice solution. I call it "Let the user having the responsibility of managing the case in which the flash may fail be a product feature". Let me show:
Currently, the params buffer that is stored in flash begins with the header "0xdeadbeef" and ends with a computed CRC (excluding the header) because... well, because the CRC hardware comes free with this device. I can add a menu feature to let the user select the "Working profile", and let have 5 profiles, the first of them in the user OTP area (0x1FFF0280) and the rest at the end of the main memory (0x08005E00, 0x08005E80, 0x08005F00, 0x08005F80). I should test it, but i think i can change to zero an already programmed page. Then I can mark a non-selected profile with the header "0xdead0000". The time the device boots up, a function would search for valid profiles (those that pass the CRC check), then see if the active profile is within them and use it, or if there is no active profiles within the good ones, let the user select one of them before starting, report the last profile used as corrupted and encourage the user to not use it anymore.
As a curiosity, when talking about the information area of the PY32F002B, the area across 0x1FFF0200 to 0x1FFF027F, according to the reference manual/datasheet, is reserved. But if you dump from 0x1FFF0200 instead of 0x1FFF0280, you get this...
