Skip to content

Add support for SpiNorFlash and FS#30

Merged
NeroBurner merged 5 commits intomainfrom
add-support-for-spinorflash-and-filesystem
May 15, 2022
Merged

Add support for SpiNorFlash and FS#30
NeroBurner merged 5 commits intomainfrom
add-support-for-spinorflash-and-filesystem

Conversation

@JF002
Copy link
Copy Markdown
Contributor

@JF002 JF002 commented May 12, 2022

The SpiNorFlash is implemented as a 4MB file on the local filesystem. This allows the FS and settings to work properly.

I've also created this PR to experiment with resource loading from the SPI flash and hopefully find the best way to implement it in InfiniTime :)

After creating this branch, I noticed that another implementation of the FS layer have already been integrated. I feel like the one from this PR is closer to the real hardware, as it uses LittleFS and a file of the same size as the actual external memory of the PineTime, but I'm ok if you want to keep the current implementation ;-)

@JF002 JF002 force-pushed the add-support-for-spinorflash-and-filesystem branch from 08617d4 to 5406909 Compare May 12, 2022 18:24
@JF002 JF002 changed the title Add suppot for SpiNorFlash and FS Add support for SpiNorFlash and FS May 12, 2022
JF002 and others added 4 commits May 15, 2022 21:20
The external SPI flash is implemented as a 4MB on the local filesystem.
This allows the FS (littleFS) and settings to work properly.
If by any chance the `char` type on a platform is implemented with more
than one byte the `reinterpret_cast<char *>(buffer)` would change the
meaning of the `size` parameter, which could lead to garbage data.
@NeroBurner NeroBurner force-pushed the add-support-for-spinorflash-and-filesystem branch from 5f2c6cf to cbf32e8 Compare May 15, 2022 19:46
@NeroBurner
Copy link
Copy Markdown
Collaborator

Looking really good. Rebased, added a check that sizeof(uint8_t)==sizeof(char) (just to be sure) and added a destructor to close the std::fstream memoryFile introduced in SpiNorFlash.h

@NeroBurner NeroBurner merged commit 644431c into main May 15, 2022
@NeroBurner NeroBurner deleted the add-support-for-spinorflash-and-filesystem branch May 15, 2022 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants