File system - PW-Sat2/PWSat2OBC GitHub Wiki
OBC needs to store some data in non-volatile memory (e.g. internal state, HK, experiment results, etc.). To fulfill that need, YAFFS file system with external flash memories (N25Q, 16MB NOR flash) is used.
Parameters:
- Memory size: 16MB
- Chunk size: 512KB
- Erasure unit (block mapping): sector, 64KB
- Erase time: 0.8 - 3 seconds
- Minimal number of sector erases: 100 000
Bad block management
There are three possible solutions to bad block management:
- No bad block management at all
- Store bad block flag for each sector in first block
- Emulate out-of-band in each sector
Solution 3. adds a lot of complexity to data management Solution 2. is very sensitive to errors in that first block
Taking into considerations minimal number of erase cycles and it's duration we decided to skip bad block management - YAFFS will detect failed writes and look for another sector to use. It will add measurable delay to writes but it simplifies data management a lot while providing working solution