SEGGER SystemView via UART in IDF v5.0

NickJames
Posts: 7
Joined: Sun May 26, 2019 5:53 am

SEGGER SystemView via UART in IDF v5.0

Postby NickJames » Wed Jun 22, 2022 8:16 am

I used SystemView in IDF v4.4, managing to pull a trace via JTAG using openocd as described in the documentation: (https://docs.espressif.com/projects/esp ... nd-options). openocd and gdb were flaky and capturing traces was troublesome. I was intrigued to see that the UART transport has been added to app_trace in IDF v5.0. This is my experience trying to use it:

Setup:
Development Kit: None
Module or chip used (2):
- ESP32-C3
-- TX/RX pins tried: (14,13), (13,14), (8,9), (9,8)
- ESP32-WROOM-32
-- TX/Rx pins tried: (12,13)
IDF version (run git describe --tags to find it): v5.0-dev-3424-gbb23d783c0
Build System: idf.py
Compiler version (run xtensa-esp32-elf-gcc --version to find it):
riscv32-esp-elf-gcc (crosstool-NG esp-2022r1-RC1) 11.2.0
Operating System: Linux
SEGGER SystemView Version: V3.32
Program: examples/get-started/hello_world

Selecting Target->Start Recording in SEGGER SystemView sends some data on the UART1 (seen with oscilloscope) but the ESP32 doesn't respond. I've confirmed that UART1 is physically connected correctly by redirecting console logs to it (after first disabling Application Level Tracing).

I've tried a few different baud rates and pin combinations. Has anyone used Application Level Tracing over UART successfully?

Relevant sdkconfig:
  1. #
  2. # Application Level Tracing
  3. #
  4. # CONFIG_APPTRACE_DEST_JTAG is not set
  5. CONFIG_APPTRACE_DEST_NONE=y
  6. CONFIG_APPTRACE_DEST_UART=y
  7. CONFIG_APPTRACE_DEST_UART_NOUSB=y
  8. CONFIG_APPTRACE_DEST_UART1=y
  9. # CONFIG_APPTRACE_DEST_UART2 is not set
  10. # CONFIG_APPTRACE_DEST_UART_NONE is not set
  11. CONFIG_APPTRACE_UART_TX_GPIO=12
  12. CONFIG_APPTRACE_UART_RX_GPIO=13
  13. CONFIG_APPTRACE_UART_BAUDRATE=460800
  14. CONFIG_APPTRACE_UART_RX_BUFF_SIZE=128
  15. CONFIG_APPTRACE_UART_TX_BUFF_SIZE=4096
  16. CONFIG_APPTRACE_UART_TX_MSG_SIZE=128
  17. CONFIG_APPTRACE_UART_TASK_PRIO=1
  18. CONFIG_APPTRACE_ENABLE=y
  19. CONFIG_APPTRACE_ONPANIC_HOST_FLUSH_TMO=-1
  20. CONFIG_APPTRACE_POSTMORTEM_FLUSH_THRESH=0
  21.  
  22. #
  23. # FreeRTOS SystemView Tracing
  24. #
  25. CONFIG_APPTRACE_SV_ENABLE=y
  26. CONFIG_APPTRACE_SV_DEST_UART=y
  27. CONFIG_APPTRACE_SV_DEST_CPU_0=y
  28. # CONFIG_APPTRACE_SV_DEST_CPU_1 is not set
  29. CONFIG_APPTRACE_SV_TS_SOURCE_GPTIMER=y
  30. # CONFIG_APPTRACE_SV_TS_SOURCE_ESP_TIMER is not set
  31. CONFIG_APPTRACE_SV_MAX_TASKS=16
  32. CONFIG_APPTRACE_SV_BUF_WAIT_TMO=500
  33. CONFIG_APPTRACE_SV_EVT_OVERFLOW_ENABLE=y
  34. CONFIG_APPTRACE_SV_EVT_ISR_ENTER_ENABLE=y
  35. CONFIG_APPTRACE_SV_EVT_ISR_EXIT_ENABLE=y
  36. CONFIG_APPTRACE_SV_EVT_ISR_TO_SCHED_ENABLE=y
  37. CONFIG_APPTRACE_SV_EVT_TASK_START_EXEC_ENABLE=y
  38. CONFIG_APPTRACE_SV_EVT_TASK_STOP_EXEC_ENABLE=y
  39. CONFIG_APPTRACE_SV_EVT_TASK_START_READY_ENABLE=y
  40. CONFIG_APPTRACE_SV_EVT_TASK_STOP_READY_ENABLE=y
  41. CONFIG_APPTRACE_SV_EVT_TASK_CREATE_ENABLE=y
  42. CONFIG_APPTRACE_SV_EVT_TASK_TERMINATE_ENABLE=y
  43. CONFIG_APPTRACE_SV_EVT_IDLE_ENABLE=y
  44. CONFIG_APPTRACE_SV_EVT_TIMER_ENTER_ENABLE=y
  45. CONFIG_APPTRACE_SV_EVT_TIMER_EXIT_ENABLE=y
  46. # end of FreeRTOS SystemView Tracing
  47. # end of Application Level Tracing

ESP_Dmitry
Posts: 2
Joined: Thu Oct 12, 2017 4:58 am

Re: SEGGER SystemView via UART in IDF v5.0

Postby ESP_Dmitry » Wed Jun 29, 2022 9:47 am

Hi @NickJames,

It looks like the problem related to system view module and how it work on esp32c3. With Esp32/Esp32s2/Esp32s3 it works fine.
I will try to fix it this/next week, and inform you.

Thank you for report.

Regards,
Dmitry

Who is online

Users browsing this forum: Baidu [Spider] and 65 guests