3 ms·
> It seems strange to me that data-logging flash wouldn't be a dedicated FRU module, instead of being in the same chip(s) as the actual firmware. I see how this
by com2kid 7y ago
> It seems strange to me that data-logging flash wouldn't be a dedicated FRU module, instead of being in the same chip(s) as the actual firmware. I see how this could easily happen as a BOM-reducing or size-reducing measure for something like a cloud thermostat, but for a luxury car?
It is strange no one performed back of the envelope calculations on flash life vs logging size.
I've worked in embedded, we had a time series based rolling log. Flash life calculation was done at regular intervals.
IIRC with what we shipped, the flash chip would outlive the battery by 3x or 4x. And that was without wear leveling!
We were smart enough to continue the rolling log at the last point on flash we uploaded from, avoiding the mistake I've seen some products do of starting over from the very "beginning" after every log sync. Do that and you end up with 10% of your flash worn down to nothing and 90% of your flash going unused.
Also, unless needed, please stop using JSON. Use a binary format instead. Protobufs is trivial to get up and running almost anywhere. Other binary encoding formats may serve a product's needs better. JSON is fine if everything is low bandwidth web services talking now and then, or low friction HTTP APIs, but for other use cases... use something else.
Worst I ever saw was XML being used to RPC invoke every single function call, even local ones. All params got packed up in XML, sent over to the destination, who'd then unpack the XML, execute, and package up the return value. A double digit % of the CPU was being used on XML serialization and de-serialization. (If your choice is that or JSON... probably go with JSON!)
Logging flash being same as storage flash is super weird though. Though if their MCU only supports hanging a single flash chip off of it, I could see it happening.
- catalogia 7y agoEstimating log growth rate is troublesome. It might be easy enough to measure under normal operating conditions, but sometimes something breaks, maybe a sensor goes bad, and all of a sudden you're spamming your logs at 10,000x the normal rate. Assuring yourself that under no circumstance is that possible can sometimes be tricky.
- com2kid 7y ago> maybe a sensor goes bad, and all of a sudden you're spamming your logs at 10,000x the normal rate. Sure, but sensor error reporting frequency should also be documented and calculated somewhere. Embedded requires more planning, this stuff isn't like AWS instances where the worst case is a larger bill. And from the sound of it just general usage is causing problems.
- perl4ever 7y agoIf you have a log for something with an indefinite lifespan, and no maintenance of it possible, and a finite storage medium, why wouldn't you just make it circular? Reminds me of some people's aversion to auto-killing processes when the OS runs out of memory, as though it could ever be better to lock up completely.