This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Unexpected UART output

This may not be a major disaster,but it bothers me: I have written an application to read data from an ADXL345 accelerometer (using SPI) and print out the data on a console using simple_uart.c - in particular the function simple_uart_putstring() Keil is set up to "load application at startup" and "run until main()" As soon as I enter debug the execution pointer correctly points to the first line of executable code in main(). However, two messages appear on the console. They are the contents of the two instances of "simple_uart_putstring()" although they are two lines after "simple_uart_config()" How can I print messages before I configure the UART?

  • When debugging, the jtag will perform a target reset after flashing the code in. Then it performs the sequence to enter debug mode. Often the target would start running after the first reset before the jtag has time to halt it. If your output string is done from the very beginning, you are likely to see it twice.

Related