Alan,

The same change works with stlink on f7. Please test with minimal changes.
See my diff and gdb log below.

(gdb) mon reset halt
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Unable to match requested speed 2000 kHz, using 1800 kHz
[stm32f7x.cpu] halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x080003c4 msp: 0x20011b68
[stm32f7x.cpu] halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x080003c4 msp: 0x20011b68
(gdb) monitor arm semihosting enable
semihosting is enabled
(gdb) monitor arm semihosting_fileio enable
semihosting fileio is enabled
(gdb) c
Continuing.
mm_initialize: Heap: name=Umem, start=0x20011b68 size=238744
mm_addregion: Region 1: base=0x20011cd8 size=238376
mm_malloc: Allocated 0x20011ce8, size 72
mm_malloc: Allocated 0x20011d30, size 40
mm_addregion: Region 2: base=0x2004c000 size=16384
mm_addre^C[stm32f7x.cpu] halted due to debug-request, current mode: Thread
xPSR: 0x21000000 pc: 0x0800c94a msp: 0x200118f0, semihosting fileio

diff --git a/arch/arm/src/common/arm_nputs.c
b/arch/arm/src/common/arm_nputs.c
index 6ec271db77..1f3a22dd05 100644
--- a/arch/arm/src/common/arm_nputs.c
+++ b/arch/arm/src/common/arm_nputs.c
@@ -38,7 +38,7 @@
  *   This is a low-level helper function used to support debug.
  *

****************************************************************************/
-
+#ifndef CONFIG_ARM_SEMIHOSTING_SYSLOG
 void up_nputs(const char *str, size_t len)
 {
   while (len-- > 0 && *str)
@@ -46,3 +46,4 @@ void up_nputs(const char *str, size_t len)
       up_putc(*str++);
     }
 }
+#endif
diff --git a/arch/arm/src/stm32f7/stm32_serial.c
b/arch/arm/src/stm32f7/stm32_serial.c
index aebcd705fb..a977aee0e4 100644
--- a/arch/arm/src/stm32f7/stm32_serial.c
+++ b/arch/arm/src/stm32f7/stm32_serial.c
@@ -3803,6 +3803,7 @@ void stm32_serial_dma_poll(void)
  *

****************************************************************************/

+#ifndef CONFIG_ARM_SEMIHOSTING_SYSLOG
 void up_putc(int ch)
 {
 #if CONSOLE_UART > 0
@@ -3814,6 +3815,7 @@ void up_putc(int ch)
   up_restoreusartint(priv, ie);
 #endif
 }
+#endif

 #else /* USE_SERIALDRIVER */

diff --git a/boards/arm/stm32f7/stm32f746g-disco/configs/nsh/defconfig
b/boards/arm/stm32f7/stm32f746g-disco/configs/nsh/defconfig
index c0f15c1e90..9a7e64bed3 100644
--- a/boards/arm/stm32f7/stm32f746g-disco/configs/nsh/defconfig
+++ b/boards/arm/stm32f7/stm32f746g-disco/configs/nsh/defconfig
@@ -21,8 +21,14 @@ CONFIG_ARMV7M_DCACHE=y
 CONFIG_ARMV7M_DCACHE_WRITETHROUGH=y
 CONFIG_ARMV7M_DTCM=y
 CONFIG_ARMV7M_ICACHE=y
+CONFIG_ARM_SEMIHOSTING_SYSLOG=y
 CONFIG_BOARD_LOOPSPERMSEC=43103
 CONFIG_BUILTIN=y
+CONFIG_DEBUG_FEATURES=y
+CONFIG_DEBUG_MM=y
+CONFIG_DEBUG_MM_ERROR=y
+CONFIG_DEBUG_MM_INFO=y
+CONFIG_DEBUG_MM_WARN=y
 CONFIG_DEBUG_SYMBOLS=y
 CONFIG_HAVE_CXX=y
 CONFIG_HAVE_CXXINITIALIZE=y

On Mon, 13 Oct 2025 at 08:34, Alan C. Assis <acas...@gmail.com> wrote:

> Jean,
>
> Maybe the issue is related to stlink support on OpenOCD, maybe we need to
> use another programmer better compatible with ARM DAP.
>
> What programmer are you using with OpenOCD?
>
> BR,
>
> Alan
>
> On Mon, Oct 13, 2025 at 9:24 AM Alan C. Assis <acas...@gmail.com> wrote:
>
> > Hi Jean,
> >
> > Thank you for the suggestion. In fact CONFIG_SYSLOG_DEFAULT is enabled,
> > but it is not displayed in the defconfig because it is enabled by
> default,
> > so the savedefconfig compression doesn't include it.
> >
> > BR,
> >
> > Alan
> >
> > On Mon, Oct 13, 2025 at 5:56 AM Jean Thomas <j...@lambdaconcept.com>
> > wrote:
> >
> >> Hi Alan,
> >>
> >> > Could you please double check my defconfig for stm32f4discovery (a
> >> create a
> >> > config using the nsh as base removing USART support and enabling
> >> > SEMIHOSTING SYSLOG):
> >>
> >> I don't see CONFIG_SYSLOG_DEFAULT=y in there.
> >>
> >> Also, can you try to bump CONFIG_SYSLOG_MAX_CHANNELS to a higher value
> >> than 1 (default)? Syslog is seemingly dynamically registered, so if
> there's
> >> not enough room for it, it won't work — I fell into this pitfall the
> other
> >> day :)
> >>
> >> Cheers,
> >> Jean
> >>
> >>
> >>
>

Reply via email to