<?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 fopen always return NULL (AN3905) in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/fopen-always-return-NULL-AN3905/m-p/267883#M8128</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to learn how to work with MQX. I am trying write basic example&amp;nbsp; "Writing your first application AN3905".&lt;/P&gt;&lt;P&gt;I have problem in the function InitializeIO(); fopen function always return NULL. It is doesn't make sense continue.&lt;/P&gt;&lt;P&gt;What are reasons (What can be) to return NULL in the function fopen?&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;const uint_32 output_set[] =&lt;/P&gt;&lt;P&gt;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp; LED_1 | GPIO_PIN_STATUS_0,&lt;/P&gt;&lt;P&gt;&amp;nbsp; LED_2 | GPIO_PIN_STATUS_0,&lt;/P&gt;&lt;P&gt;&amp;nbsp; LED_3 | GPIO_PIN_STATUS_0,&lt;/P&gt;&lt;P&gt;&amp;nbsp; LED_4 | GPIO_PIN_STATUS_0,&lt;/P&gt;&lt;P&gt;&amp;nbsp; GPIO_LIST_END&lt;/P&gt;&lt;P&gt;&amp;nbsp; };&lt;/P&gt;&lt;P&gt;&amp;nbsp; output_port = fopen("gpio:write", (char_ptr) &amp;amp;output_set);&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ondra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 15 Apr 2013 18:32:26 GMT</pubDate>
    <dc:creator>Seitec</dc:creator>
    <dc:date>2013-04-15T18:32:26Z</dc:date>
    <item>
      <title>fopen always return NULL (AN3905)</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/fopen-always-return-NULL-AN3905/m-p/267883#M8128</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to learn how to work with MQX. I am trying write basic example&amp;nbsp; "Writing your first application AN3905".&lt;/P&gt;&lt;P&gt;I have problem in the function InitializeIO(); fopen function always return NULL. It is doesn't make sense continue.&lt;/P&gt;&lt;P&gt;What are reasons (What can be) to return NULL in the function fopen?&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;const uint_32 output_set[] =&lt;/P&gt;&lt;P&gt;&amp;nbsp; {&lt;/P&gt;&lt;P&gt;&amp;nbsp; LED_1 | GPIO_PIN_STATUS_0,&lt;/P&gt;&lt;P&gt;&amp;nbsp; LED_2 | GPIO_PIN_STATUS_0,&lt;/P&gt;&lt;P&gt;&amp;nbsp; LED_3 | GPIO_PIN_STATUS_0,&lt;/P&gt;&lt;P&gt;&amp;nbsp; LED_4 | GPIO_PIN_STATUS_0,&lt;/P&gt;&lt;P&gt;&amp;nbsp; GPIO_LIST_END&lt;/P&gt;&lt;P&gt;&amp;nbsp; };&lt;/P&gt;&lt;P&gt;&amp;nbsp; output_port = fopen("gpio:write", (char_ptr) &amp;amp;output_set);&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ondra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Apr 2013 18:32:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/fopen-always-return-NULL-AN3905/m-p/267883#M8128</guid>
      <dc:creator>Seitec</dc:creator>
      <dc:date>2013-04-15T18:32:26Z</dc:date>
    </item>
    <item>
      <title>Re: fopen always return NULL (AN3905)</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/fopen-always-return-NULL-AN3905/m-p/267884#M8129</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ondra,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MQX fopen() returns NULL when an I/O driver with the given name can't be found, means it has not been installed with MQX I/O subsystem. Typically this can happen when the driver is not enabled by the build time user configuration, user_config.h file for your BSP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you trying to use this with MQX 4.0 ? The "gpio:write" driver is considered as legacy, it is kept in MQX 4.0 for backward compatibility. To enable it, user_config.h has to define:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_1366098301376474" jivemacro_uid="_1366098301376474"&gt;
&lt;P&gt;#define BSPCFG_ENABLE_GPIODEV 1&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and rebuild your BSP project. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is lightweight version of gpio driver, called lwgpio, and MQX 4.0 has an example for it under&lt;/P&gt;&lt;P&gt;/mqx/examples/gpio/gpio.c&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Apr 2013 07:46:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/fopen-always-return-NULL-AN3905/m-p/267884#M8129</guid>
      <dc:creator>Martin_</dc:creator>
      <dc:date>2013-04-16T07:46:49Z</dc:date>
    </item>
    <item>
      <title>Re: fopen always return NULL (AN3905)</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/fopen-always-return-NULL-AN3905/m-p/267885#M8130</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Martin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes I am using MQX 4.0.&lt;/P&gt;&lt;P&gt;I have tried lwgpio and it works.&lt;/P&gt;&lt;P&gt;Thank you very much.&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ondra&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 16 Apr 2013 18:34:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/fopen-always-return-NULL-AN3905/m-p/267885#M8130</guid>
      <dc:creator>Seitec</dc:creator>
      <dc:date>2013-04-16T18:34:16Z</dc:date>
    </item>
  </channel>
</rss>

