Skip to content

add msc internal flash samd example #148

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 12, 2022
Merged

Conversation

hathach
Copy link
Member

@hathach hathach commented Jan 12, 2022

Add MSC example with internal flash example, implement #145 . The example is pretty much the same as External Flash one, except for the Adafruit_InternalFlash declaration instead of Adafruit_SPIFlash. This PR requires

// Start address and size should matches value in the CircuitPython (INTERNAL_FLASH_FILESYSTEM = 1)
// to make it easier to switch between Arduino and CircuitPython
#define INTERNAL_FLASH_FILESYSTEM_START_ADDR  (0x00040000 - 256 - 0 - INTERNAL_FLASH_FILESYSTEM_SIZE)
#define INTERNAL_FLASH_FILESYSTEM_SIZE        (64*1024)

Note: Like SPIFlash, InternalFlash library implement BlockDeviceAPI and reply on SdFat to provide FATFS support. This allow us to have common API with FatFileSystem FatFile object and switching between Internal and External flash easy enough (similar to external flash and SD card). The drawback is SdFat requires SPI object to compile --> we need to fake the SPI interface even though board does not have it.

@TheKitty TheKitty merged commit 1cea18b into master Jan 12, 2022
@TheKitty TheKitty deleted the add-msc-samd-internal-flash branch January 12, 2022 18:09
@ladyada
Copy link
Member

ladyada commented Jan 12, 2022

ncie!

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.

3 participants