Skip to content

zzzbatmand/NINA-Arduino

Repository files navigation

NINA-Arduino

This is a modifyed version of the NINA-FW version found HERE.

This version is a bit simplyfied, and has been modiyed to use Arduino, instead of ESP-IDF, as this allows support for more recent ESP32 version.
It might have been better to just update the ESP-IDF compatability version, but I don't know how, and I am better at arduino.

Some features have been removed, or might just not work, but most should.

This version is tested with and support atleast the following modules:

  • ESP32
  • ESP32-C3

Other modules might work, but these where the ones I had at hand.


Installing Firmware

You can just use the Arduino-IDE to build and install the firmware.

NOTE: If you know how to use the esptool to do this correctly, please do tell.
There is some hidden code, but I don't know if that works.
The parts might need to be combined into a single file.


Building a custom ESP32 firmware

The building itself is actually quite simple. All that is needed is the Arduino-IDE

As well as a few libraries:


Wiring

The connection between the ESP32-C3 and the Pico is as follows:

PICO            ESP32-C3
VSYS    <-->    VIN
GND     <-->    GND
GP7     <-->    IO7  (CS)
GP10    <-->    IO18 (_Ready)
GP11    <-->    EN   (_EN)
GP16    <-->    IO6  (MISO)
GP18    <-->    IO4  (SCK)
GP19    <-->    IO5  (MOSI)

The pins may vary, depending on your module.
Read the optional section below, to change this.
Also see the section Find correct pins to find the correct pins.



Change pins (OPTIONAL)

The pins for SPI change depending on what board is used.
The current pins are configured for the ESP32-C3.

The pins can be changed in "SPIS.cpp"
At the buttom, you will see:

SPISClass SPIS(SPI2_HOST, SPI_DMA_CH_AUTO, 5, 6, 4, 7, 18);

These are the pins, used for the SPI communication, and can be changed to fit your chip.
The pin order can be found in the function definition:

SPISClass::SPISClass(spi_host_device_t hostDevice, int dmaChannel, int mosiPin, int misoPin, int sclkPin, int csPin, int readyPin)

NOTE: Do not change the hostDevice or dmaChannel unless the ESP gives an error.


Find correct pins

You can look up the ESP32 model, you are working on, to see what pins are used for SPI.
You can also just run the project in SPI-Pins to make it print the default SPI pins to you.



TODO:

There is a lot of TODO and NOTE tags in the source code that can give an inside on some changes that is needed, but here is a few.

Add UDP-Multicast

I had some issues with the UDP-Multicast feature, so I have removed it from this build.

Add BearSSL

Since BearSSL made the compiler slow, as well as some libraries were missing, then I chose to disable it for the time being.
This could be enabled for later use, if it is needed.>

Note: Regular SSL still works.

Add OTA

The OTA update has been disabled, this should proboably be added at some point.
Maybe also add a way for SPI to send a new firmware.

Other missing features

Just see what is missing, or might be needed and add that.
This version just has what I needed when making it.


References

ESP32 Toolcahin

https://docs.espressif.com/projects/esp-idf/en/v3.3.1/get-started/index.html#setup-toolchain

Original NINA-FW

https://github.com/adafruit/nina-fw

About

Modifyed the NINA-FW to run with arduino. This supports esp32c3

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages