From f6e967a5d3b32dd5cf2d4aceae80a662863e3c1d Mon Sep 17 00:00:00 2001 From: Andrei Gherzan <andrei.gherzan@huawei.com> Date: Mon, 28 Mar 2022 13:20:14 +0200 Subject: [PATCH] zephyr-kernel: Rebase console enable patch on Zephyr v3.0.0 Also, USB_UART_CONSOLE was removed and shouldn't be needed anymore. Signed-off-by: Andrei Gherzan <andrei.gherzan@huawei.com> --- ...able-the-USB-ACM0-console-by-default.patch | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/meta-zephyr-core/recipes-kernel/zephyr-kernel/files/0001-console-enable-the-USB-ACM0-console-by-default.patch b/meta-zephyr-core/recipes-kernel/zephyr-kernel/files/0001-console-enable-the-USB-ACM0-console-by-default.patch index 96666a4..98c525c 100644 --- a/meta-zephyr-core/recipes-kernel/zephyr-kernel/files/0001-console-enable-the-USB-ACM0-console-by-default.patch +++ b/meta-zephyr-core/recipes-kernel/zephyr-kernel/files/0001-console-enable-the-USB-ACM0-console-by-default.patch @@ -1,20 +1,21 @@ -From fe9c7b4eaa93dd1b649d678d1a8b9cba51d0f7f5 Mon Sep 17 00:00:00 2001 +From e64879dc1cc0c4f6999874a96c24c9272958fee8 Mon Sep 17 00:00:00 2001 From: Bartosz Golaszewski <bartosz.golaszewski@huawei.com> Date: Thu, 27 Jan 2022 10:26:41 +0100 Subject: [PATCH] console: enable the USB ACM0 console by default Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@huawei.com> +Signed-off-by: Andrei Gherzan <andrei.gherzan@huawei.com> --- boards/arm/arduino_nano_33_ble/CMakeLists.txt | 3 +++ .../arduino_nano_33_ble.dts | 9 +++++++ - .../arduino_nano_33_ble_defconfig | 7 ++++++ + .../arduino_nano_33_ble_defconfig | 6 +++++ .../src/init_usb_cdc_acm.c | 25 +++++++++++++++++++ - subsys/shell/shell_uart.c | 2 +- - 5 files changed, 45 insertions(+), 1 deletion(-) + subsys/shell/backends/shell_uart.c | 2 +- + 5 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 boards/arm/arduino_nano_33_ble/src/init_usb_cdc_acm.c diff --git a/boards/arm/arduino_nano_33_ble/CMakeLists.txt b/boards/arm/arduino_nano_33_ble/CMakeLists.txt -index 9e885f42ab..37495cb885 100644 +index 9e885f42ab8..37495cb885c 100644 --- a/boards/arm/arduino_nano_33_ble/CMakeLists.txt +++ b/boards/arm/arduino_nano_33_ble/CMakeLists.txt @@ -11,3 +11,6 @@ if(CONFIG_BOARD_ARDUINO_NANO_33_BLE_INIT_SENSORS) @@ -25,7 +26,7 @@ index 9e885f42ab..37495cb885 100644 +zephyr_library() +zephyr_library_sources("${CMAKE_CURRENT_SOURCE_DIR}/src/init_usb_cdc_acm.c") diff --git a/boards/arm/arduino_nano_33_ble/arduino_nano_33_ble.dts b/boards/arm/arduino_nano_33_ble/arduino_nano_33_ble.dts -index 7e509086d2..aa769b87f0 100644 +index 7e509086d27..aa769b87f0c 100644 --- a/boards/arm/arduino_nano_33_ble/arduino_nano_33_ble.dts +++ b/boards/arm/arduino_nano_33_ble/arduino_nano_33_ble.dts @@ -34,6 +34,10 @@ @@ -52,10 +53,10 @@ index 7e509086d2..aa769b87f0 100644 // All PWM's should be enaled &pwm0 { diff --git a/boards/arm/arduino_nano_33_ble/arduino_nano_33_ble_defconfig b/boards/arm/arduino_nano_33_ble/arduino_nano_33_ble_defconfig -index 5fbe4ccdfb..dfe0507822 100644 +index 5fbe4ccdfb0..3e3c51635dc 100644 --- a/boards/arm/arduino_nano_33_ble/arduino_nano_33_ble_defconfig +++ b/boards/arm/arduino_nano_33_ble/arduino_nano_33_ble_defconfig -@@ -18,3 +18,10 @@ CONFIG_BOOTLOADER_BOSSA_LEGACY=y +@@ -18,3 +18,9 @@ CONFIG_BOOTLOADER_BOSSA_LEGACY=y # additional board options CONFIG_GPIO_AS_PINRESET=y @@ -64,11 +65,10 @@ index 5fbe4ccdfb..dfe0507822 100644 +CONFIG_USB_DEVICE_PRODUCT="Zephyr USB console sample" + +CONFIG_UART_LINE_CTRL=y -+CONFIG_USB_UART_CONSOLE=y +CONFIG_BOARD_ARDUINO_NANO_33_BLE_EN_USB_CONSOLE=y diff --git a/boards/arm/arduino_nano_33_ble/src/init_usb_cdc_acm.c b/boards/arm/arduino_nano_33_ble/src/init_usb_cdc_acm.c new file mode 100644 -index 0000000000..a429cc5c8c +index 00000000000..a429cc5c8ca --- /dev/null +++ b/boards/arm/arduino_nano_33_ble/src/init_usb_cdc_acm.c @@ -0,0 +1,25 @@ @@ -97,19 +97,19 @@ index 0000000000..a429cc5c8c + } +} +SYS_INIT(board_internal_usb_cdc_acm_init, APPLICATION, 99); -diff --git a/subsys/shell/shell_uart.c b/subsys/shell/shell_uart.c -index 64b53e29fc..24d647ac58 100644 ---- a/subsys/shell/shell_uart.c -+++ b/subsys/shell/shell_uart.c -@@ -332,7 +332,7 @@ static int enable_shell_uart(const struct device *arg) - +diff --git a/subsys/shell/backends/shell_uart.c b/subsys/shell/backends/shell_uart.c +index 18f26db7638..cda2baf3643 100644 +--- a/subsys/shell/backends/shell_uart.c ++++ b/subsys/shell/backends/shell_uart.c +@@ -335,7 +335,7 @@ static int enable_shell_uart(const struct device *arg) return 0; } + -SYS_INIT(enable_shell_uart, POST_KERNEL, +SYS_INIT(enable_shell_uart, APPLICATION, CONFIG_SHELL_BACKEND_SERIAL_INIT_PRIORITY); const struct shell *shell_backend_uart_get_ptr(void) -- -2.30.1 +2.25.1 -- GitLab