Skip to content

Samd51 mm flash #6289

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 5 commits into from
Apr 18, 2022
Merged

Samd51 mm flash #6289

merged 5 commits into from
Apr 18, 2022

Conversation

stonehippo
Copy link

This is a fix for #5590. The Sparkfun SAMD51 MicroMod has an external flash module that requires two pins to be pulled HIGH before the module is fully enabled.

This update adds a hook that allows for board.c to include a method external_flash_setup(), which get called before the flash filesystem is init'ed (which happens before board_init()). It also implements this method for the Sparkfun SAMD51 MicroMod so that the flash chip works and CIRCUITPY can be set up and mounted correctly.

This only works with the latest version 1.3 of this MicroMod board (the previous version 1.2 has a design flaw that prevents hardware SPI from working with the external flash chip).

@stonehippo
Copy link
Author

I removed the compiler flag and switched to using an MP_WEAK implementation, based on a suggestion from @dhalbert. I think this is ready for a review once the checks have passed.

@stonehippo
Copy link
Author

Hmm, check failed, but looking at it, the issue was related to getting a dependency for the fomu (there was a certificate error). Doesn't seem to have anything to do with the PR itself, just bad timing.

What's the best way to get the checks run again?

dhalbert
dhalbert previously approved these changes Apr 18, 2022
Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great! Thanks for fixing and add the new setup mechanism.

@stonehippo
Copy link
Author

Thanks, @dhalbert. I just rebased on latest main and pushed to rerun the checks. Hopefully everything passes and this can get merged in.

Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing I realized: could you move the MP_WEAK function to supervisor/shared/external_flash/external_flash.c? And add a declaration in supervisor/shared/external_flash/external_flash.h? That makes it more like the other MP_WEAK uses.

@stonehippo
Copy link
Author

Ah, good call! I'll do just that.

@stonehippo stonehippo requested a review from dhalbert April 18, 2022 14:10
@stonehippo
Copy link
Author

Huh, that broke the RP2040 builds. I guess I need to figure that out.

Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this!

@dhalbert dhalbert merged commit 6425e93 into adafruit:main Apr 18, 2022
@stonehippo stonehippo deleted the samd51_mm_flash branch April 19, 2022 11:23
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