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

Add rp2040 zero #1871

Closed
wants to merge 5 commits into from
Closed

Add rp2040 zero #1871

wants to merge 5 commits into from

Conversation

glebsexy
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)

Copy link
Contributor

@petejohanson petejohanson left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! A few items that need addressing. Also check out the pre-commit check failure for issues there.

chosen {
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &uart0;
Copy link
Contributor

Choose a reason for hiding this comment

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

For boards added to ZMK directly, we usually set the console to be the CDC ACM node added to the usb node. See https://github.com/zmkfirmware/zmk/blob/main/app/boards/arm/nice_nano/nice_nano.dtsi#L64 for an example node.


&uart1 {
current-speed = <115200>;
status = "okay";
Copy link
Contributor

Choose a reason for hiding this comment

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

For ZMK boards, don't enable the UART, SPI, etc by default. This is a bit different from the upstream Zephyr board approach.

@@ -0,0 +1,12 @@
identifier: waveshare_rp2040_zero
Copy link
Contributor

Choose a reason for hiding this comment

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

This .zmk.yml file format is not the same as the Zephyr format. See existing ZMK boards for examples of the metadata we use.

@petejohanson petejohanson self-assigned this Jul 17, 2023
@petejohanson petejohanson added enhancement New feature or request board PRs and issues related to boards. labels Jul 17, 2023
CONFIG_SOC_RP2040=y
CONFIG_BOARD_WAVESHARE_RP2040_ZERO=y

CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=240000000
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=240000000
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=125000000

I had to fix this in our other boards recently, they had the wrong sys clock frequency set.

@xudongzheng
Copy link
Contributor

@petejohanson I noticed that ZMK's Zephyr fork has quite a few custom RP2040 boards defined there https://github.com/zmkfirmware/zephyr/tree/v3.2.0%2Bzmk-fixes/boards/arm. Is there a rule of thumb for which boards should go in upstream Zephyr, the ZMK Zephyr fork, vs the ZMK boards directory?

@petejohanson
Copy link
Contributor

@petejohanson I noticed that ZMK's Zephyr fork has quite a few custom RP2040 boards defined there https://github.com/zmkfirmware/zephyr/tree/v3.2.0%2Bzmk-fixes/boards/arm. Is there a rule of thumb for which boards should go in upstream Zephyr, the ZMK Zephyr fork, vs the ZMK boards directory?

Anything that I'd like to upstream, given time, I try to put in our Zephyr fork. That usually means anything more popular/general purpose.

The Zero is theoretically generic enough we could choose to put there as well.

@petejohanson
Copy link
Contributor

Closing due to inactivity. Feel free to reopen whenever you're back to this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
board PRs and issues related to boards. enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants