<?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>MQX Software Solutions中的主题 Re: Open / Close the Simple Memory Driver does not work</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/Open-Close-the-Simple-Memory-Driver-does-not-work/m-p/160668#M1205</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanky you. You point me to the right mistake.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 08 May 2012 19:32:47 GMT</pubDate>
    <dc:creator>soli</dc:creator>
    <dc:date>2012-05-08T19:32:47Z</dc:date>
    <item>
      <title>Open / Close the Simple Memory Driver does not work</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Open-Close-the-Simple-Memory-Driver-does-not-work/m-p/160666#M1203</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I run the following code in an infinity loop. So I install the driver for memory only the first time. Then I open the file, read the io_controll and close the file.&lt;/P&gt;&lt;P&gt;This works well until the first loops (maybe this are 900 or 1000 calls of the loop).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But then I will get a NULL-pointer from function _io_fopen(). Does anyone know what is going wrong here?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By the way: &amp;nbsp;When I have a look to the source code of MQX-function _io_mem_close, I can see this function will do nothing than return MQX_OK. But I think this should not be the problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;#define SIZE_OF_MEM        2000#define NAME_OF_DRIVE      "my:"uint32_t my_mem_init(void){    MQX_FILE_PTR    drive_p  = NULL;    static uint32_t mem_init_done   = 0;    uint32_t        size            = 0;    uint32_t        start_addr      = 0;    if ( mem_init_done == 0 )  {  if (_io_mem_install(NAME_OF_DRIVE, NULL, SIZE_OF_MEM) == MQX_OUT_OF_MEMORY)  {   printf("could not install drive\n");   return 1;  }  mem_init_done = 1;    }    //! Open the drive    drive_p = _io_fopen( NAME_OF_DRIVE, "r");    if ( drive_p == NULL )    {        printf("unable to open %s\n", NAME_OF_DRIVE);        return 1;    }    //!___check_________________________________________________________________    _io_ioctl(drive_p, IO_MEM_IOCTL_GET_TOTAL_SIZE,   &amp;amp;size);    _io_ioctl(drive_p, IO_MEM_IOCTL_GET_BASE_ADDRESS, &amp;amp;start_addr);    printf("drive installed: %u bytes @ addr. %x\n", size, start_addr);    //!___close_________________________________________________________________    _io_mem_close(drive_p);    return 0;}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Thanks for help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 09:06:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Open-Close-the-Simple-Memory-Driver-does-not-work/m-p/160666#M1203</guid>
      <dc:creator>soli</dc:creator>
      <dc:date>2020-10-29T09:06:06Z</dc:date>
    </item>
    <item>
      <title>Re: Open / Close the Simple Memory Driver does not work</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Open-Close-the-Simple-Memory-Driver-does-not-work/m-p/160667#M1204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If this is being called in an infinity loop maybe you need a _io_fclose(NAME_OF_DRIVE&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 May 2012 19:05:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Open-Close-the-Simple-Memory-Driver-does-not-work/m-p/160667#M1204</guid>
      <dc:creator>KJFPE</dc:creator>
      <dc:date>2012-05-08T19:05:54Z</dc:date>
    </item>
    <item>
      <title>Re: Open / Close the Simple Memory Driver does not work</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Open-Close-the-Simple-Memory-Driver-does-not-work/m-p/160668#M1205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanky you. You point me to the right mistake.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 May 2012 19:32:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Open-Close-the-Simple-Memory-Driver-does-not-work/m-p/160668#M1205</guid>
      <dc:creator>soli</dc:creator>
      <dc:date>2012-05-08T19:32:47Z</dc:date>
    </item>
  </channel>
</rss>

