Skip to content

Conversation

@mikesmitty
Copy link
Contributor

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
Contributor 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
Contributor 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

@deadprogram
Copy link
Member

Thank you for working on this @mikesmitty and to @eliasnaur for review.

I tested on real hardware, working exactly as expected. Now squash/merging. Thanks again!

@deadprogram deadprogram merged commit 4768c7d into tinygo-org:dev Mar 16, 2025
18 checks passed
@mikesmitty mikesmitty deleted the ms/rp2350-flash-port branch March 16, 2025 14:40
@mikesmitty
Copy link
Contributor Author

Thanks!

deadprogram pushed a commit that referenced this pull request Aug 16, 2025
* machine/rp2350: add flash support for rp2350
* combine duplicate files
* clean things up and group by source file
* add stubbed out xip cache clean func if needed in the future
* update flash_enable_xip_via_boot2
* remove unused macros and fix inconsistent formatting
* make flash size configurable like rp2040
* add missing flash size configs
* retain big Go CGo compatibility per #4103
* clarify CS0_SIZE source and remove single-use typedef
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