ARM Technical Support Knowledge Articles

PRINTF DOES NOT PRINT THE LAST CHARACTER

Applies to: uVision Debugger

Answer


Information in this article applies to:


SYMPTOMS

I have the following line of code in my program:

printf("
hello");

When I step through my code to the line after the printf and I examine the serial window I see:

hell

Why isn't it printing the last character?

CAUSE

The debugger is accurately simulating the baudrate of the microcontroller. As you step through code you will have to step through several more lines before the required delay has elapsed and the final character has been completely transmitted. The number of lines depends on your code and the baudrate.

RESOLUTION

You can turn off accurate simulation of the serial port timing by setting VTREG S0TIME (for serial port 0) to 0. You can do this by typing the following into the Command window:

S0TIME = 0

To turn it back on, set VTREG S0TIME to 1.

Note:

Article last edited on: 2008-10-14 14:08:14

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential