<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>LPCXpresso IDEのトピックRe: vprintf output doesn't end up in __sys_write</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/vprintf-output-doesn-t-end-up-in-sys-write/m-p/563182#M17028</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by MindBender on Thu Jul 16 07:04:25 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt; Does you __sys_write even get called during your call to vprintf? (i.e. set a breakpoint on your __sys_write function).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was sure that it wasn't, but I have just removed my work-around and put vprintf back, and __sys_write gets called. However, the data it receives doesn't make much sense; It is readable text, and even text that was printed during program execution, but with text is repeated and appears out-of-order. And yet, I do make __sys_write return the length. Making it return 0 shows a slight improvement, but that's not how it's supposed to be.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt; Please also confirm target MCU, which version of LPCXpresso is being used and which debug probe.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC1788, LPCXpresso v7.8.0 [Build 426] [2015-05-28], Link2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;And I'm using RedLib, obviously.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think I will just stick with my work-around; Stripping my application down and testing for reproductions would cost a lot of time. Thank you for offering anyway.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Jun 2016 22:21:42 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-15T22:21:42Z</dc:date>
    <item>
      <title>vprintf output doesn't end up in __sys_write</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/vprintf-output-doesn-t-end-up-in-sys-write/m-p/563180#M17026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by MindBender on Thu Jul 16 02:12:13 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I have created function __sys_write according to this prototype:&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;int __sys_write(int file, char *buf, int len)&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;SPAN&gt;All my printf output is now diverted to my __sys_write. Unfortunately, vprintf output is not. The same goes for vfprintf stdout. Output seems to be discarded.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is this not supported?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:21:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/vprintf-output-doesn-t-end-up-in-sys-write/m-p/563180#M17026</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:21:40Z</dc:date>
    </item>
    <item>
      <title>Re: vprintf output doesn't end up in __sys_write</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/vprintf-output-doesn-t-end-up-in-sys-write/m-p/563181#M17027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by lpcxpresso-support on Thu Jul 16 02:34:23 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;There are no know issues here - for example see this previous thread (the functionality here has not changed since):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[list]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp; [*]&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Fwww.lpcware.com%2Fcontent%2Fforum%2Flpcxpresso-and-redlib-vprintf-problems" rel="nofollow" target="_blank"&gt;https://www.lpcware.com/content/forum/lpcxpresso-and-redlib-vprintf-problems&lt;/A&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/list]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does you __sys_write even get called during your call to vprintf? (i.e. set a breakpoint on your __sys_write function).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyway, I suggest that you post an example project that shows up the problem, or at least provide your linker map file in case that provides any clues.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[list]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp; [*]&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Fwww.lpcware.com%2Fcontent%2Ffaq%2Flpcxpresso%2Fhow-importexport-projects" rel="nofollow" target="_blank"&gt;https://www.lpcware.com/content/faq/lpcxpresso/how-importexport-projects&lt;/A&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/list]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please also confirm target MCU, which version of LPCXpresso is being used and which debug probe.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPCXpresso Support&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:21:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/vprintf-output-doesn-t-end-up-in-sys-write/m-p/563181#M17027</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:21:41Z</dc:date>
    </item>
    <item>
      <title>Re: vprintf output doesn't end up in __sys_write</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/vprintf-output-doesn-t-end-up-in-sys-write/m-p/563182#M17028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by MindBender on Thu Jul 16 07:04:25 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt; Does you __sys_write even get called during your call to vprintf? (i.e. set a breakpoint on your __sys_write function).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was sure that it wasn't, but I have just removed my work-around and put vprintf back, and __sys_write gets called. However, the data it receives doesn't make much sense; It is readable text, and even text that was printed during program execution, but with text is repeated and appears out-of-order. And yet, I do make __sys_write return the length. Making it return 0 shows a slight improvement, but that's not how it's supposed to be.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;gt; Please also confirm target MCU, which version of LPCXpresso is being used and which debug probe.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;LPC1788, LPCXpresso v7.8.0 [Build 426] [2015-05-28], Link2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;And I'm using RedLib, obviously.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think I will just stick with my work-around; Stripping my application down and testing for reproductions would cost a lot of time. Thank you for offering anyway.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:21:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/vprintf-output-doesn-t-end-up-in-sys-write/m-p/563182#M17028</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: vprintf output doesn't end up in __sys_write</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/vprintf-output-doesn-t-end-up-in-sys-write/m-p/563183#M17029</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by lpcxpresso-support on Thu Jul 16 07:42:08 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;vprintf will output via a character at a time via a putc style interface.So if you stop on __sys_write, you should only ever see a len of 1 character being passed into it for output being made from vprintf. Anything beyond the first character in the buffer is hence basically random. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is your __sys_write function ignoring the len parameter?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;LPCXpresso Support&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:21:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/vprintf-output-doesn-t-end-up-in-sys-write/m-p/563183#M17029</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:21:42Z</dc:date>
    </item>
    <item>
      <title>Re: vprintf output doesn't end up in __sys_write</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/vprintf-output-doesn-t-end-up-in-sys-write/m-p/563184#M17030</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by MindBender on Fri Jul 17 04:41:58 MST 2015&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;No, it's not:&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;long console_send(char *buf, long len)
{
return UART_Send(this_uart, (uint8_t*)buf, len, BLOCKING);
}

int __sys_write(int file, char *buf, int len)
{
return console_send(buf, len);
}&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;SPAN&gt;But I may have had a couple of printf's throughout the code polluting the test result above.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Jun 2016 22:21:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/vprintf-output-doesn-t-end-up-in-sys-write/m-p/563184#M17030</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-15T22:21:43Z</dc:date>
    </item>
  </channel>
</rss>

