# NPi i.MX6ULL Support

*This is a work in progress. It currently boots off MicroSD cards and not eMMC*

[![Hex version]( "Hex version")](

This is the base Nerves System configuration for the [NPi

![NPi i.MX6ULL](assets/images/npi_imx6ull.png)
<br><sup>[Image credit](#digikey)</sup>

| Feature              | Description                     |
| -------------------- | ------------------------------- |
| CPU                  | 800 MHz ARM Cortex-A7           |
| Memory               | 512 MB DRAM                     |
| Storage              | 8 GB eMMC Flash and MicroSD     |
| Linux kernel         | 5.10 w/ RCN patches             |
| IEx terminal         | UART `ttymxc0`                  |
| GPIO, I2C, SPI       | Yes - [Elixir Circuits]( |
| Display              | Yes, but not supported yet      |
| ADC                  | Yes                             |
| PWM                  | Yes, but no Elixir support      |
| UART                 | ttymxc0                         |
| Camera               | None                            |
| Ethernet             | Two 100 Mbps (eth0 and eth1)    |
| WiFi                 | Requires USB WiFi dongle/driver |
| RTC                  | Yes w/ battery                  |
| HW Watchdog          | i.MX6 watchdog enabled on boot. Be sure to enable `heart` in your vm.args or the device will reboot |

WARNING: 32 GB and larger MicroSD cards don't work!

## Using

This port currently only runs off a MicroSD card. It has not been updated to
support eMMC usage. If you're interested, please see
[#1]( Because of
this, you'll need to modify the boot select switches to `SD` boot (It's
`01001001`, but see legend on PCB)

The most common way of using this Nerves System is create a project with `mix` and add `npi_imx6ull` references where needed and in a similar way
to the default systems like `bbb`, etc. Then export `MIX_TARGET=npi_imx6ull`.
See the [Getting started
for more information.

If you need custom modifications to this system for your device, clone this
repository and update as described in [Making custom

## Console access

The console is configured to output to the 4-pin white header near the power
connectors. A 3.3V FTDI cable is needed to access the output.

In theory, the console could be routed to the display. The display hasn't been
enabled. See

If you would like console access via the LCD, you will need to enable LCD
support in the Linux kernel, and change `erlinit.conf` to output to `tty1`.

## Networking

The board has two 100 Mbps Ethernet interfaces. Here's an example `:vintage_net`
configuration that enables both of them:

config :vintage_net,
  config: [
       type: VintageNetEthernet,
       ipv4: %{method: :dhcp}
       type: VintageNetEthernet,
       ipv4: %{method: :dhcp}

The USB C connector provides a virtual Ethernet connection making it possible to
both power and connect to the board using one cable. This is enabled in
`:vintage_net` by adding a `"usb0"` entry to the network config:

config :vintage_net,
  config: [
    {"usb0", %{type: VintageNetDirect}}

You can combine the two configs and have three network interfaces or add a USB
WiFi dongle for a fourth one. If adding a WiFi dongle, though, you'll need to
enable the kernel drivers and add the firmware for it to a custom image.

## Linux and U-Boot versions

The NPi i.MX6ULL vary by kernel version and patch set. Nerves tracks those
maintained by Robert Nelson at

Nerves also integrates the NPi i.MX6ULL's U-boot patches but modifies them to
support the Nerves U-Boot environment variables.

[Image credit](#digikey): This image is from [Digikey](