Rust project for the nRF9151 using Embassy async runtime with the embassy-net-nrf91 modem driver.
- Embassy async framework for embedded Rust
- Direct AT command interface to the modem
- UART logging at 115200 baud
- Network registration monitoring (CEREG)
rustup target add thumbv8m.main-none-eabihf# Using cargo
cargo install probe-rs-tools
# Or using brew on macOS
brew install probe-rsThe nRF9151 requires Nordic's modem firmware to be flashed separately. Download it from: https://www.nordicsemi.com/Products/nRF9151/Download
Use nRF Connect for Desktop's Programmer app to flash the modem firmware.
cargo build --releasecargo run --releaseThe application outputs logs via UART at 115200 baud:
- TX: P0.29
- RX: P0.28
Connect a serial terminal to view the output.
nrf9151-modem/
├── .cargo/
│ └── config.toml # Target and runner configuration
├── src/
│ └── main.rs # Application entry point with AT commands
├── Cargo.toml # Dependencies (embassy-net-nrf91, embassy-nrf)
├── memory.x # Memory layout (IPC + RAM regions)
└── README.md
The project uses the following memory layout for modem IPC:
| Region | Address | Size | Purpose |
|---|---|---|---|
| FLASH | 0x00000000 | 1024K | Application code |
| IPC | 0x20000000 | 64K | Modem shared memory (IPC) |
| RAM | 0x20010000 | 192K | Application RAM |
The example demonstrates basic AT command usage:
| Command | Description |
|---|---|
AT |
Basic test command |
AT+CFUN? |
Query functional mode |
AT+CFUN=1 |
Enable modem (full functionality) |
AT+CEREG=2 |
Enable registration URCs |
AT+CEREG? |
Query registration status |
AT+CGMR |
Get modem firmware version |
AT+CGSN |
Get IMEI |
| Value | Meaning |
|---|---|
| 0 | Not registered, not searching |
| 1 | Registered, home network |
| 2 | Not registered, searching |
| 3 | Registration denied |
| 4 | Unknown |
| 5 | Registered, roaming |
This project uses Embassy git dependencies for compatible versions:
embassy-executor- Async executor for Cortex-Membassy-nrf- nRF HAL with Embassy support (nrf9160-s feature)embassy-net-nrf91- Modem driver for nRF91 seriesembassy-time- Async timers
- Ensure your DK is connected
- Check USB cable (some are charge-only)
- Try
probe-rs listto see connected probes
- Ensure modem firmware is flashed on the device
- The modem firmware must be downloaded separately from Nordic
- Wait for "Modem ready!" message before sending commands
- Check that a SIM card is inserted
- Verify antenna is connected
- Check signal strength in your location
- Some networks may take time to register (wait 30+ seconds)
This project uses git dependencies from the Embassy repository. If you encounter version conflicts, ensure all embassy crates are from the same git revision.