9
0
Fork 0

Finished C5471 Integration

git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@48 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
patacongo 2007-03-09 17:22:55 +00:00
parent 6e9f9277ef
commit c9f3b566bc
8 changed files with 78 additions and 64 deletions

5
nuttx/ChangeLog Normal file
View File

@ -0,0 +1,5 @@
0.1.0 2007-03-09 Gregory Nutt <spudmonkey@racsa.co.cr>
* Initial Release
* Support for Linux user mode simulation and TI
TMS320C5471 (Arm7) provided

View File

@ -28,8 +28,8 @@
NuttX operates on the ARM7 of this dual core processor. NuttX operates on the ARM7 of this dual core processor.
This port uses the <a href="http://www.spectrumdigital.com/">Spectrum Digital</a> This port uses the <a href="http://www.spectrumdigital.com/">Spectrum Digital</a>
evaluation board with a GNU arm-elf toolchain*. evaluation board with a GNU arm-elf toolchain*.
This port is in progress and partially functional (However, This port is complete, verified, and included in the initial NuttX
my board is dead at the moment so it will be awhile before I fix it)</li> release.</li>
<li><b>8051 Microcontroller</b>. <li><b>8051 Microcontroller</b>.
This port uses the <a href="http://www.pjrc.com/">PJRC</a> 87C52 development system This port uses the <a href="http://www.pjrc.com/">PJRC</a> 87C52 development system
and the <a href="http://sdcc.sourceforge.net/">SDCC</a> toolchain. and the <a href="http://sdcc.sourceforge.net/">SDCC</a> toolchain.
@ -43,17 +43,18 @@ is available that be used to build a NuttX-compatible arm-elf toolchain.</blockq
<h1>Memory Footprint</h1> <h1>Memory Footprint</h1>
<p>Details to be provided</p> <p><b>C5471 (Arm7)</b>
The build for this ARM7 target that includes most of the OS features and
<p> a broad range of OS tests. The size of this executable as given by the
I have a complete build for an ARM7 target that includes most of the OS Linux <tt>size</tt> command is:
features and a broad range of OS tests.
That builds to an executable that requires about 85Kb for .text, .data., and .bss.
</p> </p>
<p> <pre>
I have a stripped down OS test for the 8051 target that requires only text data bss dec hex filename
18Kb. A substantial effort was required to get to this size 53272 428 3568 57268 dfb4 nuttx
(see <a href="codesize-070301.xls">spreadsheet</a> for details). </pre>
<p><b>87C52</b>
A reduced functionality OS test for the 8051 target requires only
about 18Kb (see <a href="codesize-070301.xls">spreadsheet</a> for details).
</p> </p>
<h1>Licensing</h1> <h1>Licensing</h1>

View File

@ -27,7 +27,7 @@ Gregory Nutt
<H1>1.0 <A NAME="Introduction">Introduction</A></H1> <H1>1.0 <A NAME="Introduction">Introduction</A></H1>
<P> <P>
This user's manual is divided into five sections: This user's manual is divided into three sections:
<UL> <UL>
<LI><B>Section 1.0, <A HREF="#Introduction">Introduction</A></B>: <LI><B>Section 1.0, <A HREF="#Introduction">Introduction</A></B>:
This section provides an overview of the Nuttx user's manual. This section provides an overview of the Nuttx user's manual.
@ -48,8 +48,6 @@ into several paragraphs that describe different groups of OS interfaces:
<LI><B>Section 3.0, <A HREF="#Data_Structures">OS Data Structures</A></B>: <LI><B>Section 3.0, <A HREF="#Data_Structures">OS Data Structures</A></B>:
This section documents the data structures that are used at the Nuttx This section documents the data structures that are used at the Nuttx
interface. interface.
<LI><B>Section 4.0, <A HREF="#Problems">Known Problems</A></B>. This section
lists known problems in the latest release of Nuttx.
</UL> </UL>
<HR> <HR>
@ -4113,28 +4111,5 @@ notify a task when a message is available on a queue.
have to do some redesign. have to do some redesign.
</p> </p>
<HR>
<H1>4.0 <A NAME="Problems">Known Problems</A></H1>
<P>
This section documents know problems with Nuttx at the time
of this writing.
<P>
<HR>
<B>Problem</B>:
There is a problem with the unblock logic in os_signal.c when message queue
becomes not-empty -- sig_mqnotempty() calls sig_received().
sig_received() relies on task_state == TSTATE_WAIT_SIG and will ignore
tasks that are waiting on a message queue to become non-empty.
<P>
<B>Priority</B>: <B>LOW</B>. If a task is blocked a waiting for a message
queue to become non-empty, it will be re-started anyway.
<HR>
<B>Problem</B>: task_restart won't restart a running task
<P>
<B>Priority</B>: <B>LOW</B>.
</BODY> </BODY>
</HTML> </HTML>

