GNSS Livestock Ear Tag Feasibility
Table
| Resource | Used / available |
|---|---|
| Flash | 129,852 / 1,048,576 bytes — 12.38% |
| RAM, including reserved stacks/heap | 38,016 / 262,144 bytes — 14.50% |
Text
PASS bounded line/NMEA malformed-long-binary checks; command whitelist rejects TX/erase/write/arguments PASS actual RX1024 ring: delayed bursts, wrap1000, overflow/discontinuity discard-resync, checksums, RMC A/V/malformed and receive-time stale FIX PASS actual TMP117/LIS2DW12/VBAT conversions: negative/extreme/invalid/null/INT32 overflow inputs and exhaustive16-bit domain HOST TESTS PASSED; ASan+UBSan exit0 expected; no hardware/dispatch/RF/storage behavior test claimed
pinmap
| U1 module pad | SoC/function | live net |
|---|---|---|
| 1 | GND | GND |
| 2 | GND | GND |
| 3 | P1.10 | CHG_STAT1 |
| 4 | P1.11 | CHG_STAT2 |
| 6 | P1.13 | PG_3V3 |
| 11 | P0.02 | VBAT_SENSE |
| 15 | GND | GND |
| 16 | P0.27 | I2C_SCL |
| 19 | P0.26 | I2C_SDA |
| 22 | P0.06 | UART_TX |
| 23 | P0.07 | GNSS_PPS |
| 24 | P0.08 | UART_RX |
| 27 | P0.11 | INT_ACCEL |
| 28 | VDD | 3V3 |
| 29 | P0.12 | INT_TEMP_ALERT |
| 30 | VDDH | 3V3 |
| 32 | VBUS | GND |
| 33 | GND | GND |
| 36 | P0.14 | SPI_MOSI |
| 37 | P0.13 | SPI_CLK |
| 38 | P0.16 | SPI_CS_LORA |
| 39 | P0.15 | SPI_MISO |
| 40 | P0.18 | MCU_RST |
| 41 | P0.17 | SPI_CS_FLASH |
| 42 | P0.19 | LORA_BUSY |
| 43 | P0.21 | INT_LORA_DIO1 |
| 44 | P0.20 | LORA_RST |
| 46 | P0.22 | LORA_RXEN |
| 50 | P1.02 | GNSS_EXTINT |
| 51 | SWDIO | SWDIO |
| 53 | SWDCLK | SWDCLK |
| 55 | GND | GND |
| 61 | P1.01 | GNSS_RST |
Bash
nrfjprog --program agrivanna-safe.hex --sectorerase --verify -f NRF52 nrfjprog --reset -f NRF52
Text
help status sensors accel vbat flash radio
gnss-on and ble-start. GNSS remains powered and received continuously; gnss-on/off controls location printing only. BLE advertising is off at boot.Waiting for input
pinmap
| U1 module pad | SoC/function | live net |
|---|---|---|
| 1 | GND | GND |
| 2 | GND | GND |
| 3 | P1.10 | CHG_STAT1 |
| 4 | P1.11 | CHG_STAT2 |
| 6 | P1.13 | PG_3V3 |
| 11 | P0.02 | VBAT_SENSE |
| 15 | GND | GND |
| 16 | P0.27 | I2C_SCL |
| 19 | P0.26 | I2C_SDA |
| 22 | P0.06 | UART_TX |
| 23 | P0.07 | GNSS_PPS |
| 24 | P0.08 | UART_RX |
| 27 | P0.11 | INT_ACCEL |
| 28 | VDD | 3V3 |
| 29 | P0.12 | INT_TEMP_ALERT |
| 30 | VDDH | 3V3 |
| 32 | VBUS | GND |
| 33 | GND | GND |
| 36 | P0.14 | SPI_MOSI |
| 37 | P0.13 | SPI_CLK |
| 38 | P0.16 | SPI_CS_LORA |
| 39 | P0.15 | SPI_MISO |
| 40 | P0.18 | MCU_RST |
| 41 | P0.17 | SPI_CS_FLASH |
| 42 | P0.19 | LORA_BUSY |
| 43 | P0.21 | INT_LORA_DIO1 |
| 44 | P0.20 | LORA_RST |
| 46 | P0.22 | LORA_RXEN |
| 50 | P1.02 | GNSS_EXTINT |
| 51 | SWDIO | SWDIO |
| 53 | SWDCLK | SWDCLK |
| 55 | GND | GND |
| 61 | P1.01 | GNSS_RST |
west build -p always: FLASH 129852/1048576 B (12.38%), RAM 38016/262144 B (14.50%). GNU12.2.0/SDK0.17.4, Zephyr4.2.0; 2 inherited DTS alias warnings, 0 C/linker/Kconfig warnings. Final compiled-input hashes, binary hashes, ZIP integrity verified.gnss-on/off ONLY controls location printing (default off). Two256-byte UARTE EasyDMA buffers feed timestamped1024-byte ring. Bounded producer/consumer, overflow/drop/stop/restart/error counters; partial data flushed and discarded through newline after overflow/gap. No GNSS TX/config. Actual shared RMC/checksum/stale and TMP117/LIS2DW12/VBAT conversion functions sanitizer-tested, including delayed bursts, wrap/overflow/resync, negatives/extremes/invalid/INT32 overflow-domain inputs. Unused arm/scratch helpers removed. Host allowlist tested; actual dispatch/peripherals/ISR timing/RF/storage NOT tested. Static audit is not hardware proof.Live module-pad/SoC/net pinmap
| U1 module pad | SoC/function | live net |
|---|---|---|
| 1 | GND | GND |
| 2 | GND | GND |
| 3 | P1.10 | CHG_STAT1 |
| 4 | P1.11 | CHG_STAT2 |
| 6 | P1.13 | PG_3V3 |
| 11 | P0.02 | VBAT_SENSE |
| 15 | GND | GND |
| 16 | P0.27 | I2C_SCL |
| 19 | P0.26 | I2C_SDA |
| 22 | P0.06 | UART_TX |
| 23 | P0.07 | GNSS_PPS |
| 24 | P0.08 | UART_RX |
| 27 | P0.11 | INT_ACCEL |
| 28 | VDD | 3V3 |
| 29 | P0.12 | INT_TEMP_ALERT |
| 30 | VDDH | 3V3 |
| 32 | VBUS | GND |
| 33 | GND | GND |
| 36 | P0.14 | SPI_MOSI |
| 37 | P0.13 | SPI_CLK |
| 38 | P0.16 | SPI_CS_LORA |
| 39 | P0.15 | SPI_MISO |
| 40 | P0.18 | MCU_RST |
| 41 | P0.17 | SPI_CS_FLASH |
| 42 | P0.19 | LORA_BUSY |
| 43 | P0.21 | INT_LORA_DIO1 |
| 44 | P0.20 | LORA_RST |
| 46 | P0.22 | LORA_RXEN |
| 50 | P1.02 | GNSS_EXTINT |
| 51 | SWDIO | SWDIO |
| 53 | SWDCLK | SWDCLK |
| 55 | GND | GND |
| 61 | P1.01 | GNSS_RST |
nrfjprog --program agrivanna-safe.hex --sectorerase --verify -f NRF52 then nrfjprog --reset -f NRF52. This replaces application sectors; no mass erase/recover default. Stop if access-protected, do not automatically erase.help, status, sensors, accel, vbat, flash, radio, gnss-on, gnss-off, ble-start, ble-stop. BLE advertising only on explicit command; no LoRa TX. Flash commands are read-only. Charger has no firmware control. Initial regulated 5.0 V J2, no battery; current limits/rail inspection in this plan still apply.radio only reset/GetStatus with bounded BUSY wait and reset afterward. Do not proceed to stage 7 with this baseline. Optional destructive scratch-sector test omitted; stage 5 uses JEDEC/status/read only. BLE advertising is diagnostic-name only, not a GATT diagnostic service. PPS/interrupt levels polled, not precision timestamped. No field/geofence/energy qualification.5V ONLY, + at pin1, - at pin2. Regulated 5.0 V only. Recommended BQ25185 IN maximum is 5.5 V; never use 6 V. F1 (1206L020YR) is 0.2 A hold at 20 °C; expected peak SYS demand ≈0.13–0.15 A (LoRa TX). Input current limit set by R2 = 18 k (500 mA ILIM, 4.2 V VSET, TI Table 6-1).BATT, +, NC, -. Protected Renata pack or a current-limited battery emulator only. Verify cable polarity with a DMM before mating; do not infer from housing colour.K, net VIN_F. Package rev B silkscreen: misleading library anode-side bar removed; project cathode bar printed beside the K pad. Still confirm under microscope (body band must face the K/bar side).Table
| Stage | Procedure | Criterion / stop condition |
|---|---|---|
| 1 Unpowered inspection | Microscope: polarity of D1 (K mark), D2, U1/U2/U3/U4/U5/U6/U8/U9 pin-1 dots against silkscreen; no solder bridges on U9 (0.4 mm pitch) and U6; measure VIN, SYS, VBAT, 3V3 to GND resistance | No rail-to-GND short; polarities correct; otherwise STOP |
| 2 First power, no battery | J1 disconnected. J2 = regulated 5.0 V, current limit 50 mA, then raise to ≤300 mA. Radios off (blank or safe firmware) | No heating; record idle current. Hitting current limit = STOP and diagnose |
| 3 Rails before peripherals | Measure TP1 VIN ≈5.0 V, TP3 SYS, TP4 3V3 = 3.3 V ±3 %, 3V3_GNSS/3V3_LORA, U6 switch-node ripple; confirm U9 ~CE high (charging off) and no BAT current | All rails in range; CE high; any oscillation, overshoot or temperature anomaly = STOP |
| 4 SWD | Connect probe to TP4–TP8; read nRF52840 ID; flash diagnostic firmware (separately written and reviewed, radios disabled by default) | Probe does not back-power the board; readback OK |
| 5 Peripherals, non-radiating | U4 flash JEDEC ID and scratch-sector R/W; U8 WHO_AM_I + INT; U5 temperature; U2 UART NMEA with passive antenna; U3 SPI status only, no TX | IDs match parts; no rail excursions |
| 6 Battery/emulator | Emulator through J1 at 3.7 V, current-limited; verify VBAT path via Q4 and that no charge current flows into J1 with J2 present. Do not connect a real pack and J2 together until this is proven. | BAT current ≤ leakage with charging disabled; no reverse feed |
| 7 LoRa TX (supervised) | Only with correct antenna or 50 Ω load on J4. Short TX bursts at lowest power first, then rated power; watch SYS, 3V3 and F1 temperature | No brownout or reset during TX; F1 not tripping; board temperature within limits |
| 8 GNSS / BLE functional | GNSS fix with passive antenna outdoors/window; BLE advertising only if authorized | Functional only; not position-integrity or range qualification |
Reviewed silent firmware baseline v2 — 31 October 2026
Historical first compiled firmware addendum — superseded by v2 above; links and programming examples obsolete
Hardware facts this plan relies on
Equipment
Ordered procedure and acceptance
Out of scope / not claimed
Gate status