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

feat: Tweaks for reduced nanopb stack usage. #2505

Merged

Conversation

petejohanson
Copy link
Contributor

Worked on some tweaks to reduce our stack usage for our RPC stack, in particular with some tweaks to nanopb that bring it's stack size usage down.

See zmkfirmware/nanopb@bf32817 for the change to nanopb (which we now have a fork of) and the small changes to Zephyr that I'll merge into our fork when we're happy.

With this change, on USB on stm32f072, I can drop the RPC stack size to 2048 and have enough wiggle room to space (normal usage seems to go up to 1700 bytes or so).

Needs more testing, but the nanopb code changes are fairly innocuous.

@petejohanson petejohanson added enhancement New feature or request studio ZMK Studio (runtime keymaps) labels Sep 26, 2024
@petejohanson petejohanson self-assigned this Sep 26, 2024
@petejohanson petejohanson requested a review from a team as a code owner September 26, 2024 06:19
@joelspadin
Copy link
Collaborator

Do you intend to try to upstream the nanopb changes or just keep maintaining a fork of it?

@petejohanson
Copy link
Contributor Author

Do you intend to try to upstream the nanopb changes or just keep maintaining a fork of it?

Here's my attempt: nanopb/nanopb#1016

@petejohanson petejohanson force-pushed the studio/move-to-optimized-nanopb branch from 7acd597 to 1797de8 Compare October 10, 2024 16:22
@petejohanson
Copy link
Contributor Author

Ok, need to do this in mulpitle phases:

  • Move ZMK to the new nanopb
  • Add tweak to our Zephyr branch to add new Kconfig symbol for setting the new nanopb define.
  • Follow up ZMK PR to imply the new Kconfig symbol.

@petejohanson petejohanson merged commit 78513af into zmkfirmware:main Oct 10, 2024
22 checks passed
lammai pushed a commit to lammai/zmk that referenced this pull request Oct 27, 2024
EnotionZ pushed a commit to EnotionZ/zmk that referenced this pull request Nov 6, 2024
earwin pushed a commit to earwin/zmk that referenced this pull request Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request studio ZMK Studio (runtime keymaps)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants