Discussion:
Porting libcurl to a small, embedded system?
c***@Antronics.co.uk
2010-07-14 10:39:26 UTC
Permalink
I work with small, microcontroller-based embedded systems (eg, ARM
Cortex-M3).

I'm wondering if it might be practical to port libcurl to such a system?
Possibly with no OS ("bare metal"); probably using a 3rd-party TCP/IP stack.

Is there a "porting guide"?

Thanks,

Andy Neil, Antronics Ltd.

http://www.Antronics.co.uk

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Daniel Stenberg
2010-07-14 15:45:28 UTC
Permalink
Post by c***@Antronics.co.uk
I work with small, microcontroller-based embedded systems (eg, ARM
Cortex-M3).
That's just an ARM core, not a full system! ;-) You should in fact even be
able to run a full fledged linux with such a core if you'd wanted to and have
enough memory.
Post by c***@Antronics.co.uk
I'm wondering if it might be practical to port libcurl to such a system?
Possibly with no OS ("bare metal"); probably using a 3rd-party TCP/IP stack.
Is there a "porting guide"?
The closest to such a thing is docs/INTERNALS combined with docs/INSTALL.

In short, if you have a somewhat POSIX-compliant tcp/ip stack and you have
other fundamental libc functions such as malloc and a few other file
descriptor-related functions you should be able to do it. I think.
--
/ daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
c***@Antronics.co.uk
2010-07-14 19:12:32 UTC
Permalink
From: Daniel Stenberg [mailto:***@haxx.se]
Sent: 14 July 2010 16:45
To: curl-***@Antronics.co.uk; libcurl development
Subject: Re: Porting libcurl to a small, embedded system?
Post by Daniel Stenberg
Post by c***@Antronics.co.uk
I work with small, microcontroller-based embedded systems (eg, ARM
Cortex-M3).
That's just an ARM core, not a full system! ;-)
Pedant, eh?! ;-)
I did say microcontroller-*based* - so the Cortex-M3 is the core on which
the system is *based8
Post by Daniel Stenberg
You should in fact even be able to run a full fledged
linux with such a core if you'd wanted to and have enough memory.
Actually, Cortex-M3 is not well-suited for that - one of the larger ARM
cores would be more appropriate.
Post by Daniel Stenberg
Post by c***@Antronics.co.uk
I'm wondering if it might be practical to port libcurl to such a system?
Possibly with no OS ("bare metal"); probably using a 3rd-party TCP/IP stack.
Is there a "porting guide"?
The closest to such a thing is docs/INTERNALS combined with docs/INSTALL.
In short, if you have a somewhat POSIX-compliant tcp/ip stack and you have
other fundamental
Post by Daniel Stenberg
libc functions such as malloc and a few other file descriptor-related
functions you should
Post by Daniel Stenberg
be able to do it. I think.
Thanks - I'll look into it...

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Gary Maxwell
2010-07-14 17:15:58 UTC
Permalink
Post by c***@Antronics.co.uk
I work with small, microcontroller-based embedded systems (eg, ARM
Cortex-M3).
I'm wondering if it might be practical to port libcurl to such a system?
Possibly with no OS ("bare metal"); probably using a 3rd-party TCP/IP stack.
You did not mention the 3rd-party TCP/IP stack you were considering. It would be useful to know if there are any existing ports of libcurl to this stack.

A few years ago I ported libcurl to an ARM7 core running a proprietary RTOS and the LwIP open source TCP/IP stack. There were plenty of issues, all of them involving the stack. Among other issues, connections couldn't be reused and there was lots of flakiness with HTTPS transactions. Basically, libcurl stressed the stack into revealing hidden flaws.

Your mileage may vary, but be forewarned that the libcurl porting effort may take longer than you think, and may require a good level of support from the supplier of the stack.

Cheers,
GaryM @ casabi

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
c***@Antronics.co.uk
2010-07-15 06:33:49 UTC
Permalink
Date: Wed, 14 Jul 2010 17:15:58 +0000
Subject: RE: Porting libcurl to a small, embedded system?
Post by c***@Antronics.co.uk
I work with small, microcontroller-based embedded systems (eg, ARM
Cortex-M3).
I'm wondering if it might be practical to port libcurl to such a
system?
Possibly with no OS ("bare metal"); probably using a 3rd-party TCP/IP
stack.
You did not mention the 3rd-party TCP/IP stack you were considering.
It would be useful to know if there are any existing ports of libcurl to
this stack.

Indeed - is there a list of existing ports anywhere?
(googling "libcurl port" just gets swamped with references to "port" in the
"IP port"
sense.) :-(

I'm not "comitted" to a particular stack - but ones like Nichelite, LwIP,
uIP, etc
tend to be the ones touted by the microcontroller manufacturers...
Your mileage may vary, but be forewarned that the libcurl porting effort
may
take longer than you think, and may require a good level of support from
the
supplier of the stack.
That kind of figures - thanks for the heads-up.

Maybe I'd be better off looking at some of the simpler entries at
http://curl.haxx.se/libcurl/competitors.html ?

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Paul Romero
2010-07-15 14:43:37 UTC
Permalink
Post by Gary Maxwell
Date: Wed, 14 Jul 2010 17:15:58 +0000
Subject: RE: Porting libcurl to a small, embedded system?
Post by c***@Antronics.co.uk
I work with small, microcontroller-based embedded systems (eg, ARM
Cortex-M3).
I'm wondering if it might be practical to port libcurl to such a
system?
Possibly with no OS ("bare metal"); probably using a 3rd-party TCP/IP
stack.
You did not mention the 3rd-party TCP/IP stack you were considering.
It would be useful to know if there are any existing ports of libcurl to
this stack.
Indeed - is there a list of existing ports anywhere?
(googling "libcurl port" just gets swamped with references to "port" in the
"IP port"
sense.) :-(
I'm not "comitted" to a particular stack - but ones like Nichelite, LwIP,
uIP, etc
tend to be the ones touted by the microcontroller manufacturers...
Your mileage may vary, but be forewarned that the libcurl porting effort
may
take longer than you think, and may require a good level of support from
the
supplier of the stack.
That kind of figures - thanks for the heads-up.
Maybe I'd be better off looking at some of the simpler entries at
http://curl.haxx.se/libcurl/competitors.html ?
This list brings up some interesting issues. A tangential but interesting
one is the difference between between the open software and
MIT versions of libcurl. Also, I don't think any of the other
libraries in the list support SFTP.
Post by Gary Maxwell
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
--
Paul Romero

RCOM Communications Software

Phone/Fax: (510)339-2628
E-Mail: ***@rcom-software.com


-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Daniel Stenberg
2010-07-15 17:16:10 UTC
Permalink
Post by Paul Romero
Post by c***@Antronics.co.uk
Maybe I'd be better off looking at some of the simpler entries at
http://curl.haxx.se/libcurl/competitors.html ?
This list brings up some interesting issues. A tangential but interesting
one is the difference between between the open software and MIT versions of
libcurl.
There are no different versions of libcurl from our project or me. The only
libcurl is open source and MIT licensed.
Post by Paul Romero
Also, I don't think any of the other libraries in the list support SFTP.
Right, that list is a bit focused on FTP and HTTP only. I know of no other
library than libcurl that supports both SFTP and HTTP. But the question about
porting libcurl didn't mention what protocols he/she wanted supported.
--
/ daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
c***@Antronics.co.uk
2010-07-15 20:10:24 UTC
Permalink
Sent: 15 July 2010 18:16
Subject: Re: Porting libcurl to a small, embedded system?
But the question about porting libcurl didn't mention what
protocols he/she wanted supported.
You're right - he (I) didn't!

HTTP is my primary interest at the moment.

A.


-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Gary Maxwell
2010-07-16 04:11:11 UTC
Permalink
Sent: Thursday, July 15, 2010 4:10 PM
To: 'libcurl development'
Subject: RE: Porting libcurl to a small, embedded system?
Sent: 15 July 2010 18:16
Subject: Re: Porting libcurl to a small, embedded system?
But the question about porting libcurl didn't mention what
protocols he/she wanted supported.
You're right - he (I) didn't!
HTTP is my primary interest at the moment.
If HTTP is your only interest at the moment, then I can conditionally recommend lwIP as a TCP/IP stack for use with libcurl. The version we were forced to use (hacked by the processor vendor's software team) was a few versions out of date. As I wrote before, we had problems with any combination of overlapped transactions, reused connections, and secure transactions (HTTPS with TLS).

Things have probably improved with newer releases of lwIP. You can access the lwIP users mailing list and list archives at http://lists.nongnu.org/mailman/listinfo/lwip-users and see if others in that community are using libcurl.

GaryM @ casabi


-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html

Loading...