mbed OS 2 and mbed OS 5
This is the handbook for mbed OS 2. If you’re working with mbed OS 5, please see the new handbook and API References. For the latest information about networking, please see ARM mbed Networking Stack.
New networking stack
Note that this page refers to the new officially supported networking stack, which is designed to supercede the previous networking stack.
Most networking examples on mbed still rely on the old stack, but all new stack development will take place on this version.
The mbed microcontroller is capable of connecting to the internet, and functioning as client or server for a variety of protocols. To achieve this, the LwIP TCP/IP stack has been ported to mbed.
Step one, physical connection¶
Step two, set up the networking stack¶
On the Ethernet Interface page you will find everything you need to set an IP address, and bring up the stack.
Afterwards, you should hopefully have TCP/IP up and running over Ethernet.
Where to look next:
- Details of support for protocols such as HTTP can be found at: TCP IP protocols and APIs
- The raw socket API is at Socket.
About this networking stack¶
The introduction of an mbed RTOS among the officially supported mbed libraries allowed us to finally add an officially supported networking stack providing the familiar Berkeley sockets programming interface. The previously community supported networking stacks, because of the lack of an operating system, could only support a "polling" paradigm. Besides, providing a more familiar programming interface, this new networking stack provides an impressive performance improvement: benchmark.
Let's analyse the above layers from top down:
- Your networking applications will very likely rely on a specific protocol (HTTP, NTP, FTP, etc), or API (Twitter, Cosm, Evrythng, etc). You can see a list of the protocol and API libraries developed by the mbed community on this page: TCP/IP Protocols and APIs
- The EthernetInterface library is wrapping all the other libraries with a specific configuration for the Ethernet transport. In particular, its subcomponents are:
- The mbed RTOS is actually providing the implementation abstracted by lwip-sys
- The mbed library is mainly used for providing the CMSIS layer, timer, and reading unique MAC address.
The networking stack is currently supporting two different transports:
Where to get help¶
If you have questions on the usage of this stack, the best place to ask is in the Forum.