Hello.
I'd like to split an external QSPI flash chip so that part of the memory is accessible as raw blocks, and the other part holds a filesystem such as fatfs. Essentially I'd need to combine the nRF5 SDK examples peripheral/qspi and peripheral/usbd_msc. Also the raw block access would need to hold the lowest addresses starting from zero.
Slightly longer version:
I have a device that uses a QSPI flash for storing some data. The data is stored as raw bytes starting at address zero. The code is based on the qspi example, so quite simple. This part is working, and I have devices already out with customers, so I'd like to leave it as it is.
Now for a different feature it would be really helpful if I could also have a small filesystem. I don't want to start moving all the existing data, so the filesystem would occupy a part of the flash starting at some nonzero address.
Looking at the two Nordic examples, it seems to me that this could be doable with fairly limited changes. For low power operation I need to uninit the QSPI anyway, so re-initializing it between these two uses seems fairly straightforward. My simple raw access routines essentially only need to know that a write or read has completed, so modifying the event handlers to pass this info to the correct caller also seems simple.
What is keeping me from trying all this right now is that I can't see an easy way to specify in the usbd_msc example that I'd like the flash start address to be nonzero. My current plan is to go to the lowest level: the block device geometry settings (nrf_block_dev_geometry_t) and add an offset there. I would need to modify a number of places where clearly a start address of zero is assumed.
Before I start down this path I'd like to ask if this seems reasonable. Or if I should do this in some another way. I do realize that moving my existing data would get me around the start address issue, but I really would like to leave that part as it is.