<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<div class="moz-cite-prefix">On 11/4/2014 3:01 PM, Marcos Díaz
wrote:<br>
</div>
<blockquote
cite="mid:CAEOtcj=W50qO5Jzd1HBJv0J9vOYHRqCANR5LwpE3d68WHczp2g@mail.gmail.com"
type="cite">
<div dir="ltr">Hi!
<div> We are currently using a LWIP implementation on the Beagle
Bone Black bsp, recently uploaded by Ben Gras.</div>
<div>We developed this port based on ethernet and lwip drivers
from StarterWare drivers of Texas Instrument.</div>
<div>We took this port, that was intended for baremetal use and
added a posix implementation, as Federico did for the
semaphores, messages and threads to use inside LWIP and the
driver, and updated LWIP version to the current working
branch.</div>
<div>We also modified the device driver in order to support
threads in charge of managing the input and output of the
device.</div>
<div>The license for those drivers is BSD and copied from the
LWIP's BSD license.</div>
<div><br>
</div>
<div>Now we are using this port as an application, but we wanted
to have ideas of how we can put LWIP inside RTEMS.</div>
<div>I'm thinking of many things, as:</div>
<div> initialization of the device <br>
</div>
</div>
</blockquote>
I assume it is just a subroutine call to LWIP and the application
would<br>
make it at the appropriate time. This is like the current IPV4
stack.<br>
<br>
The new IPV4/IPV6 stack has a slightly different startup mechanism<br>
and can use BSD type commands like ifconfig and route to configure
it.<br>
<blockquote
cite="mid:CAEOtcj=W50qO5Jzd1HBJv0J9vOYHRqCANR5LwpE3d68WHczp2g@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>configuration of lwip options and ip address options</div>
</div>
</blockquote>
The old and new stacks already do this differently. I suspect that<br>
initializing the selected stack in a uniform way isn't as critical <br>
as not having N versions of services like httpd, telnetd, etc.<br>
<blockquote
cite="mid:CAEOtcj=W50qO5Jzd1HBJv0J9vOYHRqCANR5LwpE3d68WHczp2g@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>use of socket api and integrating it to the libraries used
in RTEMS.</div>
<div><br>
</div>
</div>
</blockquote>
Is the code posted somewhere? How much has been submitted<br>
upstream to LWIP?<br>
<br>
With the old IPV4 stack, new IPV4/IPV6 stack, and LWIP stack <br>
all available in parallel, it may make sense to NOT merge <br>
LWIP directly but consider networking as an add-on package.<br>
<br>
Assuming we break the old stack out of the main source tree<br>
into an independent package, then you would build RTEMS,<br>
a networking kit, etc. The RSB's notion of packages for RTEMS<br>
makes this pretty attractive.<br>
<blockquote
cite="mid:CAEOtcj=W50qO5Jzd1HBJv0J9vOYHRqCANR5LwpE3d68WHczp2g@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>So, we want to get some ideas as when and where we can set
this configurations and functions inside RTEMS.</div>
<div>Thanks, and feel free to ask any questions about the work
we did.</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Thu, Aug 28, 2014 at 2:27 PM,
Federico Casares <span dir="ltr"><<a
moz-do-not-send="true"
href="mailto:federico.casares@tallertechnologies.com"
target="_blank">federico.casares@tallertechnologies.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Hi,<br>
<div>
<div class="gmail_extra"><br>
<div class="gmail_quote">
<div>
<div>On Tue, Aug 26, 2014 at 3:46 PM, Joel
Sherrill <span dir="ltr"><<a
moz-do-not-send="true"
href="mailto:joel.sherrill@oarcorp.com"
target="_blank">joel.sherrill@oarcorp.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote"
style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
First. Thanks for the work and taking the
time and effort to <br>
submit it.<br>
<br>
Specifics below, but the general answer is
to submit all RTEMS<br>
changes as reviewable patches to <a
moz-do-not-send="true"
href="mailto:devel@rtems.org"
target="_blank">devel@rtems.org</a>. We
can<br>
then review them and get them merged. This
will leave us<br>
with just the LWIP changes.<br>
<br>
Then we can review those and begin to work
with that community<br>
to get them merged.
<div><br>
<br>
<br>
<div>On 8/26/2014 6:22 AM, Federico
Casares wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">Hi,<br>
<br>
In the past weeks we were working on
porting the last LWIP version to
RTEMS for<br>
the LPC1768 microcontroller. Our
main goal was to accomplish this
with the<br>
minimum number of changes for both
projects. Fortunately, the result
was<br>
positive.<br>
<br>
Now, we are capable of providing to
the community with this new version
of the<br>
RTEMS+LWIP port. In details:<br>
<br>
- RTEMS: last git revision =
baa3c91ecb8a3b48ef387b938fcdb6
<div dir="ltr">e60b5bdc8a<br>
- LWIP: last git revision =
63038e03055183e3bc043711ada1de3bb907e989<br>
- LPC1768: based on MBED driver =
<a moz-do-not-send="true"
href="https://github.com/mbedmicro/mbed/tree/master/libraries/net/eth/lwip-eth/arch/TARGET_NXP"
target="_blank">https://github.com/mbedmicro/mbed/tree/master/libraries/net/eth/lwip-eth/arch/TARGET_NXP</a><br>
<br>
<br>
The list of changes follows:<br>
<br>
- RTEMS OS: No changes were needed
here. Despite this we will be
posting a<br>
possible improvement in the newlib
maillist soon. It consist in
adding the gcc<br>
function attribute
"warn_unused_result" to the
pthread_*_init functions. As a<br>
result, developers will be warned
about checking the return value.
NOTE: a<br>
common error here could be not
checking the return value,
assuming a successful<br>
result, and trying to, for
example, lock a mutex which init
function has<br>
returned ENOMEM. (We found this
exact mistake in the current LWIP
OS layer<br>
implementation for Unix)<br>
<br>
</div>
</div>
</blockquote>
</div>
FWIW the gcc C++ library adapters for
threading do not check the results from<br>
those operations. This is an open sore
spot for us. <br>
<div>
<blockquote type="cite">
<div dir="ltr">
<div dir="ltr">- RTEMS LPC1768_MBED
BSP: We added a new section to the
linker script, so we<br>
were able to put the LWIP and
driver buffers in an exact memory
location (useful<br>
when working with DMA devices).<br>
<br>
</div>
</div>
</blockquote>
</div>
This sounds like a discrete patch to
submit to <a moz-do-not-send="true"
href="mailto:devel@rtems.org"
target="_blank">devel@rtems.org</a>.
<div><br>
</div>
</div>
</blockquote>
</div>
</div>
<div>Already sent. <br>
</div>
<span>
<blockquote class="gmail_quote"
style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<div>
<blockquote type="cite">
<div dir="ltr">
<div dir="ltr">- RTEMS LPC1768_MBED
Ethernet Driver: Based on an
existing driver from MBED, we<br>
ported it to RTEMS. NOTE: we will be
creating our own driver in the near
future.<br>
<br>
</div>
</div>
</blockquote>
</div>
What is the license of these drivers?
<div><br>
</div>
</div>
</blockquote>
</span>
<div>GPLv2. Is this ok? <br>
</div>
<span>
<blockquote class="gmail_quote"
style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<div>
<blockquote type="cite">
<div dir="ltr">
<div dir="ltr">- LWIP: As mentioned
previously, we needed to put all
LWIP buffers in DMA memory<br>
locations. Consequently, we added
the "section" attribute to LWIP
ram_heap and<br>
memp_memory buffers. Furthermore, as
this is a common strategy in
embedded<br>
devices with DMA, we made it generic
and we will send these changes to
the LWIP<br>
project. Additionally, we will
provide some minor adds/changes to
the lwip log<br>
system and statistics system.<br>
<br>
</div>
</div>
</blockquote>
</div>
OK. Those are obviously their's to review.
:)
<div><br>
<blockquote type="cite">
<div dir="ltr">
<div dir="ltr">- LWIP-contrib: Some of
the changes/adds were: fixing some
issues related with<br>
posix initialization checks and
allow set threads stack size.<br>
<br>
</div>
</div>
</blockquote>
</div>
What all specific to RTEMS was added? Do you
want RTEMS Community review<br>
on this?<br>
<br>
Is there a readme/howto to configure and use
LWIP on RTEMS?<br>
<br>
It sounds like the port is largely BSP
independent. Is this the case?
<div><br>
</div>
</div>
</blockquote>
</span>
<div>See below. <br>
</div>
<span>
<blockquote class="gmail_quote"
style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<div>
<blockquote type="cite">
<div dir="ltr">
<div dir="ltr">- LWIP-test-app: A
simple TCP echo server with
debugging functionality<br>
(rtems malloc statistics, rtems
stack checker, lwip statistics,
driver<br>
statistics and registers dump)
available.<br>
<br>
</div>
</div>
</blockquote>
</div>
Very cool! <br>
<br>
How large was the code/data/RAM use of the
test application?
<div><br>
</div>
</div>
</blockquote>
</span>
<div>$ arm-rtems4.11-size -A -d
o-optimize/lwip.exe<br>
<br>
o-optimize/lwip.exe :<br>
section size addr<br>
.start 840 0<br>
.text 138000 840<br>
.init 12 138840<br>
.fini 12 138852<br>
.rodata 14704 138864<br>
.ARM.exidx 8 153568<br>
.eh_frame 4 153576<br>
.init_array 4 153580<br>
.fini_array 4 153584<br>
.jcr 4 153588<br>
.vector 1256 268435456<br>
.data 1568 268436712<br>
.bss 8500 537378816<br>
.work 29944 268438280<br>
.eth 16312 537395200<br>
.comment 109 0<br>
.debug_aranges 15608 0<br>
.debug_info 2525968 0<br>
.debug_abbrev 290957 0<br>
.debug_line 897089 0<br>
.debug_frame 34048 0<br>
.debug_str 384335 0<br>
.debug_loc 271111 0<br>
.debug_ranges 19536 0<br>
.debug_macro 516169 0<br>
.ARM.attributes 41 0<br>
Total 5166143<br>
<br>
(gdb) p Configuration<br>
$1 = {work_space_size = 13640, stack_space_size
= 3808, maximum_extensions = 0, maximum_keys =
1, maximum_key_value_pairs = 0,
microseconds_per_tick = 1000,
nanoseconds_per_tick = 1000000,
ticks_per_timeslice = 20, <br>
idle_task = 0x16195
<_CPU_Thread_Idle_body>,
idle_task_stack_size = 200, interrupt_stack_size
= 0, stack_allocate_init_hook = 0x0
<bsp_start_vector_table_begin>
<div>, stack_allocate_hook = 0x15f61
<_Workspace_Allocate>, <br>
stack_free_hook = 0x15f89
<_Workspace_Free>, do_zero_of_workspace
= false, unified_work_area = false,
stack_allocator_avoids_work_space = false,
number_of_initial_extensions = 3,
User_extension_table = 0x247e4
<Configuration_Initial_Extensions>}</div>
</div>
<span>
<blockquote class="gmail_quote"
style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<div>
<blockquote type="cite">
<div dir="ltr">
<div dir="ltr"><br>
As this new port is comprised of
several patches and adds, it would
be great<br>
to have some advice in how to
proceed. We can provide you with the
project as a<br>
whole or divided into independent
patches. Also, we will need to know
which<br>
parts of the port are of RTEMS
interest to be submitted.<br>
<br>
</div>
</div>
</blockquote>
</div>
RTEMS needs to nibble and digest the RTEMS
stuff. That sounds pretty easy.<br>
<br>
Then we can help or at least track and
provide help getting the LWIP port<br>
reviewed and merged by them.</div>
</blockquote>
</span>
<div><br>
<br>
<div>This project can be divided into 4 main
parts:<br>
<br>
</div>
<div>1) RTEMS<br>
</div>
<div>2) LWIP<br>
</div>
<div>3) LWIP driver<br>
</div>
<div>4) User application<br>
</div>
<div>
<div>
<div style="display:inline-block">
<div><span></span></div>
</div>
</div>
</div>
<div>
<span lang="en"><span>Even though this project
was developed for the LPC1768, almost all
can be used for<br>
other devices, </span></span><span
lang="en"><span>with the obvious exception
of the driver.<br>
<br>
</span></span></div>
<div><span lang="en"><span>As I told you, we
tried to do this with minimum changes, and
you will see that. The only<br>
</span></span></div>
<div><span lang="en"><span>pieces of code that
are completely new (for RTEMS and LWIP)
are the driver and the<br>
demo application.<br>
</span></span></div>
<div dir="ltr" style="zoom:1"><span lang="en"><span><br>
</span></span></div>
<div><span lang="en"><span>So, for each part:<br>
<br>
</span></span></div>
<div><span lang="en"><span>1) I will submit the
change related to the linker script today,
and we will be working in<br>
the "GCC</span></span><span lang="en"><span>
attributes" to send it to newlib.<br>
</span></span></div>
<div><span lang="en"><span>2) Should RTEMS have
a version of LWIP in their building
system? (maybe as an external<br>
library) so anyone can use it for their
projects?<br>
</span></span></div>
<div><span lang="en"><span>3) The driver is LWIP
dependent and, as LWIP sources does not
contains any kind of<br>
driver,</span></span><span lang="en"><span>
should we add this driver to the LPC1768
dsp implementation of RTEMS?.<br>
</span></span></div>
<div><span lang="en"><span>4) Should we add this
application example to the list of RTEMS
testsuites/samples?<br>
<br>
</span></span></div>
<span lang="en"><span>Regards.
<div>
<div>
<img moz-do-not-send="true"
src="https://ssl.gstatic.com/ui/v1/icons/mail/images/cleardot.gif"></div>
</div>
</span></span><br>
</div>
<span>
<blockquote class="gmail_quote"
style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<div><br>
<blockquote type="cite">
<div dir="ltr">
<div dir="ltr">Regards.</div>
<br clear="all">
<br>
-- <br>
<div dir="ltr">
<div>
<div><span
style="font-family:verdana,sans-serif"><a
moz-do-not-send="true"
href="http://www.tallertechnologies.com"
target="_blank"><img
moz-do-not-send="true"
alt="http://www.tallertechnologies.com"
src="http://www.tallertechnologies.com/templates/tallertechnologies/images/signature.png"
height="78" width="200"></a><br>
Casares, Federico<br>
</span></div>
<span
style="font-family:verdana,sans-serif">Sr.
Software Engineer<br>
</span></div>
<span
style="font-family:verdana,sans-serif">Taller
Technologies Argentina<br>
<br>
<span
style="font-size:8pt;color:rgb(0,0,0);font-weight:normal;font-style:normal;text-decoration:none;vertical-align:baseline;background-color:transparent">San
Lorenzo 47, 3rd Floor, Office 5<br>
</span><span
style="font-size:8pt;color:rgb(0,0,0);font-weight:normal;font-style:normal;text-decoration:none;vertical-align:baseline;background-color:transparent">Córdoba,
Argentina</span></span><br>
</div>
</div>
</blockquote>
<br>
</div>
<span><font color="#888888">
<pre cols="72">--
Joel Sherrill, Ph.D. Director of Research & Development
<a moz-do-not-send="true" href="mailto:joel.sherrill@OARcorp.com" target="_blank">joel.sherrill@OARcorp.com</a> On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985</pre>
</font></span></div>
</blockquote>
</span></div>
<span><br>
<br clear="all">
<br>
-- <br>
<div dir="ltr">
<div>
<div><span
style="font-family:verdana,sans-serif"><a
moz-do-not-send="true"
href="http://www.tallertechnologies.com"
target="_blank"><img
moz-do-not-send="true"
alt="http://www.tallertechnologies.com"
src="http://www.tallertechnologies.com/templates/tallertechnologies/images/signature.png"
height="78" width="200"></a><br>
Casares, Federico<br>
</span></div>
<span style="font-family:verdana,sans-serif">Sr.
Software Engineer<br>
</span></div>
<span style="font-family:verdana,sans-serif">Taller
Technologies Argentina<br>
<br>
<span
style="font-size:8pt;color:rgb(0,0,0);font-weight:normal;font-style:normal;text-decoration:none;vertical-align:baseline;background-color:transparent">San
Lorenzo 47, 3rd Floor, Office 5<br>
</span><span
style="font-size:8pt;color:rgb(0,0,0);font-weight:normal;font-style:normal;text-decoration:none;vertical-align:baseline;background-color:transparent">Córdoba,
Argentina</span></span><br>
</div>
</span></div>
</div>
</div>
<br>
_______________________________________________<br>
devel mailing list<br>
<a moz-do-not-send="true" href="mailto:devel@rtems.org"
target="_blank">devel@rtems.org</a><br>
<a moz-do-not-send="true"
href="http://lists.rtems.org/mailman/listinfo/devel"
target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
</blockquote>
</div>
<br>
<br clear="all">
<div><br>
</div>
-- <br>
<div>
<div dir="ltr"><span>
<p dir="ltr"
style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span
style="font-size:16px;font-family:Arial;color:#000000;background-color:transparent;font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap">______________________________</span></p>
<p dir="ltr"
style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><a
moz-do-not-send="true"
href="http://www.tallertechnologies.com"
target="_blank"><img moz-do-not-send="true"
src="http://www.tallertechnologies.com/templates/tallertechnologies/images/signature.png"
height="78" width="200"></a></p>
<p dir="ltr"
style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><b
style="font-weight:normal"><br>
<span
style="font-size:16px;font-family:Arial;color:#000000;background-color:transparent;font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap"></span></b></p>
<p dir="ltr"
style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span
style="color:rgb(0,0,0);background-color:transparent;font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap"><font
face="verdana, sans-serif" size="4">Marcos Díaz</font></span></p>
<p dir="ltr" style="margin-top:0pt;margin-bottom:0pt"><font
color="#000000" face="verdana, sans-serif"><span
style="line-height:17px;white-space:pre-wrap">Software
Engineer</span></font></p>
<p dir="ltr"
style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><b
style="font-weight:normal"><br>
<span
style="font-size:15px;font-family:Arial;color:#000000;background-color:transparent;font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap"></span></b></p>
<p dir="ltr"
style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span
style="color:rgb(0,0,0);background-color:transparent;font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap"><font
face="arial, helvetica, sans-serif" size="1">San
Lorenzo 47, 3rd Floor, Office 5</font></span></p>
<p dir="ltr"
style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><span
style="color:rgb(0,0,0);background-color:transparent;font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap"><font
face="arial, helvetica, sans-serif" size="1">Córdoba,
Argentina </font></span></p>
<p dir="ltr"
style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><b
style="font-weight:normal"><font face="arial,
helvetica, sans-serif" size="1"><br>
<span
style="color:rgb(0,0,0);background-color:transparent;font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap"></span></font></b></p>
<p dir="ltr"
style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><font
face="arial, helvetica, sans-serif" size="1"><span
style="color:rgb(0,0,0);background-color:transparent;font-weight:bold;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap">Phone:</span><span
style="color:rgb(0,0,0);background-color:transparent;font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap">
+54 351 4217888 / +54 351 4218211/ </span><span
style="color:rgb(0,0,0);line-height:12px;white-space:pre-wrap">+54
351 7617452</span></font></p>
<p dir="ltr"
style="line-height:1.15;margin-top:0pt;margin-bottom:0pt"><font
face="arial, helvetica, sans-serif" size="1"><span
style="color:rgb(0,0,0);background-color:transparent;font-weight:bold;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap">Skype:</span><span
style="color:rgb(0,0,0);background-color:transparent;font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap">
markdiaz22</span></font></p>
<div><span
style="font-size:11px;font-family:Arial;color:#000000;background-color:transparent;font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap"><br>
</span></div>
</span></div>
</div>
</div>
</div>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Joel Sherrill, Ph.D. Director of Research & Development
<a class="moz-txt-link-abbreviated" href="mailto:joel.sherrill@OARcorp.com">joel.sherrill@OARcorp.com</a> On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985</pre>
</body>
</html>