Skip to content

Commit

Permalink
refactor: Remove static CDC ACM logging nodes.
Browse files Browse the repository at this point in the history
* To avoid spurious CDC ACM instances when usint CDC ACM for something
  other than logging, move to the approach used by Zephyr of using a
  snippet to redirect console output to a CDC ACM node added by the
  snippet. Remove all the existing static CDC ACM nodes.
* Add new `zmk-usb-logging` snippet that mirrors the upstream
  `cdc-acm-logging` snippet, but still does our extra USB logging
  configuration.
* Updated logging docs accordingly.
  • Loading branch information
petejohanson committed Jun 17, 2024
1 parent 7c09eb2 commit 032068b
Show file tree
Hide file tree
Showing 35 changed files with 45 additions and 200 deletions.
2 changes: 0 additions & 2 deletions app/boards/01space_rp2040_042lcd.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@
* SPDX-License-Identifier: MIT
*/

#include "usb_console.dtsi"

&xiao_serial { status = "disabled"; };
2 changes: 0 additions & 2 deletions app/boards/adafruit_kb2040.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@
* SPDX-License-Identifier: MIT
*/

#include "usb_console.dtsi"

&pro_micro_serial { status = "disabled"; };
2 changes: 0 additions & 2 deletions app/boards/adafruit_qt_py_rp2040.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@
* SPDX-License-Identifier: MIT
*/

#include "usb_console.dtsi"

&xiao_serial { status = "disabled"; };
6 changes: 1 addition & 5 deletions app/boards/arm/adv360pro/adv360pro.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
zephyr,code-partition = &code_partition;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
zmk,kscan = &kscan0;
zmk,backlight = &backlight;
zmk,battery = &vbatt;
Expand Down Expand Up @@ -90,11 +89,8 @@
status = "okay";
};

&usbd {
zephyr_udc0: &usbd {
status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
};
};

&flash0 {
Expand Down
6 changes: 1 addition & 5 deletions app/boards/arm/bdn9/bdn9_rev2.dts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
chosen {
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
zmk,kscan = &kscan;
zmk,underglow = &led_strip;
};
Expand Down Expand Up @@ -106,13 +105,10 @@
apb1-prescaler = <1>;
};

&usb {
zephyr_udc0: &usb {
status = "okay";
pinctrl-0 = <&usb_dm_pa11 &usb_dp_pa12>;
pinctrl-names = "default";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
};
};

&rtc {
Expand Down
5 changes: 1 addition & 4 deletions app/boards/arm/bluemicro840/bluemicro840_v1.dts
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,8 @@
pinctrl-names = "default", "sleep";
};

&usbd {
zephyr_udc0: &usbd {
status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
};
};


Expand Down
6 changes: 1 addition & 5 deletions app/boards/arm/bt60/bt60.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
zephyr,code-partition = &code_partition;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
zmk,battery = &vbatt;
zmk,kscan = &kscan0;
zmk,matrix-transform = &default_transform;
Expand Down Expand Up @@ -70,11 +69,8 @@
status = "okay";
};

&usbd {
zephyr_udc0: &usbd {
status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
};
};


Expand Down
2 changes: 1 addition & 1 deletion app/boards/arm/ckp/ckp.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
status = "okay";
};

&usbd {
zephyr_udc0: &usbd {
status = "okay";
};

Expand Down
6 changes: 1 addition & 5 deletions app/boards/arm/corneish_zen/corneish_zen.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
zephyr,flash = &flash0;
zmk,kscan = &kscan0;
zmk,display = &epd;
zephyr,console = &cdc_acm_uart;
zmk,matrix-transform = &default_transform;
};

Expand Down Expand Up @@ -76,11 +75,8 @@
status = "okay";
};

&usbd {
zephyr_udc0: &usbd {
status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
};
};

&flash0 {
Expand Down
6 changes: 1 addition & 5 deletions app/boards/arm/dz60rgb/dz60rgb_rev1.dts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
chosen {
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
zmk,kscan = &kscan0;
zmk,matrix-transform = &default_transform;
};
Expand Down Expand Up @@ -65,11 +64,8 @@ RC(4,0) RC(4,1) RC(4,2) RC(4,5) RC(

};

&usb {
zephyr_udc0: &usb {
status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
};
};

&flash0 {
Expand Down
6 changes: 1 addition & 5 deletions app/boards/arm/ferris/ferris_rev02.dts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
chosen {
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
zmk,kscan = &kscan;
zmk,matrix-transform = &transform;
/* TODO: Enable once we support the IC for underglow
Expand Down Expand Up @@ -110,14 +109,11 @@
};
};

&usb {
zephyr_udc0: &usb {
status = "okay";

pinctrl-0 = <&usb_dm_pa11 &usb_dp_pa12>;
pinctrl-names = "default";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
};
};

&clk_hsi {
Expand Down
6 changes: 1 addition & 5 deletions app/boards/arm/glove80/glove80.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
zephyr,code-partition = &code_partition;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
};

default_transform: keymap_transform_0 {
Expand Down Expand Up @@ -59,11 +58,8 @@
status = "okay";
};

&usbd {
zephyr_udc0: &usbd {
status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
};
};

&flash0 {
Expand Down
7 changes: 1 addition & 6 deletions app/boards/arm/kbdfans_tofu65/kbdfans_tofu65_v2.dts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
chosen {
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
zephyr,shell-uart = &cdc_acm_uart;
zephyr,code-partition = &code_partition;
zmk,kscan = &kscan0;
zmk,matrix-transform = &default_transform;
Expand Down Expand Up @@ -108,11 +106,8 @@ RC(4,0) RC(4,1) RC(4,2) RC(4,6) RC(4,8) RC(4,9)
};


&usbd {
zephyr_udc0: &usbd {
status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
};
};


Expand Down
6 changes: 1 addition & 5 deletions app/boards/arm/mikoto/mikoto_520.dts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
zephyr,code-partition = &code_partition;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
zmk,battery = &vbatt;
};

Expand Down Expand Up @@ -81,11 +80,8 @@
pinctrl-names = "default", "sleep";
};

&usbd {
zephyr_udc0: &usbd {
status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
};
};


Expand Down
6 changes: 1 addition & 5 deletions app/boards/arm/nice60/nice60.dts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
zephyr,code-partition = &code_partition;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
zmk,battery = &vbatt;
zmk,kscan = &kscan0;
zmk,matrix-transform = &default_transform;
Expand Down Expand Up @@ -129,11 +128,8 @@ RC(4,0) RC(4,1) RC(4,2) RC(4,5) R
};
};

&usbd {
zephyr_udc0: &usbd {
status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
};
};

&flash0 {
Expand Down
6 changes: 1 addition & 5 deletions app/boards/arm/nice_nano/nice_nano.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
zephyr,code-partition = &code_partition;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
};

leds {
Expand Down Expand Up @@ -65,11 +64,8 @@
pinctrl-names = "default", "sleep";
};

&usbd {
zephyr_udc0: &usbd {
status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
};
};


Expand Down
6 changes: 1 addition & 5 deletions app/boards/arm/nrf52840_m2/nrf52840_m2.dts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
zephyr,code-partition = &code_partition;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
zmk,battery = &vbatt;
};

Expand Down Expand Up @@ -57,12 +56,9 @@
status = "okay";
};

&usbd {
zephyr_udc0: &usbd {
compatible = "nordic,nrf-usbd";
status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
};
};


Expand Down
6 changes: 1 addition & 5 deletions app/boards/arm/nrfmicro/nrfmicro_11.dts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
zephyr,code-partition = &code_partition;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
};

leds {
Expand Down Expand Up @@ -69,11 +68,8 @@
pinctrl-names = "default", "sleep";
};

&usbd {
zephyr_udc0: &usbd {
status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
};
};


Expand Down
6 changes: 1 addition & 5 deletions app/boards/arm/nrfmicro/nrfmicro_11_flipped.dts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
zephyr,code-partition = &code_partition;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
};

leds {
Expand Down Expand Up @@ -69,11 +68,8 @@
pinctrl-names = "default", "sleep";
};

&usbd {
zephyr_udc0: &usbd {
status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
};
};


Expand Down
6 changes: 1 addition & 5 deletions app/boards/arm/nrfmicro/nrfmicro_13.dts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
zephyr,code-partition = &code_partition;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
zmk,battery = &vbatt;
};

Expand Down Expand Up @@ -81,11 +80,8 @@
pinctrl-names = "default", "sleep";
};

&usbd {
zephyr_udc0: &usbd {
status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
};
};


Expand Down
6 changes: 1 addition & 5 deletions app/boards/arm/nrfmicro/nrfmicro_13_52833.dts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
zephyr,code-partition = &code_partition;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &cdc_acm_uart;
zmk,battery = &vbatt;
};

Expand Down Expand Up @@ -81,11 +80,8 @@
pinctrl-names = "default", "sleep";
};

&usbd {
zephyr_udc0: &usbd {
status = "okay";
cdc_acm_uart: cdc_acm_uart {
compatible = "zephyr,cdc-acm-uart";
};
};


Expand Down
Loading

0 comments on commit 032068b

Please sign in to comment.