Skip to content
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

machine/rp2350: add flash support for rp2350 #4803

Open
wants to merge 10 commits into
base: dev
Choose a base branch
from

Conversation

mikesmitty
Copy link

Hi all, this still needs a bit of cleanup and I haven't had the chance to properly test it on hardware, but it builds cleanly. Figured I'd push it up to see if any big changes need to happen before I give it a final polish.

Fixes #4799

@mikesmitty mikesmitty marked this pull request as ready for review March 13, 2025 13:46
@mikesmitty
Copy link
Author

Ok, I had a chance to test the console functions in https://github.com/tinygo-org/tinyfs/blob/release/examples/console/littlefs/machine/main.go and it seems to be working as far as I can tell, but I've not used tinyfs before

@mikesmitty mikesmitty force-pushed the ms/rp2350-flash-port branch from ec9f977 to 432b01d Compare March 14, 2025 03:26
@mikesmitty mikesmitty requested a review from eliasnaur March 14, 2025 12:27
@eliasnaur
Copy link
Contributor

I'm not the right reviewer for the details of the flash interface. Perhaps @deadprogram who authored the other implementation.

@mikesmitty
Copy link
Author

Sounds good. It's mostly just copy/paste from pico-sdk with the RISC-V and RP2040-specific macro branches trimmed out and I grouped everything by source file with a header comment so it should hopefully be relatively straightforward to cross-reference. The only real changes I made were to mimic the conversion of flash_range_program()/flash_range_erase() to flash_range_write()/flash_erase_blocks() that was done in machine_rp2040_rom.go and to ditch the enum flash_devinfo_get_cs_size() used as a return value in favor of a uint8_t. It's only used once and only to check against the zero value from 4 register bits. I left that bit in even though it's only used for checking if a PSRAM chip exists to make it easier to add support for it down the road, but I can trim it out if that makes more sense

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