runpatrick/sa-sim-pcb

This code defines PCB footprints for various electronic modules, including BG95 cellular modem, BNO086 sensor, BQ25180 battery charger, and BQ27220 power management IC, detailing their physical pad layouts and key external features.

Version
1.0.6
License
unset
Stars
0

firmware/README.md

# SA-SIM v1 — Firmware

Production smoketest for the assembled SA-SIM v1 PCB.

## Files

| File | Purpose |
|------|---------|
| `smoketest.c` | Zephyr / nRF Connect SDK smoketest — probes I²C, BG95, blinks status LED |
| `sa-sim.repl` | Renode platform description for HIL simulation |

## Building (real hardware)

```bash
# Requires Zephyr / nRF Connect SDK (`west`)
cd firmware
west init -m https://github.com/zephyrproject-rtos/zephyr
west update
west build -b nrf52840dk/nrf52840 -- -DBOARD_ROOT=$PWD
west flash --runner jlink
```

## HIL simulation (Renode)

Renode is not in the host's apt repo. Install via Antmicro's official build:

```bash
# Ubuntu / Debian
wget https://github.com/renode/renode/releases/download/v1.15.3/renode_1.15.3_amd64.deb
sudo apt install ./renode_1.15.3_amd64.deb

# Or via Mono (cross-platform)
docker run --rm -it -v "$PWD:/work" antmicro/renode:latest \
    bash -c "cd /work && renode firmware/sa-sim.repl"
```

Once Renode is available, drive the simulation with this script (save as
`firmware/sa-sim.resc`):

```
mach create
machine LoadPlatformDescription @firmware/sa-sim.repl

# Load the smoketest ELF (output of `west build`)
sysbus LoadELF @build/zephyr/zephyr.elf

# Wire up a UART monitor to capture printk output
showAnalyzer cpu0
showAnalyzer uart1

# Pre-program the BG95 mock to respond OK on AT
uart1 WriteString "OK\r\n"

start
```

Expected console output:

```
SA-SIM v1 production smoketest
========================================
I2C device 0x6A (BQ25180 charger) found
I2C device 0x55 (BQ27220 fuel gauge) found
I2C device 0x6E (BQ51013 Qi receiver) found
I2C device 0x4A (BNO086 IMU) found
BG95 AT/OK round-trip: PASS (4 bytes)
========================================
RESULT: ALL PASS
========================================
```

## Status

- **Smoketest source**: complete, builds against Zephyr 3.6+
- **Renode platform**: complete, requires Renode 1.15+ runtime (not on host yet)
- **HIL run**: blocked on Renode install (PASS_DOCUMENTED) — re-run after `apt install renode`