cancel
Showing results for 
Search instead for 
Did you mean: 

Serial Wire debug Nucleo-WL55 JC1 SWO

LEdou.1
Associate III

Hi,

I trying to debug on nucleo-WL55 with serial wire debug via SWO.

I have enable "Serial Wire Viewer (SWV)" in debug config, and add SWV ITM Data console (Config 0).

Even add this code :

int _write(int file, char *ptr, int len)
{
  /* Implement your write code here, this is used by puts and printf for example */
  int i=0;
  for(i=0 ; i<len ; i++)
    ITM_SendChar((*ptr++));
  return len;
}

With this line : printf("HelloWorld");

Did you know why it doesn't work? Is that possible to have serial wire on WL-55 ? I have all jumper on JP8 as we receive the nucleo-WL55.

My config :

0693W00000WKERiQAP.png0693W00000WKESHQA5.png 

0693W00000WKERxQAP.png 

Thanks

17 REPLIES 17
Wijeden RHIMI
ST Employee

Hello@ LEdou.1,

your configuration is 100% correct just you could change something in your function could you please add a newline : printf("HelloWorld") >>> printf ("HelloWorld \n").

Now you can see your function in SWV Data Console.

The newline will flush the stdout buffer which is not done automatically. This is why you did not see the message.

Wijeden,

LEdou.1
Associate III

Thanks,

But it still don't work. I can't see anything on SWV ITM Data console. I have also try to add "Trace event in SWV ITM Data console, but nothing.

I'm on linux Ubuntu OS/Version: 1.11.0 IDECube, connected by USB on nucleo board.

Wijeden RHIMI
ST Employee

Hi again @ LEdou.1,

Do you make some changes in syscalls.c (found under core >>>Src) ?

Wijeden,

LEdou.1
Associate III

Nope i did not make any changes in syscalls.c

Wijeden RHIMI
ST Employee

OK! now go to syscalls.c (found under core >>>Src) and make those changes:

  • Under /* Includes */: add your selector board (#include "stm32f4xx.h")>>>you must choose the right selector board.
  • Under /* Functions */ :replace ITM_SendChar(*ptr++); instead __io_putchar(*ptr++).

Maybe those screenshots could help you:

0693W00000WKFOuQAP.png0693W00000WKFKZQA5.png 

Wijeden,

LEdou.1
Associate III

In my case : #include "stm32wlxx.h"

__attribute__((weak)) int _write(int file, char *ptr, int len)
{
	int DataIdx;
 
	for (DataIdx = 0; DataIdx < len; DataIdx++)
	{
		ITM_SendChar(*ptr++);
		//__io_putchar(*ptr++);
	}
	return len;
}

But still nothing 😅 :loudly_crying_face:

Wijeden RHIMI
ST Employee

Before running you click on the Start/Stop trace (red button) Showen bellow?

0693W00000WKFXrQAP.pngWijeden,

LEdou.1
Associate III
# This is an genericBoard board with a single STM32WL55JCIx chip
#
# Generated by STM32CubeIDE
# Take care that such file, as generated, may be overridden without any early notice. Please have a look to debug launch configuration setup(s)
 
source [find interface/stlink-dap.cfg]
 
st-link backend tcp
 
set WORKAREASIZE 0x8000
 
transport select "dapdirect_swd"
 
set CHIPNAME STM32WL55JCIx
set BOARDNAME genericBoard
 
# Enable debug when in low power modes
set ENABLE_LOW_POWER 1
 
# Stop Watchdog counters when halt
set STOP_WATCHDOG 1
 
# STlink Debug clock frequency
set CLOCK_FREQ 4000
 
# Reset configuration
# use hardware reset, connect under reset
# connect_assert_srst needed if low power mode application running (WFI...)
reset_config srst_only srst_nogate connect_assert_srst
set CONNECT_UNDER_RESET 1
set CORE_RESET 0
 
# ACCESS PORT NUMBER
set AP_NUM 0
# GDB PORT
set GDB_PORT 3333
 
 
set DUAL_CORE 1
 
# BCTM CPU variables
 
source [find target/stm32wlx.cfg]
 
# SWV trace
set USE_SWO 0
set swv_cmd "-protocol uart -output :3344 -traceclk 48000000"
source [find board/swv.tcl]

0693W00000WKFZiQAP.png

LEdou.1
Associate III

Yes as you can see red button is "ON" but still nothing on Port 0 !