2022-12-05 03:13 AM
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 :
Thanks
2022-12-05 07:11 AM
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,
2022-12-05 07:23 AM
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.
2022-12-05 07:31 AM
2022-12-05 07:33 AM
Nope i did not make any changes in syscalls.c
2022-12-05 07:57 AM
OK! now go to syscalls.c (found under core >>>Src) and make those changes:
Maybe those screenshots could help you:
Wijeden,
2022-12-05 08:05 AM
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 :grinning_face_with_sweat: :loudly_crying_face:
2022-12-05 08:10 AM
Before running you click on the Start/Stop trace (red button) Showen bellow?
Wijeden,
2022-12-05 08:12 AM
# 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]
2022-12-05 08:37 AM
Yes as you can see red button is "ON" but still nothing on Port 0 !