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

RP2040 emulated EEPROM. #17519

Merged
merged 5 commits into from
Jul 2, 2022
Merged

RP2040 emulated EEPROM. #17519

merged 5 commits into from
Jul 2, 2022

Conversation

tzarc
Copy link
Member

@tzarc tzarc commented Jun 30, 2022

Description

As it says on the title.
Docs forthcoming.

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout/userspace (addition or update)
  • Documentation

Checklist

  • My code follows the code style of this project: C, Python
  • I have read the PR Checklist document and have made the appropriate changes.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@tzarc tzarc requested review from KarlK90 and a team June 30, 2022 22:21
@github-actions github-actions bot added the core label Jun 30, 2022
@KarlK90
Copy link
Member

KarlK90 commented Jul 1, 2022

Having the EEPROM emulation so fast after the RP2040 merge to develop is really awesome! Thanks for your hard work 🎉 I have tested the code and it works fine on a regular RPI Pico, Sparkfun RP2040, Elite-pi and Splinky boards - all with different QSPI flash chips.

Reading through the code I noticed some opportunities for clean-up and improvements that are due to the fact that we know the exact use-cases for the flashing code before hand. I'm not sure how much time the bulk write saves but attaching and detaching the whole qspi flash for a single 16bit write seems a bit excessive. I have attached my findings as patch file as a suggestion how I would solve it.

rp2040_wear_level.patch.txt

@tzarc
Copy link
Member Author

tzarc commented Jul 1, 2022

@KarlK90 -- added, tweaked to do bulk actual read/write operations instead of piecemeal. Seems to work fine.

Copy link
Member

@KarlK90 KarlK90 left a comment

Choose a reason for hiding this comment

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

I have tested the changes with all the boards that I have at hand and it works just fine. When testing it with the wear leveling "test keyboard" the scan rate improved from 9k to 11k, that is nice! Should rp2040_flash be added to the wear leveling docs? Otherwise this is good to go in from my side.


// Define how much flash space we have (defaults to lib/pico-sdk/src/boards/include/boards/***)
#ifndef WEAR_LEVELING_RP2040_FLASH_SIZE
# define WEAR_LEVELING_RP2040_FLASH_SIZE (PICO_FLASH_SIZE_BYTES)
Copy link
Member

Choose a reason for hiding this comment

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

I guess we should revisit this once we have the information in the QMK repository.

Copy link
Member

@KarlK90 KarlK90 left a comment

Choose a reason for hiding this comment

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

Nice, LGTM

@tzarc tzarc merged commit 5846b40 into qmk:develop Jul 2, 2022
@tzarc tzarc deleted the wl_rp2040 branch July 2, 2022 05:18
@0xcharly
Copy link
Contributor

0xcharly commented Jul 2, 2022

A quick test on the Splinky (RP2040-based board, https://github.com/plut0nium/0xB2), and I can confirm that Via now works out of the box.

Thanks for the continuous efforts to support RP2040! 🙏

0xcharly pushed a commit to Bastardkb/bastardkb-qmk that referenced this pull request Jul 4, 2022
@myst729
Copy link
Contributor

myst729 commented Oct 10, 2022

A quick test on the Splinky (RP2040-based board, https://github.com/plut0nium/0xB2), and I can confirm that Via now works out of the box.

Thanks for the continuous efforts to support RP2040! 🙏

@0xcharly Could you share your sample code? I can build the firmware successfully now but VIA doesn't work with it.

@0xcharly
Copy link
Contributor

@0xcharly Could you share your sample code? I can build the firmware successfully now but VIA doesn't work with it.

You can have a look at any of the bastardkb/**/splinky. You still need to side load the descriptor file (JSON) first for it to work.

@myst729
Copy link
Contributor

myst729 commented Oct 10, 2022

@0xcharly Thanks, it works with VIA v2 now. However, VIA v2 seems buggy, compared with v1.

nolanseaton pushed a commit to nolanseaton/qmk_firmware that referenced this pull request Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants