Jupiter Nano

by Starcat

Tiny, high-performance computer that runs Linux or the NuttX real-time operating system

View all updates Aug 26, 2021

Intro to Networking and Running NuttX on Jupiter Nano

by Adam

With the worldwide chip shortage caused by COVID-19, we’ve had to acquire all the key components in advance to ensure we could make all the boards for our backers. I’m happy to report that with the help of Crowd Supply and Mouser, we have secured enough of all the key chips to make more than 400 Jupiter Nanos.

Today’s update is a quick tour of booting NuttX on Jupiter Nano and getting networking set up. It’s similar to last week’s update where we did this with Linux, but with some key differences for NuttX. In the next update, I’ll go over how to build your own NuttX binary and get it installed on the Jupiter Nano.

NuttX Quickstart

This quickstart guide is for using Jupiter Nano with NuttX and assumes you are familiar with Apache NuttX and Internet networking.

Creating a Bootable Micro SD Card - NuttX

Download this disk image and burn it to your Micro SD card using Balena Etcher:

Jupiter Nano Apache NuttX image

Unlike the Linux SD Card image, which had a small, bootable FAT partition and a separate large Linux partition, this image only has one large FAT partition. For SD Cards under NuttX, FAT filesystems are the best persistent storage mechanism that can be also used easily with other computers.

Connecting to Jupiter Nano

Jupiter Nano has been tested on macOS and Linux. If you have problems, please contact the Jupiter Nano mailing list.

  1. Install the Micro SD Card.

  2. Plug the Micro USB cable into the Jupiter Nano Console port.

  3. Start a serial terminal:

    $ picocom --imap lfcrlf -b 115200 /dev/ttyACM0
    
    

    (Or use whatever device your serial terminal is on your machine.)

  4. You should see the system booting:

Click image to enlarge

  1. NuttX shell

    You should see something like this (here we’re running help to see all the nsh commands, and then ifconfig):

Networking Using Ethernet over USB on NuttX

