<?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>topic Re: Redirect printf() in S32 Design Studio</title>
    <link>https://community.nxp.com/t5/S32-Design-Studio/Redirect-printf/m-p/924323#M5082</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alexander,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply. I am not really doing anything interesting in my project, I just print out the chars that I get in write() function. So write is the only "low level" function that I have implemented and that obviously works. All the rest, as you say, is handled by newlib functions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Doing conversions with functions like sprintf, itoa does not work either. They just return \0 regardless, just like printf().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you perhaps try and redirect the printf() with the tools and newlib (compiled for power-PC) version&amp;nbsp;that I am currently using?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could be a good project to share to everyone as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mathias&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;UPDATE1***&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I based my project on an example project that merges binaries for both cores into one elf. I suspect that something is wrong with the link script in this project. When I created a new project (one project for each core) and added software for UART and newlib everything works as it should. If I find more details about this problem I will post them in this thread.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 21 Oct 2019 08:03:23 GMT</pubDate>
    <dc:creator>mathias_edman</dc:creator>
    <dc:date>2019-10-21T08:03:23Z</dc:date>
    <item>
      <title>Redirect printf()</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/Redirect-printf/m-p/924320#M5079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi NXP,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to redirect the printf() to Uart. I am using S32 studio (Version: 2017.R1 Build id: 171018)&amp;nbsp; with gnu toolchain and MPC5777C and I have tried with pretty much every possible combination of newlib and ewl with lower layer functions such as _write(), _read(), write(), read(),_sbrk(),&amp;nbsp;_open(),&amp;nbsp; _isatty(),&amp;nbsp;_fstat(), __read_console, __write_console etc. etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Usually in other projects, I manage to do this simply using read() write() functions with newlib, but this does not seem to work correctly using S32 studio with the MCU I work with currently.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With newlib I can get printf() to work and it will call write() and read(), but for some reason using %d and similar will return null chars like below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;printf("number %d %s", 57, "MCU");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Result:&lt;/P&gt;&lt;P&gt;'n', 'u', 'm', 'b', 'e', 'r', ' ', \0, \0, ' ', 'M', 'C', 'U'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there some kind of magic involved here that I need to understand in order to get this up and running?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mathias&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Sep 2019 16:03:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/Redirect-printf/m-p/924320#M5079</guid>
      <dc:creator>mathias_edman</dc:creator>
      <dc:date>2019-09-27T16:03:40Z</dc:date>
    </item>
    <item>
      <title>Re: Redirect printf()</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/Redirect-printf/m-p/924321#M5080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Anyone?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Oct 2019 07:57:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/Redirect-printf/m-p/924321#M5080</guid>
      <dc:creator>mathias_edman</dc:creator>
      <dc:date>2019-10-03T07:57:17Z</dc:date>
    </item>
    <item>
      <title>Re: Redirect printf()</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/Redirect-printf/m-p/924322#M5081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you share your project that reproduces problem. Since this functionality uses standard newlib routines, I tend believe there is a problem in your low layer implementation.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Oct 2019 09:28:48 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/Redirect-printf/m-p/924322#M5081</guid>
      <dc:creator>alexanderfedoto</dc:creator>
      <dc:date>2019-10-04T09:28:48Z</dc:date>
    </item>
    <item>
      <title>Re: Redirect printf()</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/Redirect-printf/m-p/924323#M5082</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Alexander,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply. I am not really doing anything interesting in my project, I just print out the chars that I get in write() function. So write is the only "low level" function that I have implemented and that obviously works. All the rest, as you say, is handled by newlib functions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Doing conversions with functions like sprintf, itoa does not work either. They just return \0 regardless, just like printf().&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you perhaps try and redirect the printf() with the tools and newlib (compiled for power-PC) version&amp;nbsp;that I am currently using?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could be a good project to share to everyone as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mathias&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;UPDATE1***&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I based my project on an example project that merges binaries for both cores into one elf. I suspect that something is wrong with the link script in this project. When I created a new project (one project for each core) and added software for UART and newlib everything works as it should. If I find more details about this problem I will post them in this thread.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Oct 2019 08:03:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/Redirect-printf/m-p/924323#M5082</guid>
      <dc:creator>mathias_edman</dc:creator>
      <dc:date>2019-10-21T08:03:23Z</dc:date>
    </item>
  </channel>
</rss>

