Can’t get SWV to work on my NUCLEO-WL55JC1
Hello,
Apologize for the long post/question…
Using the NUCLEO-WL55JC1 board, I am trying to get SWV to redirect printf() output to the IDE console, with no luck.
I added the below code to syscalls.c and modified the _write() function to call this function. I also set the IDE to monitor port 0, and start.
//Debug Exception and Monitor Control Register base address
#define DEMCR *((volatile uint32_t*) 0xE000EDFCU )
// ITM register addresses
#define ITM_STIMULUS_PORT0 *((volatile uint32_t*) 0xE0000000 )
#define ITM_TRACE_EN *((volatile uint32_t*) 0xE0000E00 )
void ITM_SendChar(uint8_t ch) {
//Enable TRCENA
DEMCR |= (1 << 24);
//enable stimulus port 0
ITM_TRACE_EN |= (1 << 0);
// read FIFO status in bit [0]:
While (!(ITM_STIMULUS_PORT0 & 1));
//Write to ITM stimulus port0
ITM_STIMULUS_PORT0 = ch;
}
In addition,
- I verified that \n is at the end of the printed string.
- I checked the board and there are jumpers on the T_SWDIO, T_SWCLK, and T_SWO. I assume that having the jumpers means that this is enabled.
- The MCU datasheet states (for the M4 core):
32-bit Arm® Cortex®-M4 CPU – Adaptive real-time accelerator (ART Accelerator) allowing 0-wait-state execution from flash memory, frequency up to 48 MHz, MPU and DSP instructions.
So, I set the speed to 48.0
- When I connected the board the first time and started the IDE, it popped a window asking me to approve the upgrade to STLINK/V3. Maybe this causes the issue?
I would very highly appreciate your help in resolving this and helping me get this to work.
Thanks a lot,
Motti
