⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 micrium1.htm

📁 网上下载的一些心得集 网友交流之经验谈 uCOS51移植心得 uCOS-II 在 ARM7 上的移植
💻 HTM
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0055)http://www.ucos-ii.com/contents/support/faqs-test1.html -->
<HTML><HEAD><TITLE>Micrium</TITLE>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1"><LINK 
href="Micrium1.files/white-micrium3.css" type=text/css rel=stylesheet>
<META content="MSHTML 6.00.2800.1106" name=GENERATOR></HEAD>
<BODY text=#000000 bgColor=#ffffff leftMargin=0 topMargin=0 marginheight="0" 
marginwidth="0">
<TABLE cellSpacing=0 cellPadding=0 width="100%" bgColor=#ffffff border=0>
  <TBODY>
  <TR>
    <TD><IMG height=30 src="Micrium1.files/title-faqs.gif" 
  width=540></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=10 width=600 border=0>
  <TBODY>
  <TR>
    <TD>
      <P><BIG><STRONG><A 
      href="http://www.ucos-ii.com/contents/support/faqs-test1.html#FAQ-01">FAQ-01</A>: 
      </STRONG><B>My computer/processor 'hangs' when I run 礐/OS or 
      礐/OS-II!</B><FONT color=#0000ff> <BR></FONT></BIG><STRONG><BR><A 
      href="http://www.ucos-ii.com/contents/support/faqs-test1.html#FAQ-02"><BIG>FAQ-02</BIG></A><BIG>: 
      </BIG></STRONG><BIG><STRONG>Are you allowed to send a NULL-pointer through 
      a Mailbox or a 
      Queue</STRONG><BIG>?<BR></BIG><STRONG><BR></STRONG></BIG><STRONG><A 
      href="http://www.ucos-ii.com/contents/support/faqs-test1.html#FAQ-03"><BIG>FAQ-03</BIG></A><BIG>: 
      Where should I enable the 'tick' 
      interrupt?</BIG></STRONG><BIG><STRONG><BR></STRONG></BIG><STRONG><BIG><BIG><BR></BIG></BIG><A 
      href="http://www.ucos-ii.com/contents/support/faqs-test1.html#FAQ-04"><BIG>FAQ-04</BIG></A><BIG>: 
      </BIG></STRONG><BIG><STRONG>Does 礐/OS and 礐/OS-II work with Microsoft 
      C/C++?<BR></STRONG></BIG><STRONG><BIG><BIG><BR></BIG></BIG><A 
      href="http://www.ucos-ii.com/contents/support/faqs-test1.html#FAQ-06"><BIG>FAQ-05</BIG></A><BIG>: 
      </BIG></STRONG><BIG><STRONG>Are there other ports available for 礐/OS and 
      礐/OS-II?</STRONG></BIG> </P>
      <P align=left><STRONG><A 
      href="http://www.ucos-ii.com/contents/support/faqs-test1.html#FAQ-06"><BIG>FAQ-06</BIG></A><BIG>: 
      Is there a better way to implement OSIntCtxSw() and 
      ISRs?<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
      </BIG></STRONG><BIG><FONT color=#0000ff>(Added 2001/01/26)</FONT></BIG> 
      </P>
      <P align=left> </P>
      <TABLE width="100%" border=1>
        <TBODY>
        <TR>
          <TD width="100%" bgColor=#c0c0c0>
            <P align=left><BIG><STRONG>FAQ-01: My computer/processor 'hangs' 
            when I run 礐/OS or 礐/OS-II!</STRONG></BIG><A 
          name=FAQ-01></A></P></TD></TR></TBODY></TABLE>
      <P align=left><FONT size=4>DOS executables for 礐/OS and 礐/OS-II are 
      provided on the diskette. If 礐/OS (or 礐/OS-II) still hangs with the 
      executable provided on the floppy, try to contact me at <A 
      href="mailto:Jean.Labrosse@uCOS-II.com">Jean.Labrosse@uCOS-II.com</A>. If 
      礐/OS (or 礐/OS-II) does not hang with the executable provided on the 
      floppy then there are two possible reasons your computer could 
      crash:</FONT> </P>
      <P align=left><FONT size=4><FONT color=#ff0000><B>1) </B></FONT>You need 
      to look at <FONT face="Courier New"><STRONG>OSIntCtxSw</STRONG></FONT> 
      (pages 62, 63 and 67 in the 礐/OS book or pages 200 and 201 in 礐/OS-II) 
      which is processor and compiler specific.&nbsp; The very first instruction 
      in <STRONG><FONT face="Courier New">OSIntCtxSw()</FONT></STRONG> may need 
      some adjustment, i.e. <FONT face="Courier New"><STRONG>ADD 
      SP,8</STRONG></FONT>.&nbsp; If you use another processor, compiler or 
      memory model, you may need to adjust the constant.&nbsp;&nbsp; This 
      section in the book will explain how to determine the 'magic number' to 
      add to the stack pointer.&nbsp;&nbsp;</FONT> </P>
      <P align=left><FONT size=4>The actual value depends on the compiler used 
      and the compiler options. &nbsp; For example, on the x86 real-mode small 
      model, the constant can be either 4, 6, 8, 10 ...&nbsp; For the x86 
      real-mode, large model, the constant can be either 8, 10, 12, 14, 16 
      ...</FONT></P>
      <P align=left><FONT size=4><FONT color=#ff0000><B>2)</B></FONT> You may 
      want to try removing ANY (and ALL) floating-point operation.&nbsp; The 
      sample code in example #1 (礐/OS V1.xx and 礐/OS-II V2.00) has a 
      floating-point operation in the start task.&nbsp; Comment it out (by 
      putting <FONT face="Courier New"><STRONG>#if 0</STRONG></FONT> / <FONT 
      face="Courier New"><STRONG>#endif</STRONG></FONT> around the <FONT 
      face="Courier New"><STRONG>sprintf()</STRONG> </FONT>statement) and try 
      compiling and running the code.&nbsp; If the code works, the crash is due 
      to the fact that:<BR><BR>&nbsp;&nbsp;&nbsp; a) The Borland C/C++ 
      floating-point library is non-reentrant.<BR>&nbsp;&nbsp;&nbsp; b) 礐/OS 
      and 礐/OS-II's task stacks need to be initialized to perform 
      floating-point operations in a </FONT><BIG><BIG>reentrant way.&nbsp; Refer 
      to <B><FONT color=#ff0000>AN-1001</FONT></B> for details (See <A 
      href="http://www.ucos-ii.com/contents/support/support-app_notes.htm">AppNotes</A>). 
      </BIG></BIG></P>
      <P align=left><FONT color=#ff0000 size=4><B>3</B></FONT><FONT size=4><FONT 
      color=#ff0000><B>)</B></FONT> See </FONT><A 
      href="http://www.ucos-ii.com/contents/support/faqs-test1.html#FAQ-06"><B><FONT 
      color=#ff0000 size=5>FAQ-06</FONT></B></A><FONT size=4>.<BR></FONT></P>
      <P align=left><A 
      href="http://www.ucos-ii.com/contents/support/faqs-test1.html#TOP"><IMG 
      height=30 src="" width=67 border=0></A><BR></P>
      <TABLE width="100%" border=1>
        <TBODY>
        <TR>
          <TD width="100%" bgColor=#c0c0c0>
            <P align=left><BIG><STRONG>FAQ-02: Are you allowed to send a 
            NULL-pointer through a Mailbox or a Queue?</STRONG></BIG><A 
            name=FAQ-02></A></P></TD></TR></TBODY></TABLE>
      <P align=left><FONT size=4>No.&nbsp; By definition, a NULL-pointer is not 
      supposed to point to any valid data.&nbsp; You could, however, 'fake' 
      礐/OS (or 礐/OS-II) into sending <FONT 
      face="Courier New"><STRONG>NULL</STRONG></FONT> pointers.&nbsp; You will 
      need to 're-map' a NULL pointer to another 'invalid' pointer.&nbsp; For 
      example, if you want to send a <FONT 
      face="Courier New"><STRONG>NULL</STRONG></FONT> through a message mailbox, 
      you can do the following:</FONT></P>
      <P align=left><FONT face="Courier New" size=2>void SenderTask (void 
      *pdata)<BR>{<BR>&nbsp;&nbsp;&nbsp; .<BR>&nbsp;&nbsp;&nbsp; 
      .<BR>&nbsp;&nbsp;&nbsp; if (msg == (void *)0) { 
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
      /* Do I want to send a NULL pointer ?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
      */<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; msg = (void *)0xFFFFFFFF; 
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* Yes, remap to another 'invalid' 
      pointer */<BR>&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp; OSMboxPost(Mbox, 
      msg);<BR>&nbsp;&nbsp;&nbsp; .<BR>&nbsp;&nbsp;&nbsp; .<BR>}<BR><BR><BR>void 
      ReceiverTask (void *pdata)<BR>{<BR>&nbsp;&nbsp;&nbsp; void 
      *msg;<BR><BR>&nbsp;&nbsp;&nbsp; .<BR>&nbsp;&nbsp;&nbsp; 
      .<BR>&nbsp;&nbsp;&nbsp; msg = OSMboxPend(Mbox, 0, &amp;err); 
      <BR>&nbsp;&nbsp;&nbsp; if (err == OS_NO_ERR) 
      {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (msg == (void 
      *)0xFFFFFFFF) { /* Did I receive a NULL pointer ? 
      */<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
      msg = (void *)0;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
      }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
      .<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .<BR>&nbsp;&nbsp;&nbsp; 
      }<BR>&nbsp;&nbsp;&nbsp; .<BR>&nbsp;&nbsp;&nbsp; .<BR>} </FONT></P>
      <P align=left><A 
      href="http://www.ucos-ii.com/contents/support/faqs-test1.html#TOP"><IMG 
      height=30 src="" width=67 border=0></A></P><BIG><BIG>
      <TABLE width="100%" border=1>
        <TBODY>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -