📄 micrium support bug fixes - improvements.htm
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0053)http://www.ucos-ii.com/contents/support/bugfixes.html -->
<HTML><HEAD><TITLE>Micrium Support : Bug Fixes / Improvements</TITLE>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1"><LINK
href="Micrium Support Bug Fixes - Improvements.files/white-micrium3.css"
type=text/css rel=stylesheet>
<META
content=" Micrium is Empowering Embedded systems via ANSI C source code for RTOS, GUI, File System and TCP/IP stack. Book or manuals documentation format"
name=Description>
<META
content="Embedded Kernel, Embedded Operating System, Real time operating system, RTOS, Embedded Software, Embedded Systems, Kernel, Real Time Kernel, ROMable, RAM, ROM, EPROM, EEPROM, Scalable, Portability, Ports, Microprocessors, Microcontrollers, Context Switching, Task Switch, Task Scheduling, uC/OS, 礐/OS, PEG, Portable Embedded Graphical User Interface, Graphical User Interface, GUI, Embedded GUI, Embedded Graphical Display, LCD Display, Antialiasing, Fonts, Bitmaps, Display, widget, widgets, dialog, dialogs, windows, radio button, check box, scroll bar, slider,edit box, 礐/GUI, uC/GUI, File System, Flash, Loader, 礐/FS product page, Directory, 礐/FlashLoader, Flash, Memory, Load, Loader, Update, Open Source"
name=Keywords>
<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="Micrium Support Bug Fixes - Improvements.files/title-bugs.gif"
width=540></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=0 cellPadding=10 width="100%" border=0>
<TBODY>
<TR>
<TD align=left>
<P class=title><SPAN class=title>Version 2.52 is currently included with
the </SPAN><A
href="http://www.amazon.com/exec/obidos/ASIN/1578201039/ref=ase_jeanjlabro/002-0211709-1184060"><FONT
size=3>礐/OS-II book</FONT></A></P>
<P class=title><FONT color=#ff0000 size=3>The current version
of:</FONT></P>
<BLOCKQUOTE>
<P><FONT color=#ff0000 size=3><B>礐/OS-II is V2.70<BR>礐/OS-View is
V1.10<BR></B></FONT></P></BLOCKQUOTE></TD>
<TD align=left><A
href="http://www.amazon.com/exec/obidos/ASIN/1578201039/ref=ase_jeanjlabro/002-0211709-1184060"><IMG
height=136 alt="礐/OS-II Second Edition"
src="Micrium Support Bug Fixes - Improvements.files/MicroC-OS-II-2nd-Edition-15.jpg"
width=115 border=0></A></TD></TR>
<TR>
<TD align=left colSpan=2>
<P></P>
<P class=titleBIGGESTBIG>Special Notes</P>
<TABLE cellSpacing=0 cellPadding=3 width="100%" bgColor=#ced6f0
border=0><TBODY>
<TR>
<TD class=title>礐/OS-II: Alignments of Memory
Partitions</TD></TR></TBODY></TABLE>
<P>Some processors have problems with non word-aligned memory locations
for memory partitions. To prevent problems when creating memory
partitions, it is recommended that:</P>
<P>1) You allocate the memory blocks as <FONT
face="Courier New, Courier, mono">INT32U</FONT> arrays:<BR><BR><FONT
face="Courier New, Courier, mono">INT32U
MemPart1Tbl[MEM_BLKS_1][MEM_BLK_SIZE_1/sizeof(INT32U)];</FONT><BR><BR>2)
<FONT face="Courier New, Courier, mono">MEM_BLK_SIZE_1</FONT> in the
example above can still specify the number of BYTEs in the block BUT, it
should be a MULTIPLE of <FONT
face="Courier New, Courier, mono">sizeof(INT32U)</FONT>.</P>
<P></P>
<HR noShade>
<P class=titleBIGGESTBIG>Bugs corrected</P>
<BLOCKQUOTE>
<P></P></BLOCKQUOTE>
<P></P>
<TABLE cellSpacing=0 cellPadding=3 width="100%" bgColor=#ced6f0
border=0><TBODY>
<TR>
<TD class=title><FONT color=#0000ff><A name=ESBB></A>ESBB, Comm
Module</FONT><FONT color=#ff0000><FONT color=#000000>:</FONT></FONT>
COMM_PCA.ASM (V2.00-001)</TD></TR></TBODY></TABLE>
<P><B>COMM_PCA.ASM</B> needs to be changed if you use <B>礐/OS-II
V2.52</B> and higher. You can download the new code RIGHT-MOUSE clicking
<A
href="http://www.ucos-ii.com/contents/support/downloads/comm_pca.zip">HERE</A>.</P>
<P><BR></P>
<BLOCKQUOTE>
<P></P></BLOCKQUOTE>
<P></P>
<TABLE cellSpacing=0 cellPadding=3 width="100%" bgColor=#ced6f0
border=0><TBODY>
<TR>
<TD class=title><FONT color=#ff0000><A
name=uCOSIIView></A>礐/OS-View<FONT color=#000000>:</FONT></FONT>
OS_View.C (V1.10-003)</TD></TR></TBODY></TABLE>
<P>OSView_TxStart() in OS_View.C is missing the following statements (in
Red):</P>
<P>static void OSView_TxStart (void)<BR>{<BR><FONT color=#ff0000>#if
OS_CRITICAL_METHOD == 3<BR> OS_CPU_SR
cpu_sr;<BR>#endif</FONT></P>
<P><BR> OS_ENTER_CRITICAL();<BR> if
(OSView_TxActiveFlag == FALSE) {<BR>
OSView_TxHandler();<BR>
OSView_TxIntEn();<BR> }<BR>
OS_EXIT_CRITICAL();<BR>}<BR></P>
<TABLE cellSpacing=0 cellPadding=3 width="100%" bgColor=#ced6f0
border=0><TBODY>
<TR>
<TD class=title><FONT color=#ff0000>礐/OS-View</FONT>: OS_View.C
(V1.10-002)</TD></TR></TBODY></TABLE>
<P>The following case in OSView_RxHandler() should be changed because some
compilers/processors do not support 8-bit data types and, the checksum
test would fail when the sum exceeds 255. The code thus needs to be
changed from:</P>
<BLOCKQUOTE>
<P>case OS_VIEW_RX_STATE_CHKSUM: /* waiting for checksum */<BR>
OSView_RxChkSum += data;<BR> if (<FONT
color=#ff0000>OSView_RxChkSum == 0x00</FONT>) {<BR>
OSView_RxState = OS_VIEW_RX_STATE_ED;<BR> } else
{<BR> OSView_RxState =
OS_VIEW_RX_STATE_SD0;<BR> }<BR>
break;</P></BLOCKQUOTE>
<P>To:</P>
<BLOCKQUOTE>
<P>case OS_VIEW_RX_STATE_CHKSUM: /* waiting for checksum */<BR>
OSView_RxChkSum += data;<BR> if (<FONT
color=#ff0000>(OSView_RxChkSum & 0xFF) == 0x00</FONT>)
{<BR> OSView_RxState =
OS_VIEW_RX_STATE_ED;<BR> } else {<BR>
OSView_RxState = OS_VIEW_RX_STATE_SD0;<BR>
}<BR> break;</P>
<P> </P></BLOCKQUOTE>
<P></P>
<TABLE cellSpacing=0 cellPadding=3 width="100%" bgColor=#ced6f0
border=0><TBODY>
<TR>
<TD class=title><FONT color=#ff0000>礐/OS-View<FONT
color=#000000>:</FONT></FONT> OS_View.C
(V1.10-001)</TD></TR></TBODY></TABLE>
<P>OSView_Init() is missing THREE initializers:</P>
<P><FONT color=#ff0000>OSView_TxLen = 0;<BR>OSView_TxStrLen =
0;<BR>OSView_TxActiveFlag = FALSE;</FONT><BR></P>
<HR noShade>
<TABLE cellSpacing=0 cellPadding=3 width="100%" bgColor=#ced6f0
border=0><TBODY>
<TR>
<TD class=title><A name=uCOSII></A>礐/OS-II: OS_TASK.C
(V2.70-007)</TD></TR></TBODY></TABLE>
<P>In OSTaskQuery() we need to check to see if the TCB is assigned to a
Mutex. The code is <B><FONT color=#ff0000>RED</FONT></B> is added after
the check for 'ptcb' being a NULL pointer.</P>
<P></P>
<P></P>
<P>if (ptcb == (OS_TCB *)0) { /* Task to query must exist */<BR>
OS_EXIT_CRITICAL();<BR> return (OS_PRIO_ERR);<BR>}<BR><FONT
color=#ff0000>if (ptcb == (OS_TCB *)1) { /* Task to query must not be
assigned to a Mutex */<BR> OS_EXIT_CRITICAL();<BR> return
(OS_PRIO_ERR);<BR>}</FONT><BR></P>
<TABLE cellSpacing=0 cellPadding=3 width="100%" bgColor=#ced6f0
border=0><TBODY>
<TR>
<TD class=title><A name=uCOSII></A>礐/OS-II: OS_TASK.C
(V2.70-006)</TD></TR></TBODY></TABLE>
<P>In OSFlagPend() the returned 'flags_rdy' was not set correctly if you
didn't specify OS_FLAG_CONSUME. The new code for this function can be
downloaded here: <A
href="http://www.ucos-ii.com/contents/support/downloads/OSFlagPend.c">OSFlagPend.c</A>.</P>
<TABLE cellSpacing=0 cellPadding=3 width="100%" bgColor=#ced6f0
border=0><TBODY>
<TR>
<TD class=title><A name=uCOSII></A>礐/OS-II: OS_TASK.C
(V2.70-005)</TD></TR></TBODY></TABLE>
<P>In OSTaskNameGet() and OSTaskNameSet(), we were missing an
OS_EXIT_CRITICAL() before the exit of the first test. The code has been
corrected and the new OSTaskNameGet() and OSTaskNameSet() can be
downloaded here: <A
href="http://www.ucos-ii.com/contents/support/downloads/OSTaskNameXXX.c">OSTaskNameXXX.c</A>.</P>
<TABLE cellSpacing=0 cellPadding=3 width="100%" bgColor=#ced6f0
border=0><TBODY>
<TR>
<TD class=title><A name=uCOSII></A>礐/OS-II: OS_Q.C
(V2.70-004)</TD></TR></TBODY></TABLE>
<P>In OSQDel(), the first test should return 'pevent' instead of a NULL
pointer upon failure. The following code:</P>
<P>if (OSIntNesting > 0) { /* See if called from ISR ... */<BR>
*err = OS_ERR_DEL_ISR; /* ... can't DELETE from an ISR */<BR> return
((OS_EVENT *)0);<BR>}<BR></P>
<P>Should NOW be:<BR></P>
<P>if (OSIntNesting > 0) { /* See if called from ISR ... */<BR>
*err = OS_ERR_DEL_ISR; /* ... can't DELETE from an ISR */<BR><FONT
color=#ff0000> return (pevent);</FONT><BR>}<BR></P>
<TABLE cellSpacing=0 cellPadding=3 width="100%" bgColor=#ced6f0
border=0><TBODY>
<TR>
<TD class=title><A name=uCOSII></A>礐/OS-II: OS_MEM.C
(V2.70-003)</TD></TR></TBODY></TABLE>
<P>In OSQPostOpt(), the test for 'msg' being NULL must be DELETED. That's
because, as of V2.62, it's now possible to post NULL pointer messages to a
message queue. The following code:</P>
<P>#if OS_ARG_CHK_EN > 0<BR>if (pevent == (OS_EVENT *)0) { /* Validate
'pevent' */<BR> return (OS_ERR_PEVENT_NULL);<BR>}<BR><FONT
color=#ff0000>if (msg == (void *)0) { /* Make sure we are not posting a
NULL pointer */<BR> return
(OS_ERR_POST_NULL_PTR);<BR>}</FONT><BR>#endif</P>
<P>Should NOW be:<BR></P>
<P>#if OS_ARG_CHK_EN > 0<BR>if (pevent == (OS_EVENT *)0) { /* Validate
'pevent' */<BR> return (OS_ERR_PEVENT_NULL);<BR>}<BR>#endif<BR></P>
<TABLE cellSpacing=0 cellPadding=3 width="100%" bgColor=#ced6f0
border=0><TBODY>
<TR>
<TD class=title><A name=uCOSII></A>礐/OS-II: OS_MEM.C
(V2.70-002)</TD></TR></TBODY></TABLE>
<P>In OSMemNameSet(), a return statement is missing for the case when pmem
is NULL:</P>
<P>if (pmem == (OS_MEM *)0) { /* Is 'pmem' a NULL pointer? */<BR>
OS_EXIT_CRITICAL(); /* Yes */<BR> *err =
OS_MEM_INVALID_PMEM;<BR> <B><FONT
color=#ff0000>return</FONT></B>;<BR>}</P>
<TABLE cellSpacing=0 cellPadding=3 width="100%" bgColor=#ced6f0
border=0><TBODY>
<TR>
<TD class=title><A name=uCOSII></A>礐/OS-II: OS_TASK.C
(V2.70-001)</TD></TR></TBODY></TABLE>
<P>OSTaskResume() and OSTimeTick() were previously corrected thinking that
there were problems with them. It turns out that these functions were
correct in V2.70. This correct code can be found in the following
files:</P>
<P><A
href="http://www.ucos-ii.com/contents/support/downloads/OSTaskResume-V271.c">OSTaskResume-V271.c</A><BR><A
href="http://www.ucos-ii.com/contents/support/downloads/OSTimeTick-V271.c">OSTimeTick-V271.c</A><BR></P>
<HR noShade>
<BR>
<TABLE cellSpacing=0 cellPadding=3 width="100%" bgColor=#ced6f0
border=0><TBODY>
<TR>
<TD class=title><A name=uCOSII></A>礐/OS-II: OS_TASK.C
(V2.62-001)</TD></TR></TBODY></TABLE>
<P>In OSTaskDel(), we added a statement to clear the stack pointer of the
task being deleted. This statement appears on line 428 and should be
REMOVED. The code was added originally to show that the stack of a task
that has been deleted is no longer valid. This was to support Kernel
Awareness but was found to cause side effects. The line to delete is:</P>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -