-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Rp2040 add support for additional flash chips #6552
Rp2040 add support for additional flash chips #6552
Conversation
I assume there is no way to detect this automatically? |
@Sineos, yes and no. Yes, because most flash chips have a manufacturer and device id. No, because you'd have to query the chip somehow to get that info. Not impossible, but not exactly possible without loading a firmware into the controller. So a chicken and an egg situation.
|
Also, this issue of flash chips seem to have come up previously on discussion about other supported boards. |
Thanks. I'm not sure this change is needed though. If one selects "low-level options" and selects a "Flash chip" of "GENERIC_03H with CLKDIV 4" then Klipper should work with just about any flash chip. The first thing Klipper does on the rp2040 is copy flash to ram, and then it never accesses flash again. So, although "GENERIC_03H" is not particularly fast, it should have no noticeable impact on Klipper. -Kevin |
Updated the Kconfig file to point to the right dependency file for Generic_03h padded checksum file Signed-off-by: H Keni (info@amken.us)
@KevinOConnor , appreciate you for looking into this.
While Klipper effectively minimizes flash access post-boot by copying necessary data into RAM, the initial boot process can be substantially slower under the 'GENERIC_03H with CLKDIV 4' setting. This impacts scenarios requiring quick reboots or updates, where a faster flash initialization could enhance the overall system responsiveness and reduce downtime. The "GENERIC_03H with CLKDIV 4" setting, while conservative and broadly compatible, may lead to slower boot times due to its lower data transfer rates. This can be significant in environments where quick restarts or updates are frequent. I have experienced this in my board bringups using W25Q128JVSIQ, W25Q32JVSSIQ and W25Q64JVSSIQ. When the generic driver is used, the behavior is erratic and not consistent. I tried to run diagnostics with a logic analyzer, but i wasn't able to get reproducible results. In some cases I had to set PICO_XOSC_STARTUP_DELAY_MULTIPLIER to 64 to get the board to even boot into Bootsel mode. Even then flashing of a u2f proved to be erratic.
With these, I hope I have been able to articulate why we need a better implementation than Generic_03h. I am sure that there are better ways to do what I am trying to do with this PR. We can iterate and make this better. |
Closing as I feel that my implementation is not the best. Will reopen when I have a better solution. |
Why needed: We, Amken LLC (www.amken.us) are about to release a new series of Klipper compatible 3d printer control boards and extruder boards which use the rp2040 with winbond w25 flash in 4MB and 16MB flash chips. The current flash chips options on w25q080 caused issues in booting of our boards.
Implementation: Using pico-boot2-generator, checksummed .s files were generated for Winbond 1,2,4,8,and 16MB flash chips. Other vendor chips are also supported in this tool. Only the most commonly used Winbond and ISIS chips were selected. Can add more if required.
Single Compilation Step: direct compilation of the source file into an object file (stage2.o)
Dependencies: It relies on a single source file located at lib/rp2040/boot_stage2/boot2/$(STAGE2_FILE) as its dependency.
Includes: Precompiled checksumed files for popular Winbond w25 series of flash chips (including the one on pico)
Output: Generates a single output file, stage2.o, directly from the compilation process.
Tested: On custom boards with 1MB, 4Mb and 16MB chips from Winbond. Also tested on Pico.