<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>uVision printf debugging using STM32F7xx</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/34607/uvision-printf-debugging-using-stm32f7xx</link><description> 
Hello, 

 
I am having trouble finding a good source to help me set up printf
debugging on my project. I am currently using the STM32F7xx series
board with uVision and MXCUBE to initialize the project. Most of the
sources I find are fairly old and do</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: uVision printf debugging using STM32F7xx</title><link>https://community.arm.com/thread/70136?ContentTypeID=1</link><pubDate>Thu, 06 Jul 2017 09:41:48 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:a046a056-6146-4235-896b-94bcfdd148cb</guid><dc:creator>Clive Unspecified</dc:creator><description>&lt;p&gt;&lt;p&gt;
Pretty sure the usual fputc() code works, you might need to enable
access to the ITM registers.&lt;/p&gt;

&lt;p&gt;

&lt;a href="http://community.st.com/message/147118-stm32f769i-disco-printf-using-itmswo"&gt;community.st.com/.../147118-stm32f769i-disco-printf-using-itmswo&lt;/a&gt;&lt;/p&gt;

&lt;pre&gt;
volatile uint32_t *ITM_LAR = (volatile uint32_t *)0xE0000FB0; // ITM-&amp;gt;LAR
*ITM_LAR = 0xC5ACCE55; // Enable Access
&lt;/pre&gt;
&lt;pre&gt;
//****************************************************************************
// Hosting of stdio functionality through SWV - Serial Wire Viewer
//****************************************************************************

#include &amp;lt;rt_misc.h&amp;gt;

#pragma import(__use_no_semihosting_swi)

struct __FILE { int handle; /* Add whatever you need here */ };
FILE __stdout;
FILE __stdin;

int fputc(int ch, FILE *f)
{
  ITM_SendChar(ch);

  return(ch);
}

int fgetc(FILE *f)
{
  char ch;

  ch = &amp;#39;?&amp;#39;;

  return((int)ch);
}

int ferror(FILE *f)
{
  /* Your implementation of ferror */
  return EOF;
}

void _ttywrch(int ch)
{
  ITM_SendChar(ch);
}

void _sys_exit(int return_code)
{
label:  goto label;  /* endless loop */
}

//****************************************************************************
&lt;/pre&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>