12
nuttx/ReleaseNotes Normal file
View File

@ -0,0 +1,12 @@
Nuttx-0.1.0
^^^^^^^^^^^
This is the initial. This initial includes the complete NuttX RTOS
with support for the Linux user mode simulation and the TI TMS320C5471
(Arm7) processor. Partial support for the 87C52 is included.
This release has been verified on both the Linux user-mode and C5471
platforms using the test program under examples/ostest. Test results
for the C5471 can be found in arch/c5471/doc/test-results.txt.
This tarball contains a complete CVS snapshot from March 9,2007.

View File

@ -51,7 +51,7 @@
#undef CONFIG_SUPPRESS_INTERRUPTS /* Do not enable interrupts */ #undef CONFIG_SUPPRESS_INTERRUPTS /* Do not enable interrupts */
#undef CONFIG_SUPPRESS_TIMER_INTS /* No timer */ #undef CONFIG_SUPPRESS_TIMER_INTS /* No timer */
#define CONFIG_SUPPRESS_SERIAL_INTS 1 /* Console will poll */ #undef CONFIG_SUPPRESS_SERIAL_INTS /* Console will poll */
#undef CONFIG_SUPPRESS_UART_CONFIG /* Do not reconfig UART */ #undef CONFIG_SUPPRESS_UART_CONFIG /* Do not reconfig UART */
#undef CONFIG_DUMP_ON_EXIT /* Dumpt task state on exit */ #undef CONFIG_DUMP_ON_EXIT /* Dumpt task state on exit */

View File

