<?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 How to customize 'FILE' operations on a 9S12XDP512 under CodeWarrier 5.9.0 and Metroworks C in Classic/Legacy CodeWarrior</title>
    <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/How-to-customize-FILE-operations-on-a-9S12XDP512-under/m-p/325243#M6718</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Starting with this statement in my application:&lt;/P&gt;&lt;DIV class="j-rte-table"&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style=""&gt;&lt;/TD&gt;&lt;TD style=""&gt;&lt;P&gt;USBDevice = fopen("USB1:", "r+");&amp;nbsp; // Calls TERMIO_Init()&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;P&gt;Following fopen(LIBDEF_ConstStringPtr name, LIBDEF_ConstStringPtr mode) in the debugger I find I'm taken to TERMIO_Init() without any arguments to let me expand on the file i/o system.&amp;nbsp; The code for this is in embedded.c.&amp;nbsp; Not only that, stdlib.c has the one single declaration for FILE channels[1];&amp;nbsp; In stdio.h we have extern FILE channels[1]; and the FILE struct itself declared in stdio.h.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I'd like to be able to do is handle multiple FILE channels so I can support the two UARTs, a USB connection and possibly a few others.&amp;nbsp; To do that it looks like I have to remove embedded.c and recompile into the library the stdlib.c to get rid of the channels declaration.&amp;nbsp; Shouldn't really be there in the first place since it's not used within the entire library that I can find with grep.&lt;/P&gt;&lt;P&gt;The run time library routines all have&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Copyright (c) Metrowerks, Basel, Switzerland&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; All rights reserved&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Do not modify!&lt;/P&gt;&lt;P&gt;So is there by chance an application note with code that has most of the work done to redirect the system functions like fopen, close, fputc etc. as contained in embedded.c?&lt;/P&gt;&lt;P&gt;Or am I on my own here?&lt;/P&gt;&lt;P&gt;The longer term project is to possibly add SD card and file name support.&amp;nbsp; Perhaps there's an app note that handles the fopen with file names?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 26 Jul 2014 04:09:38 GMT</pubDate>
    <dc:creator>jcdammeyer</dc:creator>
    <dc:date>2014-07-26T04:09:38Z</dc:date>
    <item>
      <title>How to customize 'FILE' operations on a 9S12XDP512 under CodeWarrier 5.9.0 and Metroworks C</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/How-to-customize-FILE-operations-on-a-9S12XDP512-under/m-p/325243#M6718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Starting with this statement in my application:&lt;/P&gt;&lt;DIV class="j-rte-table"&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style=""&gt;&lt;/TD&gt;&lt;TD style=""&gt;&lt;P&gt;USBDevice = fopen("USB1:", "r+");&amp;nbsp; // Calls TERMIO_Init()&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/DIV&gt;&lt;P&gt;Following fopen(LIBDEF_ConstStringPtr name, LIBDEF_ConstStringPtr mode) in the debugger I find I'm taken to TERMIO_Init() without any arguments to let me expand on the file i/o system.&amp;nbsp; The code for this is in embedded.c.&amp;nbsp; Not only that, stdlib.c has the one single declaration for FILE channels[1];&amp;nbsp; In stdio.h we have extern FILE channels[1]; and the FILE struct itself declared in stdio.h.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I'd like to be able to do is handle multiple FILE channels so I can support the two UARTs, a USB connection and possibly a few others.&amp;nbsp; To do that it looks like I have to remove embedded.c and recompile into the library the stdlib.c to get rid of the channels declaration.&amp;nbsp; Shouldn't really be there in the first place since it's not used within the entire library that I can find with grep.&lt;/P&gt;&lt;P&gt;The run time library routines all have&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Copyright (c) Metrowerks, Basel, Switzerland&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; All rights reserved&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Do not modify!&lt;/P&gt;&lt;P&gt;So is there by chance an application note with code that has most of the work done to redirect the system functions like fopen, close, fputc etc. as contained in embedded.c?&lt;/P&gt;&lt;P&gt;Or am I on my own here?&lt;/P&gt;&lt;P&gt;The longer term project is to possibly add SD card and file name support.&amp;nbsp; Perhaps there's an app note that handles the fopen with file names?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 26 Jul 2014 04:09:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/How-to-customize-FILE-operations-on-a-9S12XDP512-under/m-p/325243#M6718</guid>
      <dc:creator>jcdammeyer</dc:creator>
      <dc:date>2014-07-26T04:09:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to customize 'FILE' operations on a 9S12XDP512 under CodeWarrier 5.9.0 and Metroworks C</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/How-to-customize-FILE-operations-on-a-9S12XDP512-under/m-p/325244#M6719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello John,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Times New Roman','serif';"&gt;We can not use FILE operations in CW for HCS12. It is not possible since there is NO "standard output" in embedded system. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Times New Roman','serif';"&gt;normally FILE operations need RTOS support. for example, MQX. however MQX can't support hcs12(x) device because its limited resource. other Freescale device such as Kinetis can support FILE operations with MQX support.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Times New Roman','serif';"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.0pt; font-family: 'Times New Roman','serif';"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Zhang Jun&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;==============================================&lt;/P&gt;&lt;P&gt;this answer is for you. if it helps, please click on "correct answer " button. thanks!&lt;/P&gt;&lt;P&gt;==============================================&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jul 2014 08:55:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/How-to-customize-FILE-operations-on-a-9S12XDP512-under/m-p/325244#M6719</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2014-07-30T08:55:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to customize 'FILE' operations on a 9S12XDP512 under CodeWarrier 5.9.0 and Metroworks C</title>
      <link>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/How-to-customize-FILE-operations-on-a-9S12XDP512-under/m-p/325245#M6720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Jan 2015 02:57:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Classic-Legacy-CodeWarrior/How-to-customize-FILE-operations-on-a-9S12XDP512-under/m-p/325245#M6720</guid>
      <dc:creator>jcdammeyer</dc:creator>
      <dc:date>2015-01-02T02:57:25Z</dc:date>
    </item>
  </channel>
</rss>

