From bd3b731ddcfbbf395cda8e95623af12fcdbfcd65 Mon Sep 17 00:00:00 2001 From: Raffael Rostagno Date: Thu, 5 Sep 2024 15:45:07 -0300 Subject: [PATCH] soc: esp32c2: esp8684: Console baudrate from device tree Get console baudrate property from device tree to allow proper configuration for 26 and 40 Mhz devices. Signed-off-by: Raffael Rostagno --- soc/espressif/esp32c2/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/soc/espressif/esp32c2/CMakeLists.txt b/soc/espressif/esp32c2/CMakeLists.txt index c7d671baea8..7581a7179b5 100644 --- a/soc/espressif/esp32c2/CMakeLists.txt +++ b/soc/espressif/esp32c2/CMakeLists.txt @@ -45,9 +45,13 @@ dt_reg_addr(img_0_off PATH ${dts_partition_path}) dt_nodelabel(dts_partition_path NODELABEL "boot_partition") dt_reg_addr(boot_off PATH ${dts_partition_path}) +# get UART baudrate from DT +dt_chosen(dts_shell_uart PROPERTY "zephyr,shell-uart") +dt_prop(monitor_baud PATH ${dts_shell_uart} PROPERTY "current-speed") + # C2 uses specific values for flash frequency and UART baudrate board_runner_args(esp32 "--esp-flash-freq=60m") -board_runner_args(esp32 "--esp-monitor-baud=74880") +board_runner_args(esp32 "--esp-monitor-baud=${monitor_baud}") if(CONFIG_ESP_SIMPLE_BOOT) board_finalize_runner_args(esp32 "--esp-app-address=${boot_off}")