@ -79,10 +79,11 @@ struct uart_regs_s
struct uart_buffer_s struct uart_buffer_s
{ {
int head; sem_t sem; /* Used to control exclusive access to the buffer */
int tail; sint16 head; /* Index to the head [IN] index in the buffer */
int size; sint16 tail; /* Index to the tail [OUT] index in the buffer */
char *buffer; sint16 size; /* The allocated size of the buffer */
char *buffer; /* Pointer to the allocated buffer memory */
}; };
struct up_dev_s struct up_dev_s
@ -608,6 +609,7 @@ static void up_putxmitchar(up_dev_t *dev, int ch)
} }
else else
{ {
#if defined(CONFIG_SUPPRESS_INTERRUPTS) || defined(CONFIG_SUPPRESS_SERIAL_INTS)
/* Transfer some characters with interrupts disabled */ /* Transfer some characters with interrupts disabled */
up_xmitchars(dev); up_xmitchars(dev);
@ -621,20 +623,23 @@ static void up_putxmitchar(up_dev_t *dev, int ch)
{ {
/* Still no space */ /* Still no space */
#if defined(CONFIG_SUPPRESS_INTERRUPTS) || defined(CONFIG_SUPPRESS_SERIAL_INTS)
up_waittxfifonotfull(dev); up_waittxfifonotfull(dev);
#else
dev->xmitwaiting = TRUE;
/* Wait for some characters to be sent from the buffer
* with the TX interrupt disabled.
*/
up_enabletxint(dev);
up_takesem(&dev->xmitsem);
up_disabletxint(dev);
#endif
} }
#else
/* Inform the interrupt level logic that we are waiting */
dev->xmitwaiting = TRUE;
/* Wait for some characters to be sent from the buffer
* with the TX interrupt enabled. When the TX interrupt
* is enabled, up_xmitchars should execute and remove
* some of the data from the TX buffer.
*/
up_enabletxint(dev);
up_takesem(&dev->xmitsem);
up_disabletxint(dev);
#endif
} }
} }
} }
@ -805,6 +810,10 @@ static ssize_t up_write(struct file *filep, const char *buffer, size_t buflen)
up_dev_t *dev = inode->i_private; up_dev_t *dev = inode->i_private;
ssize_t ret = buflen; ssize_t ret = buflen;
/* Only one user can be accessing dev->xmit.head at once */
up_takesem(&dev->xmit.sem);
/* Loop while we still have data to copy to the transmit buffer. /* Loop while we still have data to copy to the transmit buffer.
* we add data to the head of the buffer; up_xmitchars takes the * we add data to the head of the buffer; up_xmitchars takes the
* data from the end of the buffer. * data from the end of the buffer.
@ -829,13 +838,14 @@ static ssize_t up_write(struct file *filep, const char *buffer, size_t buflen)
if (dev->xmit.head != dev->xmit.tail) if (dev->xmit.head != dev->xmit.tail)
{ {
#if defined(CONFIG_SUPPRESS_INTERRUPTS) || defined(CONFIG_SUPPRESS_SERIAL_INTS)
up_xmitchars(dev); up_xmitchars(dev);
if (dev->xmit.head != dev->xmit.tail) #else
{ up_enabletxint(dev);
up_enabletxint(dev); #endif
}
} }
up_givesem(&dev->xmit.sem);
return ret; return ret;
} }
@ -849,6 +859,10 @@ static ssize_t up_read(struct file *filep, char *buffer, size_t buflen)
up_dev_t *dev = inode->i_private; up_dev_t *dev = inode->i_private;
ssize_t ret = buflen; ssize_t ret = buflen;
/* Only one user can be accessing dev->recv.tail at once */
up_takesem(&dev->recv.sem);
/* Loop while we still have data to copy to the receive buffer. /* Loop while we still have data to copy to the receive buffer.
* we add data to the head of the buffer; up_xmitchars takes the * we add data to the head of the buffer; up_xmitchars takes the
* data from the end of the buffer. * data from the end of the buffer.
@ -862,7 +876,7 @@ static ssize_t up_read(struct file *filep, char *buffer, size_t buflen)
*buffer++ = dev->recv.buffer[dev->recv.tail]; *buffer++ = dev->recv.buffer[dev->recv.tail];
buflen--; buflen--;
if (++dev->recv.tail >= dev->recv.size) if (++(dev->recv.tail) >= dev->recv.size)
{ {
dev->recv.tail = 0; dev->recv.tail = 0;
} }
@ -881,7 +895,7 @@ static ssize_t up_read(struct file *filep, char *buffer, size_t buflen)
} }
up_enablerxint(dev); up_enablerxint(dev);
up_takesem(&dev->recv.sem);
return ret; return ret;
} }
@ -1068,8 +1082,11 @@ static void up_devinit(up_dev_t *dev,
* statically initialized. * statically initialized.
*/ */
sem_init(&dev->xmit.sem, 0, 1);
dev->xmit.size = txbufsize; dev->xmit.size = txbufsize;
dev->xmit.buffer = txbuffer; dev->xmit.buffer = txbuffer;
sem_init(&dev->recv.sem, 0, 1);
dev->recv.size = rxbufsize; dev->recv.size = rxbufsize;
dev->recv.buffer = rxbuffer; dev->recv.buffer = rxbuffer;

View File

@ -216,16 +216,19 @@ void sighand_test(void)
} }
else else
{ {
printf("sighand_test: Started waiter_main pid=%d\n" , waiterpid); printf("sighand_test: Started waiter_main pid=%d\n", waiterpid);
} }
/* Wait a bit */ /* Wait a bit */
fflush(stdout); fflush(stdout);
usleep(500*1000); sleep(2);
/* Then signal the waiter thread. */ /* Then signal the waiter thread. */
printf("sighand_test: Signaling pid=%d with signo=%d sigvalue=%d\n",
waiterpid, WAKEUP_SIGNAL, SIGVALUE_INT);
sigvalue.sival_int = SIGVALUE_INT; sigvalue.sival_int = SIGVALUE_INT;
#ifdef CONFIG_CAN_PASS_STRUCTS #ifdef CONFIG_CAN_PASS_STRUCTS
status = sigqueue(waiterpid, WAKEUP_SIGNAL, sigvalue); status = sigqueue(waiterpid, WAKEUP_SIGNAL, sigvalue);
@ -241,7 +244,7 @@ void sighand_test(void)
/* Wait a bit */ /* Wait a bit */
fflush(stdout); fflush(stdout);
usleep(500*1000); sleep(2);
/* Then check the result */ /* Then check the result */

View File

@ -161,6 +161,7 @@ void timedwait_test(void)
} }
printf("timedwait_test: Joining\n"); printf("timedwait_test: Joining\n");
fflush(stdout);
status = pthread_join(waiter, &result); status = pthread_join(waiter, &result);
if (status != 0) if (status != 0)
{ {