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 support for Nucleo WB55CG board & Zephirum shield #938

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

Conversation

cdc-mkb
Copy link

@cdc-mkb cdc-mkb commented Sep 12, 2021

Hello ZMK maintainers!

Could you please merge these two commits? See committed README.md files or http://zephirum.tuxfamily.org/ for details.

Support for Nucleo WB55CG board is based on the initial work made by Pete Johanson; I updated it for Zephyr OS v2.5.

Thanks in advance,
Cedric.

@dxmh dxmh added board PRs and issues related to boards. enhancement New feature or request shields PRs and issues related to shields labels Sep 23, 2021
@petejohanson
Copy link
Contributor

Thank you, contributor, for your patience with how long review and merge of boards/shields has taken!

There are three recent refactors/changes to boards and shields that require some attention, and then we can finally get this PR merged!

  1. Hardware Metadata
  2. Pro Micro shield DT naming changes
  3. Split changes for BLE advertising

Hardware Metadata

The Problem

When first developing the process around contributing new shields/boards to ZMK, we failed to recognize that several key files (setup scripts, documentation page of supported hardware, and GH Action build.yml file) required changes, often in the same spot, for every PR. This resulted in immediate merge conflicts for every other PR after one was merged, which is a headache for contributors.

The Fix

By adding discrete metadata files that are located with the boards/shields in question, and using that metadata to generate setup scripts, website hardware list, etc., users can contributing new hardware descriptions without the need to change the same files that other contributors are changing.

Next Steps

First, refer to https://zmk.dev/docs/development/hardware-metadata-files to familiarize yourself with the new metadata file format.

Next, you have two options for fixing up your PR:

  1. If comfortable with git rebase, perform an interactive rebase and revert any changes to build.yml, hardware.md, or the setup scripts setup.sh/setup.ps1, and then add the new metadata YAML file. Then force push your branch. Or,
  2. Create a new branch from an up-to-date main, copy in the files for your new hardware, add the metadata file, then commit and push the new branch. Then, edit your open PR to point to your new branch.

Pro Micro shield DT naming changes

In #876, we have simplified the DT naming for the "nexus node" we expose for pro-micro compatible boards, deprecating the use of pro_micro_a, and renaming pro_micro_d node to simply pro_micro. For pro-micro boards and shields, you'll need to adjust your DT to use the proper names.

Please see https://zmk.dev/docs/development/new-shield#shield-overlays for the updated docs on this.

Split Shield Advertising Changes

In addition, if this is a split PR, please see #658 where we have changed our conventions to remove the the name from the right sides, to prevent users attempting to pair with them and causing split sync issues. This also includes removing the " Left" suffix from the naming on the left side. See the changes in that PR for examples of what to change with your split shield.

Getting Help

If you have any questions about any of these changes, please comment here and tag @zmkfirmware/boards-shields or ask in the #boards-shields Discord channel.

@cdc-mkb
Copy link
Author

cdc-mkb commented Oct 5, 2021

This pull request has been updated.

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
  • General consistent formatting of DeviceTree files
  • Keymaps do not use deprecated key defines (Check using the upgrader tool)
  • &pro_micro used in favor of &pro_micro_d/a if applicable (not applicable)
  • If split, no name added for the right/peripheral half (not applicable)
  • .conf file has optional extra features commented out

@cdc-mkb
Copy link
Author

cdc-mkb commented Oct 23, 2021

Rebased onto github.com/zmkfirmware/zmk.git:main + Stick to "The ZMK Contributors" for copyrights.

@cdc-mkb cdc-mkb force-pushed the upstream branch 2 times, most recently from 8a3fde8 to 66c71ec Compare November 21, 2021 10:15
@cdc-mkb
Copy link
Author

cdc-mkb commented Nov 21, 2021

Rebased onto github.com/zmkfirmware/zmk.git:main

@cdc-mkb cdc-mkb force-pushed the upstream branch 2 times, most recently from 3ab860d to 57d479d Compare November 22, 2021 07:47
Copy link
Contributor

@lesshonor lesshonor left a comment

Choose a reason for hiding this comment

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

Good luck with updating this for a more recent version of ZMK+Zephyr. You'll also want to substitute the tabs with four spaces. Installing and running pre-commit should handle this and any other reformatting.
...A minor note, but your website also appears to be down. Maybe you want to update the URLs listed here.

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think it's appropriate to put shield-specific information in this readme when the board could be used by other shields.

Most "generic" boards don't have READMEs, so you could probably just omit this.

Copy link
Contributor

Choose a reason for hiding this comment

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

Per the Zephyr 3.0.0 changelog:

STM32 clock_control driver configuration was moved from Kconfig to devicetree. See the st,stm32-rcc devicetree binding for more information. As a consequence, [the] following Kconfig symbols were removed:

  • CONFIG_CLOCK_STM32_SYSCLK_SRC_HSE
  • CONFIG_CLOCK_STM32_APB1_PRESCALER
  • CONFIG_CLOCK_STM32_APB2_PRESCALER
  • CONFIG_CLOCK_STM32_CPU1_PRESCALER
  • CONFIG_CLOCK_STM32_CPU2_PRESCALER
  • CONFIG_CLOCK_STM32_AHB4_PRESCALER

config BOARD
default "nucleo_wb55cg_dongle"

config CLOCK_STM32_LSE
Copy link
Contributor

Choose a reason for hiding this comment

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

This one was nixed in Zephyr 3.0.0 too.

&i2c1 {
status = "okay";
clock-frequency = <I2C_BITRATE_FAST>;
pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>;
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
pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>;
pinctrl-0 = <&i2c1_scl_pb8 &i2c1_sda_pb9>;
pinctrl-names = "default";

Copy link
Contributor

Choose a reason for hiding this comment

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

pinctrl-names is now a required property. As above, this suggestion is applicable to a number of nodes.

...In truth, a chunk of this configuration should probably be pulled out into app/boards/arm/nucleo_wb55cg_dongle/nucleo_wb55cg_dongle.dtsi and #included in this file—in order to leverage the pinctrl system introduced with Zephyr 3.2.

};

&i2c1 {
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.

Suggested change
status = "okay";

Per a suggestion made on another board:

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

I'm only going to make the suggestion in one place, but this applies to a number of nodes.

Comment on lines +24 to +40
config LVGL_HOR_RES_MAX
default 128

config LVGL_VER_RES_MAX
default 32

config LVGL_VDB_SIZE
default 64

config LVGL_DPI
default 148

config LVGL_BITS_PER_PIXEL
default 1

choice LVGL_COLOR_DEPTH
default LVGL_COLOR_DEPTH_1
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 LVGL_HOR_RES_MAX
default 128
config LVGL_VER_RES_MAX
default 32
config LVGL_VDB_SIZE
default 64
config LVGL_DPI
default 148
config LVGL_BITS_PER_PIXEL
default 1
choice LVGL_COLOR_DEPTH
default LVGL_COLOR_DEPTH_1
config LV_Z_VDB_SIZE
default 64
config LV_Z_DPI
default 148
config LV_Z_BITS_PER_PIXEL
default 1
choice LV_COLOR_DEPTH
default LV_COLOR_DEPTH_1

Most of these changes were made as part of the upgrade to Zephyr 3.2, and I suspect setting the maximum horizontal and vertical resolution is not strictly necessary here.

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 shields PRs and issues related to shields
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants