Contiki-NG Logo
  • Getting Started
    • Docker
      • Setup
      • Launching and Exiting
        • Shell for new container
        • Additional shell for existing container
        • Exit
      • Usage
      • On Windows
        • Prerequisites
        • Limitations
        • How to Run
      • On macOS
        • Without XQuartz
          • for “Docker for Mac”
          • for “Docker Toolbox on macOS”
        • With XQuartz
          • for “Docker for Mac”
          • for “Docker Toolbox on macOS”
      • Using a different docker image
      • Running out-of-tree-tests
    • NAT64 for Contiki-NG
      • Overview
        • Implementation approach and trade-offs
      • How it works
      • Quick start
        • 1. Build the border router
        • 2. Start the border router with NAT64
        • 3. Configure IoT nodes
      • Supported protocols
        • End-to-end security and application protocols
      • Security model
      • Example application
      • Configuration
        • Build-time options
        • Gateway tuning
        • 6LoWPAN compression context (throughput tuning)
      • Troubleshooting
      • Standards compliance
    • The Contiki‐NG build system
      • Build system output structure
      • Cleaning
      • More options
      • Makefiles used in the Contiki-NG build system
    • The Contiki‐NG configuration system
      • Modules
      • Network Stack: MAC Layer
      • Network Stack: NET Layer
      • Routing protocol
      • System configuration
    • The Contiki‐NG logging system
      • Using the logging system
      • Supporting the logging system in a module
    • Toolchain installation on Linux
      • Install development tools for Contiki-NG
        • Install ARM compiler
        • Install MSP430 compiler
        • Install Java for the Cooja network simulator
        • Install JTAG software for CC2538 (optional)
        • Install a CoAP client (optional)
        • Install the Mosquitto MQTT broker and accompanying clients (optional)
      • User access to USB
        • Improve stability for CC2538
        • After configuration
      • Clone Contiki-NG
    • Toolchain installation on macOS
      • Install development tools for Contiki-NG
        • Install some python packages
        • Install the ARM GCC toolchain
          • Manual Installation
        • Install the MSP430 toolchain
        • Install Java JDK for the Cooja network simulator
        • Install a CoAP client (libcoap)
      • Clone Contiki-NG
    • Vagrant
      • Instructions
      • Provision a VM with a desktop environment
      • Making local modifications to your Vagrant image
      • Connecting USB devices to your vagrant guest image
        • An example for VirtualBox
          • VirtualBox: Adding USB devices manually
          • VirtualBox: Adding USB devices by configuring the Vagrant image
  • Programming Contiki-NG
    • 6TiSCH 6top sub layer
      • Overview
      • Code Structure
      • Configuration Paramters
        • Caveat
      • Example
      • Test
      • Using 6top
      • Implementing a Scheduling Function
      • References
    • Antelope
      • Programming Antelope
      • Antelope Query Language (AQL)
        • Creating a database
        • Adding an index
        • Inserting data
        • Querying the database
    • CoAP
      • About CoAP
      • CoAP in Contiki-NG
        • Main parts of the CoAP implementation
        • Configuration
      • CoAPs - Secure CoAP
        • Limitations
        • Changes 4.0 -> 4.1
      • Usage
    • Coffee
      • The CFS Programming Interface
        • Opening and Closing Files
        • Using Files
        • Listing Directory Contents
        • Coffee extensions of CFS
        • Files
        • Garbage Collection
        • The Root Directory
        • Porting Coffee
    • Communication Security
      • Application-layer security
      • Key agreement with EDHOC
      • Link-layer security
    • EDHOC - Ephemeral Diffie-Hellman Over COSE
      • Overview
        • Key Features
      • Configuration
        • Essential Configuration Parameters
        • Optional Configuration
      • Client API (Initiator)
      • Server API (Responder)
      • Key Storage and Credentials
        • Credential Exchange Modes
      • Key Export
      • Examples and Testing
      • Performance Considerations
      • Dependencies
      • Troubleshooting
      • References
    • Energest
      • The Energest Module
      • The Energest types
        • Adding new Energest types in a platform
        • Adding new Energest types in an application
      • Platform configuration for Energest
      • Using the Energest Module
    • IPv6
    • IPv6 multicast
      • The Big Gotcha
      • Where to Start
      • How to Use
      • How to extend
    • IPv6 over BLE
      • Overview
      • Features
      • Modules
        • BLE radio
        • BLE L2CAP layer
      • Using BLEach
        • IPv6-over-BLE node (BLE slave)
    • LWM2M
      • OMA Lightweight M2M and IPSO Smart Objects
        • LWM2M in Contiki-NG
        • Creating an IPSO Object
    • MQTT
      • MQTT in Contiki-NG
      • Limitations
    • Memory management
      • MEMB: Memory Blocks
      • Heap Memory (HeapMem)
    • Multitasking and scheduling
      • Processes and Events
      • The Contiki-NG Scheduler and Event Dispatch
      • Interrupts and contexts
        • Access to Shared Resources
        • Writing interrupt handlers
    • NullNet
      • Sending with NullNet
      • Receiving with NullNet
    • Orchestra
      • Overview
      • Requirements
      • Getting Started
      • Configuration
    • Packet buffers
      • uIP buffer
      • Packetbuf
      • Queuebuf
    • Porting Contiki‐NG to new platforms
      • Port Contiki-NG to your board and MCU
        • CPU code
          • Configure the build system
          • Develop MCU drivers
          • Interrupt handlers
        • Platform code
          • Prepare the configuration system
          • Configure the build system
          • Provide startup, main loop and low-power functions
          • Develop platform drivers
          • Add support for similar board variants
        • Create some examples
        • Add CI tests
        • Add documentation
      • Some common good practice
        • Observe the code style convention
        • Avoid code duplication
        • Is it a CPU thing, or is it a platform thing?
        • Do not add platform code in platform-independent files
      • Support
    • Processes and events
      • Process Definition
      • Events and Scheduling
        • Waiting for events
        • Pausing and yielding
        • Stopping processes
        • System-defined Events
        • User-defined Global Events
        • Module-local Events
    • RPL
      • About RPL
      • Implementations
        • RPL Classic
        • RPL Lite
      • Modes of operation (MOP)
        • Storing mode
        • Non-storing mode
        • Mode of operation 0 (MOP0)
      • RPL Lite: topology formation and configuration
        • DAG Advertisement
        • Joining
        • Preferred parent selection
        • Route registration
        • DAG maintenance
    • Repository structure
    • SNMP
      • Documentation: SNMP
        • SNMP in Contiki-NG
        • Versions
        • Usage
        • Todo
    • Synchronization primitives
      • Global Interrupt Manipulation
      • Data Memory Barriers
      • Critical sections
      • Mutexes
      • Atomic compare-and-swap
    • TSCH and 6TiSCH
      • Overview
      • Getting started
      • Features
      • Platforms
      • Code structure
      • Using TSCH
        • Using TSCH with Security
        • TSCH Scheduling
        • Configuring the association process
      • Porting TSCH to a new platform
        • Radio features required for TSCH
        • Timing macros required for TSCH
      • Per-slot logging
      • Additional documentation
    • TSCH example applications
    • Timers
      • The Clock Module
      • The Timer Library
      • The Stimer Library
      • The Etimer Library
      • The Ctimer Library
      • The Rtimer Library
    • UDP communication
  • Tutorials
    • CoAP
      • Build your own CoAP application
      • CoAP client
    • Cooja: simulating a border router
    • Energy monitoring
      • The Energest module
      • Running the energest example
    • Hello, World!
      • Running the example as a native node
      • Running the example on a real device
      • Running the example in Cooja
      • Tips
    • IPv6 ping
    • Instrumenting Contiki NG applications with energy usage estimation
      • Using the Energest Module
      • Energest Module capabilities
      • Interpreting Simple Energest output
      • Platform’s current consumption model
      • Estimating charge consumption and energy consumption
      • Code example
    • LWM2M and IPSO Objects
      • Example IPSO objects LWM2M client
        • For platform native
        • For a wireless embedded device
      • LWM2M Server
        • On your computer
        • Registering with global LWM2M server via NAT64
      • LWM2M with DTLS (pre-shared keys)
      • LWM2M with DTLS (certificates)
        • Bootstrapping
        • References
    • LWM2M and IPSO Objects with Queue Mode
      • LWM2M with Queue Mode
    • Logging
    • MQTT
      • On your Linux / OS X device
        • Run your mosquitto broker
        • Subscribe to an MQTT topic and publish to it
        • Build and run the mqtt-client for platform native
      • Run on an embedded device
      • Control your device using MQTT subscriptions
      • Use with the IBM Watson IoT platform
    • RAM and ROM usage
      • Binary file inspection
      • Saving RAM and ROM
    • RPL
      • Deep dive
    • RPL border router
      • Native Border Router
      • Custom Border Router
    • Running Contiki‐NG in Cooja
      • Running Cooja without GUI
    • Running Contiki‐NG in Renode
      • Starting Renode
        • Running from the Contiki-NG tree
        • Running Renode from an arbitrary location
      • Using Renode
    • Running a RPL network in Cooja
    • Shell
      • Troubleshooting: it doesn’t work!!!
      • Troubleshooting: it works, but I can’t see what I’m typing
    • Switching to TSCH
      • Configuration
      • Reducing the memory usage
      • See also
    • TSCH and 6TiSCH
      • Enabling link-layer security
    • Timers and events
      • The etimer
      • The ctimer
      • Running the timer example
  • Platforms
    • cc2538dk: TI cc2538 development kit
      • Port Features
      • Requirements
      • Toolchain Installation
      • Drivers
        • For the SmartRF06 EB (UART)
        • For the CC2538EM (USB CDC-ACM)
      • Improve Stability on Linux
      • Jumper Settings
      • Device Enumerations
      • Software to Program the Nodes
      • Use the Port
        • Node IEEE and IPv6 Addresses
        • Scripted multi-image builds
        • Build a Sniffer - Live Traffic Capture with Wireshark
      • Advanced Topics
        • Switching between UART and USB (CDC-ACM)
        • Selecting UART0 and/or UART1
        • UART Baud Rate
        • RF and USB DMA
        • Low-Power Modes
        • Build headless nodes
        • Code Size Optimisations
      • More Reading
    • cc26x0-cc13x0: TI cc26x0 and cc13x0 platforms
      • Important Note
      • Getting Started
      • Port Features
      • Requirements
      • Examples
        • Build your First Example
      • How to Program your Device
        • Over JTAG
        • Using the ROM bootloader
          • Device enumeration over USB in Linux/OS X
          • Conditions to use the ROM bootloader.
      • Building deployment / production images
      • CC13x0/CC26x0 Border Router over UART
      • CC13x0/CC26x0 slip-radio with 6lbr
      • Filename conflicts between Contiki and CC26xxware
      • Some Sensortag-specific notes
        • UART usage (with or without the Debugger Devpack)
        • External flash on the sensortag
      • IEEE vs Sub-GHz operation
      • Low Power Operation
    • cooja: Cooja native motes platform
    • gecko: Contiki-NG for Silicon Labs (using GSDK)
      • Port Features
      • Prerequisites and Setup
      • Getting Started
      • Examples
      • Compilation Options
      • Support
      • License
      • Resources
    • msp-exp430fr5969: TI MSP-EXP430FR5969 LaunchPad
      • Overview
      • Port Features
      • Prerequisites and Setup
        • MSP430 Toolchain
        • mspdebug
        • USB Permissions (Linux)
      • Getting Started
        • Building
        • Programming
        • Reset
        • Serial Output
      • Compilation Options
        • Compilation Targets
      • Hardware Connections
        • LEDs
        • Buttons
        • UART (Backchannel)
      • Limitations
      • Troubleshooting
        • mspdebug hangs
        • Garbled serial output after reset
        • Build errors about missing headers
      • Resources
      • License
    • native: Contiki-NG as a native process
    • nrf: Nordic Semiconductor nRF5340 and nRF52840 (nRF MDK)
      • Port Features
      • Prerequisites and Setup
      • Getting Started
      • Examples
      • Compilation Options
      • Compilation Targets
        • nRF5340
          • IPC Radio Driver (Recommended)
          • TrustZone Secure Radio
          • GPIO Forwarding (Legacy)
        • nRF54L15
          • FLPR coprocessor
        • SPI
        • Ethernet and IPv4 (IP64)
      • Support
      • License
      • Resources
    • IPv4 uplink for the nRF: ENC28J60 + IP64
      • What you need
      • Set the GPIO voltage first
      • Wiring, nRF54L15 DK
        • Why these pins
      • Configuration
      • Bringing it up
        • 1. The SPI bus
        • 2. The ENC28J60
        • 3. The router
        • 4. A mesh node
      • Things that will cost you time
      • Status of os/services/ip64
    • nrf-vpr: Nordic Semiconductor nRF54L15 FLPR (RV32EMC coprocessor)
      • Port Features
      • Prerequisites and Setup
        • M33 side
        • FLPR side
      • Build and Deploy
      • Examples
      • Compilation Targets
      • Boards
      • Compilation Options
      • How it boots
      • Implementation notes
        • nrfx startup must clear BSS
        • GRTC must be read via the Secure address
        • Channel allowlist override for nrfx-grtc
        • Radio is on the M33, not the FLPR
        • Trap handler
        • Bringing up a new board
      • Known limitations
      • References
    • nrf52840: Nordic Semiconductor nRF52840 (nRF5 SDK)
      • Port Features
      • Prerequisites and Setup
      • Getting Started
      • Examples
      • Compilation Options
      • Compilation Targets
      • Virtual COM and Real Time Transfer
      • Support
      • License
      • Resources
    • openmote: OpenMote-CC2538 and OpenMote-B
      • Port Features
      • Prerequisites and Setup
        • Toolchain Installation
        • Software to Program the Nodes
      • Getting Started
      • Node IEEE and IPv6 Addresses
      • Low-Power Modes
      • Build headless nodes
      • Code Size Optimisations
      • OpenMote-B transceivers
        • Antenna RF switch
        • AT86RF215 driver
      • Maintainers
    • simplelink: TI SimpleLink MCU Platform
      • Port Features
      • Requirements
      • Examples
      • How to Program your Device
        • Over JTAG
        • Using the ROM bootloader
          • Device Enumeration
          • Conditions to use the ROM bootloader
      • Building Deployment / Production Images
      • Border Router over UART
      • slip-radio with 6lbr
      • 2.4 GHz vs Sub-1 GHz operation
      • Low-Power Operation
      • SimpleLink Software Environment
        • Override Core SDK
        • Configure TI Drivers
        • SimpleLink Support
      • Set up Contiki-NG in Code Composer Studio
    • sky: Tmote Sky / TelosB
    • zoul: Zolertia Zoul platforms: Firefly, RE-mote and Orion
      • Zoul Platforms
        • Zolertia Firefly Revision A
          • Firefly pin-out
        • Zolertia RE Mote platform (revision A)
          • Zoul pin-out
        • Zolertia Firefly
        • Zolertia Orion Ethernet Router
          • Orion Technical documentation
          • Orion Ethernet Router pin-out
        • Zolertia RE Mote platform (revision B)
      • Zolertia Zoul Module
        • Zoul pin-out
        • Port Features
        • Requirements
        • Toolchain Installation
        • Drivers
        • Software to Program the Nodes
        • Build your First Examples
        • Node IEEE and IPv6 Addresses
        • Low-Power Modes
          • Shutdown Mode
        • Build headless nodes
        • Code Size Optimizations
        • More Reading
        • Maintainers
  • Organization
    • Code style
      • Standard compliance
      • Naming
      • Formatting scripts
      • Example file
    • Contributing
      • What to contribute
      • How to contribute
      • To which branch do I submit my PR?
      • Pull request merging policy
      • GitHub Actions continuous integration
      • New platforms
    • Development cycle
      • Branches and tags at a glance
    • Issue and Pull Request Labels
      • Labels exclusive to PRs
      • Labels exclusive to Issues
        • Roadmap
        • Bugs
        • Questions and answers
      • Generic labels
    • License
    • Logo
      • Short NG version
      • Expanded version
      • Icon
      • Other versions
    • More about Contiki‐NG
      • Getting Around
    • Organization
    • Press release
      • Find out more at:
      • Engage with the community:
      • API changes for ports outside the main tree
        • Centralized clock_time_t definition
      • Cooja API changes for plugins outside the main tree
      • Changelog
        • Contiki-NG
        • Cooja
    • Roadmap
      • Roadmap
    • Where to report issues, ask questions, etc.?
      • Gitter
      • Github discussions
      • Stack Overflow
      • Github issues
  • Examples
    • 6tisch/6p-packet
      • 6P Packet Examples
    • 6tisch/channel-selection-demo
    • 6tisch/custom-schedule
    • 6tisch/etsi-plugtest-2017
      • The 1st F-Interop 6TiSCH Interoperability Event
        • Overview
        • Authors
        • Supported Hardwares
        • Usage
        • Configuration
    • 6tisch/simple-node
      • Modes of operation
      • Command line settings
    • 6tisch/sixtop
      • 6top Example Description
      • 6top Operation
    • 6tisch/timesync-demo
    • 6tisch/tsch-stats
    • benchmarks/result-visualization
      • Result visualization
      • The Cooja approach
      • The testbed approach
      • Analyzing and plotting the results
    • coap
      • CoAP examples: client, server, and plugtest server
    • cplusplus
    • dev/button-hal
      • Button HAL Example
        • Supported devices
    • dev/gpio-hal
      • GPIO HAL Example
        • Supported devices
        • Extending for other platforms
    • dev/leds
      • LED HAL Example
        • Supported devices
    • dev/rgb-led
      • RGB LED Example
      • Supported devices
    • EDHOC Examples
      • Directory Structure
      • Quick Start
        • Building the Examples
          • EDHOC Server
          • EDHOC Client
        • Running the Examples
          • Native Platform
          • Cooja Simulation
      • Configuration
        • Server Configuration
        • Client Configuration
      • EDHOC Protocol Flow
      • Advanced Usage
      • Supported Platforms
      • Security Considerations
      • Troubleshooting
        • Common Issues
        • Debug Logging
      • Further Reading
    • hello-world
    • libs/deployment
    • libs/ipv6-hooks
    • libs/ipv6-uipbuf
    • libs/logging
      • Logging
    • libs/shell
    • libs/simple-energest
    • Example unittest project
    • lwm2m-ipso-objects
      • LWM2M with IPSO Objects Example
    • mqtt-client
      • MQTT Client Example
        • Publishing
        • Subscribing
        • IBM Quickstart Service
    • NAT64 DNS Lookup Example
      • Overview
      • Testing with Cooja (no hardware needed)
        • 1. Start the Cooja simulation
        • 2. Start the native border router with NAT64
        • 3. Observe the output
      • Running on real hardware
        • 1. Build and flash the DNS client on the sensor node
        • 2. Start the native border router with NAT64
      • How It Works
      • Files
    • platform-specific/cc2538-common
      • README file for CC2538 common examples
    • platform-specific/cc26x0-cc13x0/base-demo
      • CC13xx/CC26xx Base Demo
    • platform-specific/cc26x0-cc13x0/ble-ipv6
      • BLEach: a fully open-source IPv6-over-BLE stack for Constrained Embedded IoT Devices
        • Overview
        • Features
        • Modules
          • BLE radio
          • BLE L2CAP layer
        • Using BLEach
          • IPv6-over-BLE node (BLE slave)
    • platform-specific/cc26x0-cc13x0/cc26x0-web-demo
      • CC26xx Web Demo Readme
        • Network UART (net-uart)
        • 6lbr Client
        • CoAP Server
        • HTTPD
        • IBM Quickstart / MQTT Client
        • IBM Watson IoT Platform
    • flpr-host
      • Build / Flash
      • Console
    • hello-vpr
    • IPC Radio Service
      • Building and Flashing
      • Optional: nrf_802154 radio with hardware auto-ACK
      • Design
      • Running RPL UDP over IPC
        • TrustZone Mode
      • Related
    • nRF Radio Test
      • Manual use
      • Automated runner
    • Contiki-NG TrustZone example
      • Getting started
      • Running any Contiki-NG application in the normal world
        • Manual build (advanced)
      • GDB setup for nRF (Linux)
    • platform-specific/zoul
      • Zolertia Zoul test examples
        • Compile and install an example
        • Visualize the console output
        • Documentation and guides
    • platform-specific/zoul/node-red
      • RE-Mote + Node Red README
        • Install Mosquitto
        • Fire up a Re-Mote
        • Deploy your Node Red
        • Browse
        • Do more cool stuff
    • platform-specific/zoul/orion
      • RE-Mote IP64 README file
        • IP64 router
        • HTTP client examples
    • rpl-border-router
      • Embedded border router
      • Native border router
      • RPL node
    • rpl-udp
    • sensniff
      • sensniff Contiki Project
        • Running
        • Adding support for more platforms
    • Serial Radio Control Interface
      • Features
      • Protocol
      • Building
      • Python Tools
        • Installation
        • CLI Usage
        • Web Interface
        • Python API
      • Channel Ranges
      • Files
      • Use as a border-router radio
    • slip-radio
    • storage/cfs-coffee
      • Contiki File System (CFS) and Coffee Examples
        • Supported Hardware (tested or known to work)
  • API documentation
