Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.
This repository was archived by the owner on Sep 15, 2025. It is now read-only.

How to use on board Ethernet in NuttX #13

@jfm92

Description

@jfm92

This guide if focus in boards that have on board ethernet. This guide won't go so deeply, because use the network capabilities in NuttX is near the same than in Linux, so internet is plenty of info about how to set-up a TCP/IP server, UDP client or whatever.
In this guide, we will see how to change from a telnet server to a TCP/IP echo server. This is example is usefull to change from a standart example to your custom app.
If you use an external module to have ethernet conectivity, maybe you will use an SPI or an UART module, so it's different the way that we use it.

Configuration:

The configuration to set-up the networking utilities is quite tricky, so we're going to use a predefined config profile.
If you're using the olimex board, you can use this profile:
olimex-stm32-e407\telnetd

Important Note: Use networking functionality is incompatible with use built-in apps, so despite of you can use the nsh console, you can run any APP. So, to run an APP with networking capabilities we will run at the start up as the entry APP.

In the menuconfig go to -> RTOS Features -> Tasks and Scheduling -> Application entry point .
Change from telnetd_main to tcpecho_main (but you can change to whatever you want, for example your custom app main file).

Then go to Application Configuration -> Examples -> Check Simple TCP echo server.
In the submenu, it's necessary to add the next data:
Target IP: 0xc0a80185 (192.168.1.133)
Default Router IP address: 0xc0a80101

And finally unchecked telnet daemon example

This is for this specifically example, but you can check other custom APP

Code

In the folder APP/Examples there are examples of:

  • TCP/IP Server (Example name:tcpecho)
  • UDP Server and client (Example name:udp )
  • Telnet Connection (Example name:telnetd)
  • Send Mail (Example name:sendmail)
  • Network test example (Example:nettest)

In the examples you can see how to implement different kinds of protocols and functionalities, also as I said before, is near the same as in Linux of how to implement any protocol.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions