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

Waveshare RP2040-Zero board addition #2596

Open
wants to merge 35 commits into
base: main
Choose a base branch
from

Conversation

miketronic
Copy link

Board/Shield Check-list

  • This board/shield is tested working on real hardware
  • Definitions follow the general style of other shields/boards upstream (Reference)
  • .zmk.yml metadata file added
  • Proper Copyright + License headers added to applicable files (Generally, we stick to "The ZMK Contributors" for copyrights to help avoid churn when files get edited)
  • General consistent formatting of DeviceTree files
  • N/A Keymaps do not use deprecated key defines (Check using the upgrader tool)
  • N/A &pro_micro used in favor of &pro_micro_d/a if applicable
  • N/A If split, no name added for the right/peripheral half
  • Kconfig.defconfig file correctly wraps all configuration in conditional on the shield symbol
  • N/A .conf file has optional extra features commented out
  • Keyboard/PCB is part of a shipped group buy or is generally available in stock to purchase (OSH/personal projects without general availability should create a zmk-config repo instead) -- board is available from many sources.

This PR takes off from where glebsexy left off. I attempted to make all changes that Pete mentioned in the comments of that PR (1871).

@Nick-Munnich
Copy link
Contributor

Are the outer pins of the zero footprint-compatible with the xiaos? Could you define an interconnect and GPIO nexuses for the zero?

I would also say that this is a board worth attempting to upstream to Zephyr, since waveshare already has some boards defined there.

@miketronic
Copy link
Author

Are the outer pins of the zero footprint-compatible with the xiaos? Could you define an interconnect and GPIO nexuses for the zero?

I would also say that this is a board worth attempting to upstream to Zephyr, since waveshare already has some boards defined there.

The Xiao is even smaller, shorter by two pins on both sides and none of the pins opposite the USB port that the Zero has.

@Nick-Munnich
Copy link
Contributor

The Xiao is even smaller, shorter by two pins on both sides and none of the pins opposite the USB port that the Zero has.

My question is more, if you have a keyboard designed for the Xiao RP2040, could you use the Zero with it or would the width/spacing not match up

@Nick-Munnich
Copy link
Contributor

As a consequence of them being compatible I think a xiao_d gpio nexus node should be added so that the zero can be used in place of the xiao on xiao shields.

@miketronic miketronic closed this Nov 1, 2024
@miketronic miketronic deleted the rp2040zero branch November 1, 2024 14:29
@miketronic miketronic reopened this Nov 1, 2024
@miketronic
Copy link
Author

Deleted the old branch and renamed the new one.

@miketronic
Copy link
Author

miketronic commented Nov 1, 2024

As a consequence of them being compatible I think a xiao_d gpio nexus node should be added so that the zero can be used in place of the xiao on xiao shields.

Looking deeper, unfortunately they are not pin compatible unless you very specifically designed the shield with a cutout in the middle for the internals and USB connector, essentially having a "U" of the connecting pins. 5v/GND/3v3 are on opposite sides of the board for both of the MCUs. You would need to flip the Zero over and have the guts through the cutout to make it work with a Xiao designed shield, or standing off with spacers, but then the boot/reset would be covered.



zero_header: connector {
compatible = "raspberrypi,pico-header";
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a compatible that should only be used if this matches the physical layout of a Pi Pico board, which the Zero does not. You'll need a new compatible bindings file for this.

Comment on lines +157 to +162
// &vreg {
// regulator-always-on;
// regulator-allowed-modes = <REGULATOR_RPI_PICO_MODE_NORMAL>;
// };

// zero_spi: &spi0 {};
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove these instead of leaving commented out.

Comment on lines +14 to +20
# enable uart driver
CONFIG_SERIAL=y
CONFIG_UART_INTERRUPT_DRIVEN=y

# enable console
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
Copy link
Contributor

Choose a reason for hiding this comment

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

These defaults are what Zephyr recommends for their "stock board setup" but doesn't match ZMK's standards. Remove these please:

Suggested change
# enable uart driver
CONFIG_SERIAL=y
CONFIG_UART_INTERRUPT_DRIVEN=y
# enable console
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y

CONFIG_USE_DT_CODE_PARTITION=y

# Output UF2 by default, native bootloader supports it.
CONFIG_BUILD_OUTPUT_UF2=y
Copy link
Contributor

Choose a reason for hiding this comment

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

Should add lines to enable settings, flash, flash NVS, etc. by default, so we can store various settings, e.g. RGB state or studio keymaps.

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