Contiki-NG
  • Platforms
  • IPv4 uplink for the nRF: ENC28J60 + IP64
  • Edit on GitHub

IPv4 uplink for the nRF: ENC28J60 + IP64

How to give an nRF board an Ethernet uplink with an ENC28J60 module and turn it into a self-contained border router: RPL root on the 802.15.4 side, NAT64 and DNS64 on the IPv4 side, no Linux host in the data path.

Verified end to end on an nRF54L15 DK with a HanRun HR911105A module, with a Seeed XIAO nRF54L15 as a mesh node.

What you need

  • An nRF board with a free SPI instance and four spare GPIOs.

  • An ENC28J60 module. These are 3.1-3.6 V parts; some vendor listings say 5 V in their pin tables, which is wrong.

  • Four jumpers plus power and ground.

Nothing needs to be soldered, and the module’s INT, RESET, WOL and CLKOUT pins stay unconnected: the driver polls on a 1-tick etimer and soft-resets over SPI.

Set the GPIO voltage first

The nRF54L15 DK ships with VDD at 1.8 V. An ENC28J60 will not run at that voltage. Raise it before connecting anything, in nRF Connect for Desktop -> Board Configurator: select the DK, set VDD to 3300 mV, and write the config. It persists across power cycles.

Do not use 3000 mV, the value most guides show as their example – it is below the ENC28J60’s 3.1 V minimum.

Powering the module from a separate 3.3 V supply while the DK is still at 1.8 V is worse than not working: the module’s SO output would drive 3.3 V into a 1.8 V nRF pin.

Wiring, nRF54L15 DK

Header PORT P1, the middle of the three GPIO headers. It is a dual-row header; read the printed pin numbers rather than counting positions.

Module

DK

Signal

SCK

P1.11

SPI clock

SI

P1.06

MOSI, DK to module

SO

P1.07

MISO, module to DK

CS

P1.12

Chip select, active low

VCC

VDDIO

3.3 V, see above

GND

GND

Module pin names are from the module’s point of view, which is why SI takes the DK’s MOSI and SO feeds its MISO. Swapping those two is the most common miswire.

Why these pins

PORT P1 only brings out P1.04 to P1.14 – the DK silkscreen puts the others in parentheses, meaning they need a board modification. Of the eleven that remain, the console UART (P1.04/05), three buttons (P1.08/09/13) and two LEDs (P1.10/14) already claim seven, leaving exactly four pins for four signals.

That is also why chip select is on P1.12 rather than P1.10, where Nordic’s own devicetree places this SPI’s CS: P1.10 is an LED on this board.

SPIM22 is the instance behind the expansion header. SPIM00 drives the on-board flash, and SPIM20 shares a SERIAL slot with the console UART, so enabling it fails at link time with a duplicate SERIAL20_IRQHandler.

Configuration

WITH_IP64=1 pulls in os/services/ip64. The board or example must then supply three things:

  1. NRF_SPI_INSTANCES, to pick the SPIM instance the module is wired to (the SPI driver itself is built by default).

  2. MODULES += $(CONTIKI_NG_DRIVERS_ETHERNET_DIR)/enc28j60.

  3. CFLAGS += -DUIP_FALLBACK_INTERFACE=ip64_uip_fallback_interface.

plus an ip64-conf.h on the include path selecting the Ethernet driver, and ENC28J60_CONF_USE_SPI_HAL 1 with the ETH_SPI_* pin defines. examples/platform-specific/nrf/ip64-router has all of this.

The ENC28J60 arch layer used here is arch/dev/ethernet/enc28j60/enc28j60-arch-spi-hal.c, which sits on the SPI HAL rather than on a CPU’s registers, so it works on any platform implementing os/dev/spi.h – a board only supplies pin defines.

Bringing it up

Work outwards, so each step isolates one layer.

1. The SPI bus

cd examples/platform-specific/nrf/spi-flash
make TARGET=nrf BOARD=nrf54l15/dk spi-flash.upload

Talks to the DK’s on-board flash on SPIM00, so it proves the SPI driver before any external wiring exists. Expect a JEDEC ID of c2 28 17.

2. The ENC28J60

cd examples/platform-specific/nrf/enc28j60-test
make TARGET=nrf BOARD=nrf54l15/dk enc28j60-test.upload

Probes the chip before handing it to the driver, because enc28j60_init() waits for ESTAT.CLKRDY in a loop with no timeout – on a miswired board it hangs silently. A good run:

ESTAT:    01  OK (CLKRDY set)
EREVID:   06  OK (silicon rev B7)
reg r/w:  5a  OK
MAC r/w:  02:de:ad:be:ef:01  OK
ENC28J60 OK

ff everywhere means nothing is driving MISO: check MISO, CS, and that SI and SO are not swapped. 00 everywhere means MISO is stuck low, usually power or ground. Anything else points at SCK or too high a bit rate.

With a cable in a live switch it then prints received frames.

3. The router

cd examples/platform-specific/nrf/ip64-router
make TARGET=nrf BOARD=nrf54l15/dk ip64-router.upload

Becomes the RPL root and brings up IP64. It reports the address DHCP gives it:

IPv4 address acquired:
  address   192.168.101.103
  netmask   255.255.255.0
  gateway   192.168.101.1

At that point the board answers pings from your LAN.

The example can also prove the translator without a second board. Define NAT64_TEST_ADDR to an IPv4 host running nc -u -l 7777 and the router sends UDP through its own NAT64 prefix: a locally generated packet to an off-link, unroutable destination takes the same uIP fallback path (tcpip.c: output_fallback) that a forwarded one does.

