This is an automated email from the ASF dual-hosted git repository.

lupyuen pushed a commit to branch releases/12.9
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 70fccfcbcd619ab95f44fbca1c36239476695c57
Author: Tiago Medicci Serrano <tiago.medi...@espressif.com>
AuthorDate: Wed Apr 9 13:46:29 2025 -0300

    arch/risc-v/espressif: Fix bug with usbconsole and DEBUG_FEATURES
    
    This commit fixes a bug on the `usbconsole` defconfigs for
    Espressif's RISC-V SoCs when the serial/JTAG is used and the
    Kconfig macro `DEBUG_FEATURES` is enabled. This config enables the
    `showprogress` macro during start-up. Previously, `riscv_lowputc`
    function was used by this macro, but it is not suitable for the
    serial/JTAG console. Instead, use the `esp_rom_printf` function
    that is suitable for both serial/JTAG and UART consoles.
    
    Signed-off-by: Tiago Medicci Serrano <tiago.medi...@espressif.com>
---
 arch/risc-v/src/common/espressif/esp_start.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/risc-v/src/common/espressif/esp_start.c 
b/arch/risc-v/src/common/espressif/esp_start.c
index 9e71296345..2e3a09b3f9 100644
--- a/arch/risc-v/src/common/espressif/esp_start.c
+++ b/arch/risc-v/src/common/espressif/esp_start.c
@@ -39,6 +39,7 @@
 #include "esp_lowputc.h"
 #include "esp_start.h"
 
+#include "esp_rom_sys.h"
 #include "esp_clk_internal.h"
 #include "esp_private/rtc_clk.h"
 #include "esp_cpu.h"
@@ -61,7 +62,6 @@
 #ifdef CONFIG_ESPRESSIF_SIMPLE_BOOT
 #include "bootloader_flash_priv.h"
 #include "esp_rom_uart.h"
-#include "esp_rom_sys.h"
 #include "esp_app_format.h"
 #endif
 
@@ -70,7 +70,7 @@
  ****************************************************************************/
 
 #ifdef CONFIG_DEBUG_FEATURES
-#  define showprogress(c)     riscv_lowputc(c)
+#  define showprogress(c)     esp_rom_printf(c)
 #else
 #  define showprogress(c)
 #endif
@@ -478,13 +478,13 @@ void __esp_start(void)
   riscv_earlyserialinit();
 #endif
 
-  showprogress('A');
+  showprogress("A");
 
   /* Setup the syscall table needed by the ROM code */
 
   esp_setup_syscall_table();
 
-  showprogress('B');
+  showprogress("B");
 
   /* The 2nd stage bootloader enables RTC WDT to monitor any issues that may
    * prevent the startup sequence from finishing correctly. Hence disable it
@@ -501,7 +501,7 @@ void __esp_start(void)
 
   esp_board_initialize();
 
-  showprogress('C');
+  showprogress("C");
 
   /* Bring up NuttX */
 

Reply via email to