Hi,
I have a ULINK2 debugger and Core-M3 board. I have a simple program that will print a simple "Hello World". I want this printf output will be display in the Debug (Printf) viewer on my uVision IDE, this will happen during Debugging. I've already setup the Retarget.c for the ITM_SendChar and enable the Port 0 for the ITM Stimulus Port.But unfortunately when I do debugging theirs no display for Debug(printf) viewer and it has a display in the bottom portion of the IDE: Trace: No Synchronization. If I do debugging using SIMULATION i can view the printf output display in Debug(printf) viewer but if I do debugging using the Debugger (ULINK2) theirs no display on the printf viewer. I've read on the "ULINK2 User Guide, Trace Status: No Synchronization --> There are no synchronization packets received from the target. This indicates that the Trace hardware is either not connected or improperly configured.", but I'm still can't figure out how to resolve my issue. Could someone help me....thanks a lot.
I've used LPC13xx, 12MHz for core clock.Ive configured the SWO(LPC_IOCON->PIO0_9 &= ~0x07; LPC_IOCON->PIO0_9 |=0x03;), the Port 0 is enabled and the debugger is also configured in SWD setup..but still it didn't work...:(
Hello josh u,
In folder C:\Keil\ARM\Boards\Keil\MCB1000\MCB1343\Blinky you can find file LPC13xx_SWO.ini. Use this INI file to configure LPC13xx for SWO.
If you do not have the latest uVision setup. Here is the file content:
FUNC void DebugSetup (void) { _WDWORD(0x40048080, 0x0001005F); // Enable AHB Clock (GPIO & IOCON) _WDWORD(0x400480AC, 0x00000001); // Enable Trace Clock (Div=1) _WDWORD(0x40044064, 0x00000003); // Enable SWO on P0.9 } DebugSetup(); // Debugger Setup
If you run from Flash than you can use this INI file without modification. If you run from RAM than you need to merge the INI file for RAM with this one.
Do not forget to to configure Core Clock to 12000000 in ULINK Cortex Debugger Settings - Trace.
Best Regards, Martin Guenther
Hello Martin,
Thanks a lot for your response, I really appreciate it. But still I've encountered a problem. I've merged the code you've posted here in the PreSetup of RAM.ini since I used RAM for debugging, but unfortunately is just the same I can't view the output printf display in the Debug (printf) viewer. I already configured Debug Settings for enable the trace, core clock is set to 12MHz, PORT0 is enable.But still the IDE display Trace:No Synchronization. As I've read in the ULINK2 User's Guide: Trace Status Message No Synchronization There are no synchronization packets received from the target. This indicates that the Trace hardware is either not connected or improperly configured.
"Trace hardware is either not connected", the debugger is detected so it really means that the hardware is connected. In Debug tab, SW Device it displays the IDCODE and Device Name of the SW target it detects. ULINK USB-JTAG/SW Adapter: SWJ - Checked Port: SW "improperly configured", I really don't know if I missed something on this part. I already applied the configuration of ITM Port, and also applied what you have given but still it didn't work. It work only during SIMULATION, if I used the DEBUGGER it don't have an output display.
Thanks.
I also tested a RAM application with SWO on a MCB1000 populated with a LPC1343. I encountered no problems with SWO via ITM port 0.
I used the following INI file:
FUNC void Setup (void) { SP = _RDWORD(0x10000000); // Setup Stack Pointer PC = _RDWORD(0x10000004); // Setup Program Counter _WDWORD(0xE000ED08, 0x10000000); // Setup VTOR register // _WDWORD(0x40048000, 0x00000001); // Interrupt vectors are re-mapped to Static RAM } FUNC void SWOSetup (void) { _WDWORD(0x40048080, 0x0001005F); // Enable AHB Clock (GPIO & IOCON) _WDWORD(0x400480AC, 0x00000001); // Enable Trace Clock (Div=1) _WDWORD(0x40044064, 0x00000003); // Enable SWO on P0.9 } load %L incremental SWOSetup(); // SWO Setup Setup(); // Setup for Running g, main
If you use this INI file uncheck Load Application at Startup under Options for Target - Debug.
If you still have problems with SWO then please contact KEIL support (support.intl@keil.com). Please advice support to forward your request to me then I can send you the test project I am using.
Hi Martin,
Theirs one more thing I don't really understand in ITM_SendChar on this line while (ITM->PORT[0].u32 ==0); in which I don't have an idea why the debugger stops in this line when I do debugging on printf. It stops when it recognized no more character to be read.
The while loop while (ITM->PORT[0].u32 == 0); runs as long as the stimulus port register is not empty.
Read access to a stimulus port register returns the FIFO status. 0 = full, 1 = not full.
ITM Stimulus Ports 0-31 Each of the 32 stimulus ports has its own address. A write to one of these locations causes data to be written into the FIFO if the corresponding bit in the Trace Enable Register is set. Reading from any of the stimulus ports returns the FIFO status in bit [0]: • 0 = full • 1 = not full.
Hi Josh,
Were you able to solve the Trace: No Synchronization issue?
I'm having the same issue you and "Nick L" had on http://www.keil.com/forum/17897/. Unfortunately I can't post any more on that thread because it's classified as read only...
I'm using MCBSTM32, MDKARM 4.20 and ULINK2.
I have tried several ITM Trace examples (Blink examples), created my own example, based on the my limited knowledge about the ITM, and all the attempts did not work on the eval board and also on my own hardware.
I have inspected the SWO line with a Digital Scope and the bit timing is correct, it means the Core clock setting is correct. Also tried different SWJ Max Clock speeds settings ranging from 500KHz to 10MHz. At some time during the test I used an "premium" quality USB Cable. Signal integrity is not being an issue here.
UV4 DB will always display Trace: Running and then 3 seconds latter, Trace: No Synchronization. No data from ITM is displayed.
I would appreciate in case you solved and could share the solution.
Regards,
Alex