4. A mesh node

cd examples/platform-specific/nrf/nat64-node
make TARGET=nrf BOARD=nrf54l15/xiao nat64-node.flash

Joins the RPL network and, with NAT64_TEST_ADDR defined in its project-conf.h the same way as for the router, sends UDP to that IPv4 host. This exercises what the router’s self-test cannot: the forwarding hop, and a per-source entry in ip64’s address map. With both probes enabled, a listener sees one IPv4 source address and two distinct mapped ports. Neither probe is on by default, so a stock build does not send traffic to anyone’s LAN.

Defining NAT64_LOOKUP_NAME additionally resolves that hostname through DNS64, pointing the resolver at a public IPv4 DNS server via the NAT64 prefix (NAT64_DNS_SERVER, Google’s by default):

DNS64 OK: leshan.eclipseprojects.io -> 64:ff9b::23.97.187.154

Prefer this over hardcoding IPv4 literals in NAT64 form; those go stale. It is off by default because it sends a query to a third-party resolver.

Things that will cost you time

Reading the DK console needs DTR. P1.06 and P1.07 double as the on-board debugger’s UART RTS/CTS. Once the ENC28J60 is wired to them, a terminal that does not assert DTR reads zero bytes at every baud rate – indistinguishable from dead firmware. Open both VCOM ports, read the second at 115200, and assert DTR and RTS. If output is still missing, halt the core over J-Link and resolve the PC: platform_idle means the firmware is fine and the capture path is not.

