drivers/segger: add note vprint support

Print note log to sysview terminal.

See https://www.segger.com/products/development-tools/systemview/#logging-output

Signed-off-by: xuxingliang <xuxingliang@xiaomi.com>
This commit is contained in:
xuxingliang
2024-08-05 15:55:20 +08:00
committed by Xiang Xiao
parent 01676cb9cd
commit 62f0126b06
2 changed files with 20 additions and 0 deletions
+2
View File
@@ -112,4 +112,6 @@
} \ } \
while (0) while (0)
#define SEGGER_SYSVIEW_PRINTF_IMPLICIT_FORMAT 1
#endif /* __DRIVERS_SEGGER_CONFIG_SEGGER_RTT_CONF_H */ #endif /* __DRIVERS_SEGGER_CONFIG_SEGGER_RTT_CONF_H */
+18
View File
@@ -84,6 +84,11 @@ static void note_sysview_wdog(FAR struct note_driver_s *drv, uint8_t event,
FAR void *handler, FAR const void *arg); FAR void *handler, FAR const void *arg);
#endif #endif
#ifdef CONFIG_SCHED_INSTRUMENTATION_DUMP
static void note_sysview_vprintf(FAR struct note_driver_s *drv, uintptr_t ip,
FAR const char *fmt, va_list va);
#endif
/**************************************************************************** /****************************************************************************
* Private Data * Private Data
****************************************************************************/ ****************************************************************************/
@@ -129,6 +134,11 @@ static const struct note_driver_ops_s g_note_sysview_ops =
#ifdef CONFIG_SCHED_INSTRUMENTATION_HEAP #ifdef CONFIG_SCHED_INSTRUMENTATION_HEAP
note_sysview_heap, /* heap */ note_sysview_heap, /* heap */
#endif #endif
#ifdef CONFIG_SCHED_INSTRUMENTATION_DUMP
NULL, /* event */
note_sysview_vprintf, /* vprintf */
#endif
}; };
static struct note_sysview_driver_s g_note_sysview_driver = static struct note_sysview_driver_s g_note_sysview_driver =
@@ -408,6 +418,14 @@ static void note_sysview_wdog(FAR struct note_driver_s *drv, uint8_t event,
} }
#endif #endif
#ifdef CONFIG_SCHED_INSTRUMENTATION_DUMP
static void note_sysview_vprintf(FAR struct note_driver_s *drv, uintptr_t ip,
FAR const char *fmt, va_list va)
{
SEGGER_SYSVIEW_VPrintfHost(fmt, &va);
}
#endif
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/