Hi,
I have an LPC13xx mounted in LPCXpresso Base Board and I use the ULINK2 debugger.. I have a simple program that will display the printf output data...for example Display a "Hello World" in the window. I've found out that uVision4 works the printf in Retarget.c and i modify fputc.. What i want is when I Start debugging I want to view the "Hello World" in the output window.But unfortunately theirs nothing display in the Serial Window (UART #1, UART #2, UART#3 and Debug (Printf)Viewer)... If I do simulation with out using the ULINK debugger and Start debugging the program I could view the "Hello World" in the Debug (printf) Viewer. Did someone knows how to use the debug (printf) viewer or enable an output window using the debugger without using simulation and without using UART for printf output.(I've already implement the codes for ITM). Is it possible to display printf output in a window inside the uVision 4 not in the Hyperterminal using the ULINK debugger? If yes, could you please share it to me?.. Thanks a lot.
Debugger will show characters in Debug (printf) window that are captured over Serial Wire Output (SWO) - ITM channel 0.
To achieve this the following is required:
A. Proper code needs to be added for sending characters:
- function ITM_SendChar should be called in retargeted sendchar
B. ULINK debugger needs to be properly configured (Debug Settings - Trace Tab):
- correct Core Clock specified
- Trace Port: Serial Wire Output (UART)
- ITM Port 0 enabled
C. LPC13xx needs to be configured for trace over SWO
Use the following debugger Initialization file:
FUNC void DebugSetup (void) { // <h> Trace Clock Divider // <o3.0..7> TRACECLKDIV.DIV : Trace Clock Divider // 0 = Trace Clock disabled // </h> _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
SWO configuration can be verified by looking at the status bar when the target is running through the debugger. www.keil.com/.../ulink2_trace_status.htm
Hi, Thanks for your response, but unfortunately I don't know on how to Setup the Debugger as on the codes you've given. What I've did I copy and paste it on the notepad and save as like "DBG.ini". I used this file in the Debug->Initialization file(just replacing the RAM.ini/FLASH.ini used for initialization),but unfortunately is not working theirs no display on the Debug (printf) viewer. I already enable the Port 0 in ITM Stimulus port but still not working. Also the ITM_SendChar in retarget.c is also configured. By the way, if I used the RAM.ini and start debugging the code it didn't display any character on the Debug(printf) viewer. If I do stop code execution, it points to the function of ITM_SendCahr..on this line: while (ITM->PORT[0].u32 == 0);, I really don't have an idea on how to enable the Debug(printf) viewer. I've read a lot of forums and applied on my simple project but unfortunately is doesn't work.
B. ULINK debugger needs to be properly configured (Debug Settings - Trace Tab): - Trace Port: Serial Wire Output (UART)-> what do you mean by this? Is this found in the IDE or this is the Debug(printf) Viewer window? Because I didn't found this - Trace Port: Serial Wire Output (UART) in Debug Settings - Trace Tab
Please help me. Thanks.
Hello,
I've already found this one and it is a combo box but it is been disabled. Trace Port: Serial Wire Output -UART/NRZ. I think it is been a default value. B. ULINK debugger needs to be properly configured (Debug Settings - Trace Tab): - Trace Port: Serial Wire Output (UART)-> what do you mean by this? Is this found in the IDE or this is the Debug(printf) Viewer window? Because I didn't found this - Trace Port: Serial Wire Output (UART) in Debug Settings - Trace Tab