Firmware that prints once at boot loses it. The banner is emitted while the debugger is still resetting the target. Print periodically instead, or pulse reset only after the serial port is open.

Keep the bus slow to start. 4 MHz is reliable on jumper wires. At 8 MHz a ESTAT of 02 instead of 01 – a one-bit shift – means MISO is being sampled too early; that is signal integrity, not a driver fault. Short leads with ground returns, or moving MOSI/MISO off the debugger’s pins with BUTTON_HAL_CONF_ENABLED 0, raise the ceiling. Throughput is bounded by the driver’s 1-tick receive poll anyway.

RPL join takes about a minute. A node printing “waiting to join” for 40 seconds has not failed.

An ENC28J60 draws well over 100 mA with the link up. If the board browns out when the cable goes in, power the module separately and tie the grounds – with the DK at 3.3 V the logic levels still match.

Status of os/services/ip64

ip64 had no runtime test and no functional commits for years, and the Zoul Orion was the only board in the tree that could run it. Everything above was brought up against that code as-is; the translator, the address map, the DHCP client and DNS64 all work. Treat unexplained behaviour as plausibly a latent bug in the module rather than in your wiring, and note that the examples here are the only runtime coverage it has.

Previous Next

© Copyright 2018-2022, Contiki-NG maintainers and contributors.

Built with Sphinx using a theme provided by Read the Docs.