Nutt Mac OS
. Thanks: This lecture notes is based on several OS books and other OS classes Silbersatz. Al Stallings Bic and Shaw G. Nutt Free BSD book Professor Felix Wu’s notes for ECS 150 U. Washington (451: Professors Gribble, Lazowska, Levy and Zahorjan) ECS 150 OS Organization, 2. Getting started with NuttX and Esp32 on MacOS In this post, we will be looking at getting an ESP32 working with NuttX and WIFI networking enabled, using a Mac as the development platform. The ESP hardware is a LOLIN32, but any dev-kit C ESP32 hardware will work fine.
In this post, we will be looking at getting an ESP32 working with NuttX and WIFI networking enabled, using a Mac as the development platform. The ESP hardware is a LOLIN32, but any dev-kit C ESP32 hardware will work fine.
The inspiration for this post is based on Sara Monteiro's nuttx+esp32 getting started article article, but adapted for MacOS and extended to support WIFI networking configuration.
Mac Os Download
For the sake of simplicity, I will be using a environment variable to point of the folder used for this project. I am also using fish as the default shell.
Download NuttX
First step is to checkout the source NuttX code:
Build kconfig configuration tool.
Bootloader
Alternatively, building your own version of the boot-loader can be done quite easily, provided you have docker installed.
If all works fine, you should be able to see the built files in the out_ folder:
ESP-IDF
Assuming that you have already installed the ESP-IDF, you should be able to
App Configuration
Generate the kernel/app configuration for the ESP32 platform.
This will create the file .config which contains all the necessary flags for ESP32. For example, this is the generated config for the devkit-C:
Build
If all goes fine, you should be able to see this at the end of the compilation
Flash
Nutt Mac Os Catalina
I am using a Wemos LOLIN32 1.0
Connecting to NuttX shell
Just write help and you'll should see this:
Voila, that's it for the basic config. Next step is to enable the WIFI connectivity.
NuttX uses the uIP networking stack, unlike ESP-IDF which uses LWiP.
Basic Network config
Enabling WIFI can be done by configuring the nuttx app:
Go to Networking Support and enable it, as well as
To make it easier to debug, I also enabled the traces from:
After flashing the, the following logs can be seen:
Accessing WAPI
WAPI is a lightweight wrapper for iwconfig, wlanconfig, ifconfig, and route commands, and that's the command we need to use to scan the av available access points.
The first attempt resulted in a failure due to the missing ioctl support.
After enabling the Wireless IOCTL
Unfortunately, at the time of writing (Feb. 2021), one can notice that from the esp32_wlan.c, the scan is not currently supported. So, the only possiblity is to connect manually:
From my access point running OpenWRT, I could notice that the ESP32 was connected, and was allocated an IP address. However, from the NSH CLI, the IP address remmained unchanged:
Also, pinging the device from my Mac laptop to the IP address mentionned on the OpenWRT router, would result in frames beeing dropped (or unanswered) since uIP did not get the correct IP config.
Enabling DHCP support
To enable the DHCP client:
After that, and refering to this post on esp32.com, it is possible to enable the DHCP for the network initlization using:
It is quite weird to have to configure the Router IPv4 address, and further more having to do it using hexadecimal (0xc0a80101 in my case), but well, that's the only way to get things working.
Unfortunately, that was not enough. After trying to setup the SSID and passkey from WAPI, it always ended-up with errors:
Nutt Mac Os X
The only way to overcome this issue was to set the SSID and passkey directly in the menu config, under Application -> Network Utilities -> Network initialization -> WAPI Configuration (SSID / Passprhase). And fortunately, after that, it was possible to the the correct IP address:
Pinging the Internet
Unfortunately, even after having the correct IP condiguration, PING would still not work, failing with socket address family unsupported.
The missing link was to enable IPPROTO_ICMP socket support under Networking Support -> ICMP Networking Support
Voila, finally, it's working :-)

Also, just in case, I could see some random failures during the ping: up_assert: Assertion failed at file:mm_heap/mm_free.c line: 170 task: ping
NuttX is definitely a promising solution - especially considering the eco-system that is forming arround it. However, at this stage the ESP32 support is quite limited. But the good news is that Espressif seems to be proactively adding support for their chip, so let's hope that within a few weeks WIFI - and other drivers - will be completely supported.
Next step is to try to enable Ethernet on the W32-ETH01