These instructions have only been tested on Linux. On macOS and Windows you will need to do something similar to what is in the netusb.sh script. If you get a script running for these platforms, please contribute it to the Jupiter Nano Tools repository via a pull request!

  1. Plug a Micro USB cable into the Jupiter Nano Native port (keep the Console cable plugged in).

    NuttX will boot, the blue status LED should be on steady and bright, and the network is brought up.

  2. Using the Jupiter Nano console session, let’s look at our devices and IP numbers:

    nsh>ifconfig
    eth0  Link encap:Ethernet HWaddr 00:e0:de:ad:be:ef at UP
        inet addr:10.0.0.2 DRaddr:10.0.0.1 Mask:255.255.255.0
    
    lo    Link encap:Local Loopback at UP
        inet addr:127.0.0.1 DRaddr:127.0.0.1 Mask:255.0.0.0
    
    

    On this version of NuttX, eth0 is a USB Ethernet Gadget interface, it automatically assigns a static IP number of 10.0.0.2 and sets the default route to 10.0.0.1. This is configurable when you compile NuttX or you can build a configuration filesystem separately. More on this in another update.

  3. On your Linux workstation, let’s check out our network interfaces and see which one is the USB Ethernet Gadget:

     $ cd jupiter-nano-tools
     $ sudo ./scripts/netusb.sh show
     enx020000112233: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1486
             inet 10.0.0.1  netmask 255.0.0.0  broadcast 10.255.255.255
             ether 02:00:00:11:22:33  txqueuelen 1000  (Ethernet)
             RX packets 55  bytes 3164 (3.1 KB)
             RX errors 0  dropped 0  overruns 0  frame 0
             TX packets 957  bytes 108787 (108.7 KB)
             TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    
    

    On my Ubuntu 20.04 Linux computer, the USB Ethernet Gadget interface is enx020000112233. Yours will probably have a name; if you want to verify manually, you can do ifconfig -a, unplug the Native USB cable, and do ifconfig -a again. The USB Ethernet Gadget interface will be the one that disappears.

  4. On your Linux workstation again, set up the network (replace wlp0s20f3 with the name of the network interface you use to connect to the Internet):

     $ cd jupiter-nano-tools
     $ sudo ./scripts/netusb.sh wlp0s20f3 enx020000112233 on
     $ sudo ./scripts/netusb.sh wlp0s20f3 enx020000112233 on
     default via 192.168.1.1 dev wlp0s20f3 proto dhcp metric 600
     169.254.0.0/16 dev br-cc496150b4da scope link metric 1000 linkdown
     172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 linkdown
     172.18.0.0/16 dev br-cc496150b4da proto kernel scope link src 172.18.0.1 linkdown
     192.168.1.0/24 dev wlp0s20f3 proto kernel scope link src 192.168.1.209 metric 600
    
     enx020000112233: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1486
             inet 10.0.0.1  netmask 255.0.0.0  broadcast 10.255.255.255
             ether 02:00:00:11:22:33  txqueuelen 1000  (Ethernet)
             RX packets 55  bytes 3164 (3.1 KB)
             RX errors 0  dropped 0  overruns 0  frame 0
             TX packets 969  bytes 111151 (111.1 KB)
             TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    
    
     default via 192.168.1.1 dev wlp0s20f3 proto dhcp metric 600
     default via 192.168.1.209 dev enx020000112233 proto static metric 20100
     10.0.0.0/24 dev enx020000112233 scope link src 10.0.0.1
     10.0.0.0/24 dev enx020000112233 proto kernel scope link src 10.0.0.1 metric 100
     10.0.0.2 dev enx020000112233 scope link src 10.0.0.1
     169.254.0.0/16 dev br-cc496150b4da scope link metric 1000 linkdown
     172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 linkdown
     172.18.0.0/16 dev br-cc496150b4da proto kernel scope link src 172.18.0.1 linkdown
     192.168.1.0/24 dev wlp0s20f3 proto kernel scope link src 192.168.1.209 metric 600
     192.168.1.209 dev enx020000112233 proto static scope link metric 20100
    
     PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
     64 bytes from 10.0.0.2: icmp_seq=1 ttl=64 time=0.164 ms
    
     --- 10.0.0.2 ping statistics ---
     1 packets transmitted, 1 received, 0% packet loss, time 0ms
     rtt min/avg/max/mdev = 0.164/0.164/0.164/0.000 ms
    
    

    This brings up the usb0 USB Ethernet Gadget interface on your local machine, gives it the IP address of 10.0.0.1, and sets up routing from 10.0.0.2 to the Internet.

  5. Then, on the Linux workstation you can do:

    $ ping -c 1 10.0.0.2
    PING 10.0.0.2 (10.0.0.2) 56(84) bytes of data.
    64 bytes from 10.0.0.2: icmp_seq=1 ttl=64 time=0.155 ms
    
    --- 10.0.0.2 ping statistics ---
    1 packets transmitted, 1 received, 0% packet loss, time 0ms
    rtt min/avg/max/mdev = 0.155/0.155/0.155/0.000 ms
    $ telnet 10.0.0.2
    Trying 10.0.0.2...
    Connected to 10.0.0.2.
    Escape character is '^]'.
    
    NuttShell (NSH) NuttX-10.0.1
    nsh>
    
    
  6. On the Jupiter Nano console or telnet session, you should now be able to do the following:

    $ ping 10.0.0.2
    nsh> ping -c 1 10.0.0.1
    PING 10.0.0.1 56 bytes of data
    56 bytes from 10.0.0.1: icmp_seq=0 time=0 ms
    1 packets transmitted, 1 received, 0% packet loss, time 1010 ms
    $ ping 8.8.8.8
    nsh> ping -c 1 8.8.8.8
    PING 8.8.8.8 56 bytes of data
    56 bytes from 8.8.8.8: icmp_seq=0 time=20 ms
    1 packets transmitted, 1 received, 0% packet loss, time 1010 ms
    
    

Conclusion

You can see the complete Jupiter Nano documentation on the Starcat Documentation site – where you can find hardware info, pinouts, links to hardware design files, software source code, and the Linux and NuttX instructions. More detailed info will be there soon and I’ll link to it in future updates.

As always, if you have questions, email me at adam@starcat.io!

About the Author

Adam

adamfeuer  ·   Seattle, WA


$15,674 raised

of $3,250 goal

482% Funded! Order Below

Product Choices

$99

Jupiter Nano

High-performance SAMA5D27C-LD1G development board that runs Linux or NuttX


$13

microSD Card With Operating System

A 2 GB microSD card, pre-loaded with NuttX or Linux, ready to boot your Jupiter Nano


$19

Custom USB Cable for Port B

Native USB Port B Panel mount cable - Female USB Type-A to female IDC header connector


$7

Micro-USB Cable

A Micro-USB to USB Type-A cable chosen for the fit of its connector housing

Credits

Starcat

Electronics R&D company specializing in open source hardware and high performance biosignals acquisition equipment; creator of the HackEEG shield successfully launched on Crowd Supply in 2020


Adam Feuer

See Also

Subscribe to the Crowd Supply newsletter, highlighting the latest creators and projects: