<?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のトピックMQX 3.1.0 fails to compile with RTCS but without MFS</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-3-1-0-fails-to-compile-with-RTCS-but-without-MFS/m-p/176602#M2388</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 am compiling the BSP for M52259demo for the first time, and didn't make it very far.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After editing user_config.h and opening build_libs.mcp, I got this error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Error &amp;nbsp; : undefined identifier 'IO_IOCTL_CHECK_DIR_EXIST'&lt;/P&gt;&lt;P&gt;ftpd.c line 220 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; error = ioctl(session_ptr-&amp;gt;CURRENT_FS, IO_IOCTL_CHECK_DIR_EXIST,(pointer)FTPd_rootdir ); &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error &amp;nbsp; : undefined identifier 'IO_IOCTL_CHECK_DIR_EXIST'&lt;/P&gt;&lt;P&gt;ftpd.c line 220 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; error = ioctl(session_ptr-&amp;gt;CURRENT_FS, IO_IOCTL_CHECK_DIR_EXIST,(pointer)FTPd_rootdir ); &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Upon examining the source code, it looks like the intent was to allow for compilation of RTCS without MQX, but I don't see evidence of support for RTCS without MFS. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is that a valid assumption?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Glen&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Apr 2009 20:59:03 GMT</pubDate>
    <dc:creator>gmabey</dc:creator>
    <dc:date>2009-04-28T20:59:03Z</dc:date>
    <item>
      <title>MQX 3.1.0 fails to compile with RTCS but without MFS</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-3-1-0-fails-to-compile-with-RTCS-but-without-MFS/m-p/176602#M2388</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 am compiling the BSP for M52259demo for the first time, and didn't make it very far.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After editing user_config.h and opening build_libs.mcp, I got this error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Error &amp;nbsp; : undefined identifier 'IO_IOCTL_CHECK_DIR_EXIST'&lt;/P&gt;&lt;P&gt;ftpd.c line 220 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; error = ioctl(session_ptr-&amp;gt;CURRENT_FS, IO_IOCTL_CHECK_DIR_EXIST,(pointer)FTPd_rootdir ); &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error &amp;nbsp; : undefined identifier 'IO_IOCTL_CHECK_DIR_EXIST'&lt;/P&gt;&lt;P&gt;ftpd.c line 220 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; error = ioctl(session_ptr-&amp;gt;CURRENT_FS, IO_IOCTL_CHECK_DIR_EXIST,(pointer)FTPd_rootdir ); &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Upon examining the source code, it looks like the intent was to allow for compilation of RTCS without MQX, but I don't see evidence of support for RTCS without MFS. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is that a valid assumption?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Glen&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2009 20:59:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-3-1-0-fails-to-compile-with-RTCS-but-without-MFS/m-p/176602#M2388</guid>
      <dc:creator>gmabey</dc:creator>
      <dc:date>2009-04-28T20:59:03Z</dc:date>
    </item>
    <item>
      <title>Re: MQX 3.1.0 fails to compile with RTCS but without MFS</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-3-1-0-fails-to-compile-with-RTCS-but-without-MFS/m-p/176603#M2389</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Glen,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it is bug in 3.1.0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Description : In case FTPDCFG_USES_MFS is set to 0 in MQX user_config.h all references to MFS have to be leave out from compilation. Ftp server root directory is of such cases.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Problem will be fixed in 3.2.0 but in meantime you can fix it in&amp;nbsp;if you use following version of ftpd_task function in ftpd.c file :&lt;/P&gt;&lt;PRE&gt;
/*TASK*-----------------------------------------------------------------
*
* Function Name    : FTPd_task
* Returned Value   : none
* Comments  :  FTP server.
*
*END*-----------------------------------------------------------------*/

void FTPd_task
   (
      pointer  init_ptr,
      pointer creator
   )
{ /* Body */
   FTPd_CONTEXT               ftpd_context =  { 0 };
   sockaddr_in                laddr;
   uint_32                    sock, listensock;
   uint_32                    error=RTCS_OK;
   uint_16                    remote_addr_len;
   sockaddr_in                remote_addr = {0};
   TASK_TEMPLATE_STRUCT_PTR   t_ptr;
   FTPd_SESSION_PTR           session_ptr;
   uint_32                    option;
   boolean                    dev_in_path = FALSE;
   int_16                     devlen = 0, rootdirlen = 0;

   FTPd_task_id = RTCS_task_getid();
#ifdef __MQX__
   /* Set up exit handler and context so that we can clean up if the FTP Server is terminated */
   _task_set_environment( _task_get_id(), (pointer) &amp;amp;ftpd_context );
   _task_set_exit_handler( _task_get_id(), FTPd_Exit_handler );
#endif
   t_ptr = _task_get_template_ptr(MQX_NULL_TASK_ID);

   laddr.sin_family      = AF_INET;
   laddr.sin_port        = IPPORT_FTP;
   laddr.sin_addr.s_addr = INADDR_ANY;

   /* Listen on TCP port */
   ftpd_context.LISTENSOCK = socket(PF_INET, SOCK_STREAM, 0);
   listensock = ftpd_context.LISTENSOCK;
   if (listensock == RTCS_SOCKET_ERROR) {
      error = RTCSERR_OUT_OF_SOCKETS;
   }
  
   if (!error) {
      option = FTPd_window_size;  
      error = setsockopt(listensock, SOL_TCP, OPT_TBSIZE, &amp;amp;option, sizeof(option));
   }
  
   if (!error) {
      option = FTPd_window_size;  
      error = setsockopt(listensock, SOL_TCP, OPT_RBSIZE, &amp;amp;option, sizeof(option));
   }     

   if (!error) {
      option = FTPDCFG_SEND_TIMEOUT;  
      error = setsockopt(listensock, SOL_TCP, OPT_SEND_TIMEOUT, &amp;amp;option, sizeof(option));
   }  

   if (!error) {
      option = FTPDCFG_CONNECT_TIMEOUT;  
      error = setsockopt(listensock, SOL_TCP, OPT_CONNECT_TIMEOUT, &amp;amp;option, sizeof(option));
   }  

   if (!error) {
      option = FTPDCFG_TIMEWAIT_TIMEOUT;  
      error = setsockopt(listensock, SOL_TCP, OPT_TIMEWAIT_TIMEOUT, &amp;amp;option, sizeof(option));
   }  

   if (!error) {
      error = bind(listensock, &amp;amp;laddr, sizeof(laddr));
   }

   if (!error) {
      error = listen(listensock, 0);
   }

   if (error) {
      RTCS_task_exit(creator, error);
   }
   RTCS_task_resume_creator(creator, RTCS_OK);

   for (;;) {

      /* Connection requested; accept it */
      remote_addr_len = sizeof(remote_addr);
      sock = accept(listensock, &amp;amp;remote_addr, &amp;amp;remote_addr_len);
     
      if ((sock != 0) &amp;amp;&amp;amp; (sock!=RTCS_SOCKET_ERROR)) {
         session_ptr = (FTPd_SESSION_PTR) RTCS_mem_alloc_zero(sizeof (FTPd_SESSION_STRUCT));

         if ( session_ptr ) {
            _mem_set_type(session_ptr, MEM_TYPE_FTPd_SESSION_PTR);

            session_ptr-&amp;gt;DATA_BUFFER_SIZE = FTPd_buffer_size;
            session_ptr-&amp;gt;DATA_BUFFER_PTR = RTCS_mem_alloc_zero(session_ptr-&amp;gt;DATA_BUFFER_SIZE);
            if (session_ptr-&amp;gt;DATA_BUFFER_PTR == NULL) {
               _mem_free(session_ptr);
               session_ptr = NULL;
            } else {
               _mem_set_type(session_ptr-&amp;gt;DATA_BUFFER_PTR, MEM_TYPE_FTPd_DATA_BUFFER);
            }
         }
           
           
         if (session_ptr == NULL) {
            shutdown((uint_32)sock, FTPDCFG_SHUTDOWN_OPTION);
         } else  {
     

            session_ptr-&amp;gt;CONTROL_SOCK = (uint_32) sock;
            session_ptr-&amp;gt;CONNECTED = TRUE;
            /* set default data ports */
            session_ptr-&amp;gt;SERVER_DATA_SOCKADDR.sin_family      = AF_INET;
            session_ptr-&amp;gt;SERVER_DATA_SOCKADDR.sin_port        = IPPORT_FTPDATA;
            session_ptr-&amp;gt;SERVER_DATA_SOCKADDR.sin_addr.s_addr = INADDR_ANY;

            session_ptr-&amp;gt;USER_DATA_SOCKADDR.sin_family      = remote_addr.sin_family;
            session_ptr-&amp;gt;USER_DATA_SOCKADDR.sin_port        = remote_addr.sin_port;
            session_ptr-&amp;gt;USER_DATA_SOCKADDR.sin_addr.s_addr = remote_addr.sin_addr.s_addr;

#if FTPDCFG_USES_MFS
            //initialize current directory and current filesystem
            devlen = _io_get_dev_for_path(session_ptr-&amp;gt;CURRENT_FS_NAME,
                        &amp;amp;dev_in_path,
                        FTPD_DEVLEN,
                        (char *)FTPd_rootdir,
                        NULL);
                       
            session_ptr-&amp;gt;CURRENT_FS = _io_get_fs_by_name(session_ptr-&amp;gt;CURRENT_FS_NAME);
           
            error = ioctl(session_ptr-&amp;gt;CURRENT_FS, IO_IOCTL_CHECK_DIR_EXIST,(pointer)FTPd_rootdir ); 
           
            if (error)  {
#endif           
               session_ptr-&amp;gt;CURRENT_FS = NULL;
               session_ptr-&amp;gt;CURRENT_FTP_DIR = NULL;
               session_ptr-&amp;gt;CURRENT_FS_DIR[0] = '\0';
#if FTPDCFG_USES_MFS              
            } else {
               // set current fs dir (including root dir)
               strcpy(session_ptr-&amp;gt;CURRENT_FS_DIR,FTPd_rootdir+devlen);
              
               rootdirlen = strlen(session_ptr-&amp;gt;CURRENT_FS_DIR);

               // set current FTP dir
               session_ptr-&amp;gt;CURRENT_FTP_DIR = session_ptr-&amp;gt;CURRENT_FS_DIR + rootdirlen - 1;
              
               //check if there is / at the end of root dir name
               if(*(session_ptr-&amp;gt;CURRENT_FTP_DIR) != '\\' &amp;amp;&amp;amp;
                  *(session_ptr-&amp;gt;CURRENT_FTP_DIR) != '/')
               {
                  session_ptr-&amp;gt;CURRENT_FTP_DIR++;
               }
             session_ptr-&amp;gt;CURRENT_FTP_DIR[0] = '\\';
             session_ptr-&amp;gt;CURRENT_FTP_DIR[1] = '\0';
            }
#endif                    
            #if FTPDCFG_ENABLE_MULTIPLE_CLIENTS
               /* Create a task to look after it */
               RTCS_detachsock(sock);
               if (RTCS_task_create("FTPd_child", t_ptr-&amp;gt;TASK_PRIORITY, t_ptr-&amp;gt;TASK_STACKSIZE, FTPd_child, (pointer) session_ptr) != RTCS_OK ) {
                  RTCS_attachsock(sock);
                  shutdown(sock, FLAG_ABORT_CONNECTION);
                  _mem_free(session_ptr-&amp;gt;DATA_BUFFER_PTR);
                  _mem_free(session_ptr);
            #else
               FTPd_child((pointer) session_ptr,0);
            #endif

         }        
      }
   }
}&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;PetrL&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:25:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-3-1-0-fails-to-compile-with-RTCS-but-without-MFS/m-p/176603#M2389</guid>
      <dc:creator>PetrL</dc:creator>
      <dc:date>2020-10-29T09:25:30Z</dc:date>
    </item>
    <item>
      <title>Re: MQX 3.1.0 fails to compile with RTCS but without MFS</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-3-1-0-fails-to-compile-with-RTCS-but-without-MFS/m-p/176604#M2390</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;Thank you, PetrL. &amp;nbsp;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2009 22:23:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-3-1-0-fails-to-compile-with-RTCS-but-without-MFS/m-p/176604#M2390</guid>
      <dc:creator>gmabey</dc:creator>
      <dc:date>2009-04-28T22:23:36Z</dc:date>
    </item>
  </channel>
</rss>

