Maker Pro
phyBOARD

VFFE — Vision Front-End for Flight Computer (Annita-1)

September 29, 2026 by Alejandro Daniel Conti
Share
banner

A satellite image triage pipeline on a COTS crossover MCU: filtering what's worth sending home before it ever reaches the downlink.

Every pixel a satellite sends to ground costs power, bandwidth, and ground-station time — resources that are always scarce and often the actual bottleneck of a mission, not the camera itself. Most small satellites still capture first and decide later, on the ground, days after the opportunity to act on the data has passed.

VFFE flips that order. It's an onboard vision front-end that looks at every frame before it's transmitted, scores how valuable it actually is, and decides right there — discard it, compress it, or send it in full — using a Science Value Score (SVS) computed from image quality, a lightweight neural classifier, and transmission cost.

Why phyBOARD-RT1170 (and why not rad-hard)

Rad-hardened flight computers exist for good reason, but they're expensive, slow to iterate on, and usually years behind commercial silicon in raw compute. For CubeSats and many small-sat missions flying in relatively benign orbits with adequate shielding and error-correcting memory, that trade-off is increasingly being questioned — commercial off-the-shelf (COTS) processors are already flying, and the compute they bring is hard to ignore when the mission is compute-bound rather than radiation-bound.

The i.MX RT1176 on the phyBOARD-RT1170 is a strong fit for that argument: a real dual-core crossover MCU (Cortex-M7 + Cortex-M4) with a dedicated hardware image co-processor (PXP), enough headroom to run a quantized neural network on-device, and it's available today, off the shelf, at a fraction of the cost and lead time of a space-qualified part. VFFE is our attempt to show that a serious onboard decision pipeline — not a toy demo — is realistic on hardware like this.


How it works

An important note on the camera: the ESP32-S3 + OV5640 module is a stand-in sensor, not the point of the project. VFFE's actual contribution — the decision pipeline — is sensor-agnostic. That's also why the onboard classifier is trained on real Sentinel-2 satellite imagery (the EuroSAT dataset), not on photos taken by the camera itself. The camera exists to prove the pipeline works against a live, asynchronous, imperfect data source, the way a real payload would.

On the RT1170 itself:

  • M7 core runs the full pipeline: TJpgDec JPEG decode, PXP-accelerated rotation, an image quality score (sharpness via Laplacian variance + contrast), classical features (RGB565 histograms, Sobel edge density, ROI blue-dominance), a quantized TinyML CNN (98.44% int8 test accuracy on EuroSAT water-vs-land, TFLite Micro + CMSIS-NN), and the final SVS decision engine.
  • M4 core owns UART acquisition from the camera — receiving and validating the framed JPEG protocol (0xAA 0x55 [len] [payload] [checksum]) independently of the M7's compute load, and handing off complete, checksum-verified frames through shared OCRAM.

Pipeline (Conti Algorithm SVS)

  1. JPEG decode (TJpgDec) and 180 degree rotation on the PXP
  2. Image quality score: Laplacian-variance sharpness and contrast
  3. Classical features: RGB565 histograms, Sobel edge density, blue dominance in a region of interest
  4. Water/land classifier: int8 CNN trained on EuroSAT (Sentinel-2), TFLite Micro with CMSIS-NN
  5. Science Value Score (SVS): quality, event likelihood and transmission cost combined into a single decision

The camera is an ESP32-S3 with an OV5640. It is a stand-in sensor; nothing in the pipeline depends on it.

Camera link

The ESP32 sends a JPEG roughly every 2 s over UART, 115200 8N1:


0xAA 0x55 [len_lo] [len_hi] [JPEG bytes] [XOR of the JPEG bytes]


The M4 parses the stream with a small state machine and only publishes a frame to shared memory once the checksum matches:

See Code #1


Starting the M4 from the M7

The M4 image is built separately, embedded in the M7 app as a C array, copied to RAM at boot and released from reset:

See Code #2



Things that cost time and are worth knowing if you do the same on this board:

  • The M4 .bin is built with CONFIG_ROM_START_OFFSET=0x2000, so the vector table sits at the load address plus 0x2000, not at the start of the blob. Pointing VTOR at the base gives a core that never runs.
  • Flush the M7 data cache after the copy. The M4 reads RAM directly and can otherwise see stale bytes.
  • The reset write to SRC->CTRL_M4CORE before BT_RELEASE_M4 mirrors what Zephyr's own second_core_boot() does. Without it the M4 booted unreliably.
  • A byte array holding the TFLite model needs alignas(16). Unaligned, AllocateTensors() hangs with an unaligned-access fault.
  • CONFIG_HEAP_MEM_POOL_SIZE defaults to 0 here, which makes ipc_service_open_instance() fail with -ENOMEM.
  • With the shared-memory hand-off, invalidate the cache on the M7 side before reading what the M4 wrote.

Build

The apps were built inside a PHYTEC zephyr-phytec-application west workspace, each one under my_apps/. Board targets are phyboard_atlas/mimxrt1176/cm4 and phyboard_atlas/mimxrt1176/cm7.


See Code#3

You can see a real, second-by-second replay of the 415-frame stability run — including live quality scores, classifier confidence, and the SVS decision — here: https://alejandroxconti.github.io/annita1/console/ Every number in it is pulled from the actual captured log, not staged.

Engineering notes

New Status (updates)

  • firmware/m7-integration + firmware/m4-acquisition run as one loop: the M4 owns LPUART5 and validates frames (XOR checksum, ping-pong buffers), the M7 copies them from shared memory with a sequence re-check and runs the pipeline. A ~14 minute run processed 333 of 333 frames with all error counters at 0.
  • That run used a nearly static scene, so every frame was discarded. It validates the transport, not the SVS.
  • The compress branch was exercised with a blue object in front of the camera (water probability 0.98-0.99). That is a functional demonstration, not an evaluation of the classifier: it may be reacting to color. A labeled test set is still needed.
  • firmware/m7-processing runs the same pipeline standalone, receiving on its own LPUART5 (118 consecutive frames, 0 checksum failures).
  • Fixed: the M7 parser summed the payload bytes while the ESP32 and the M4 use XOR, so it rejected almost every frame.
  • Open: root cause of the M4 cache incoherence (see above), a protocol v2 (CRC16, sequence number, payload type), and a clean-workspace build of the repo.


COTS-based onboard AI: pros and cons

Pros

  • Order-of-magnitude more compute and memory than typical rad-hard flight processors, at a fraction of the cost and lead time.
  • A real hardware image co-processor (PXP) and enough headroom for on-device ML inference — both out of reach on many legacy space-grade MCUs.
  • Fast iteration: the entire pipeline above was built, measured, and revised on a single dev kit in real dev cycles, not multi-month radiation-qualification cycles.

Cons

  • No inherent radiation tolerance — viable mainly for shorter missions, benign orbits, or designs that accept redundancy/voting at the system level instead of at the silicon level.
  • Long-term flight heritage and qualification data are far thinner than for rad-hard parts, which matters for mission insurance and review boards.
  • Dual-core coordination (as this project found firsthand) adds real firmware complexity that a single-core rad-hard design doesn't have to deal with.

What's next

Architecture Improvements & Hardware-in-the-Loop Validation

  • Memory Protection Unit (MPU) Configuration: Transition from manual software cache cleaning (L1CACHE_CleanInvalidateSystemCacheByRange) to configuring the MPU region for shared memory as Non-cacheable / Shareable. This eliminates potential core race conditions and cache incoherency between the Cortex-M4 and Cortex-M7 under heavy workloads.
  • Internal Memory Fault Injection (SEU Emulation): Implement a low-priority background thread or timed interrupt to corrupt specific bits in the internal SRAM and TFLite model tensor arenas. This emulates radiation-induced Single Event Upsets (SEU) to test the robustness of the application's memory scrubbing and exception handling.
  • Protocol V2 Implementation: Upgrade the framing protocol from a simple XOR checksum to CRC16/CRC32 with explicit frame sequence numbers. This prevents multi-bit corruptions undetected by XOR under orbital electromagnetic interference.
  • SEU Radiation Mitigation: Mitigate memory bit-flips on the COTS microcontroller. Implement an external hardware watchdog and runtime memory scrubbing to periodically refresh the TFLite Micro weights in RAM from stable Flash memory.
  • Context-Aware SVS Expansion: Integrate satellite bus telemetry (battery state of charge, orbital position, and ground station contact windows) into the Science Value Score equation. This dynamically throttles transmission based on power and link budget.
  • Fault Injection Rig (FPGA Basys3 Artix-7): Utilize a Basys3 FPGA to intentionally corrupt UART lines, drop bits, inject bit-flips, or simulate clock drift. This validates the resilience of the M4 acquisition state machine and error-handling routines under harsh orbital conditions.
  • Real Satellite Data Injection (ESP32 + SD Card): Store raw, uncompressed satellite images on an SD card attached to the ESP32. The ESP32 will stream these realistic scenes over UART to assess true-to-life classification accuracy and telemetry stability.


REPO :

https://github.com/AlejandroxConti/annita1.git

Code #1

switch (state) {
case ST_WAIT_AA: if (c == 0xAA) state = ST_WAIT_55; break;
case ST_WAIT_55: state = (c == 0x55) ? ST_LEN_LO : ST_WAIT_AA; break;
case ST_LEN_LO:  frame_len = c; state = ST_LEN_HI; break;
case ST_LEN_HI:
	frame_len |= (uint16_t)c << 8;
	if (frame_len == 0 || frame_len > JPEG_MAX) {
		state = ST_WAIT_AA;
	} else {
		idx = 0; checksum = 0; state = ST_PAYLOAD;
	}
	break;
case ST_PAYLOAD:
	shm_jpeg[idx++] = c;
	checksum ^= c;
	if (idx >= frame_len) state = ST_CHECKSUM;
	break;
case ST_CHECKSUM:
	if (c == checksum) publish_frame(frame_len);
	state = ST_WAIT_AA;
	break;
}

Code #2

memcpy((void *)M4_BOOT_ADDRESS, g_m4_image, g_m4_image_len);
sys_cache_data_flush_range((void *)M4_BOOT_ADDRESS, g_m4_image_len);

IOMUXC_LPSR_GPR->GPR0 = IOMUXC_LPSR_GPR_GPR0_CM4_INIT_VTOR_LOW(M4_VTOR_ADDRESS >> 3u);
IOMUXC_LPSR_GPR->GPR1 = IOMUXC_LPSR_GPR_GPR1_CM4_INIT_VTOR_HIGH(M4_VTOR_ADDRESS >> 16u);

SRC->CTRL_M4CORE = SRC_CTRL_M4CORE_SW_RESET_MASK;
SRC->SCR |= SRC_SCR_BT_RELEASE_M4_MASK;

Code #3

# M4
west build -b phyboard_atlas/mimxrt1176/cm4 -d build_m4 my_apps/m4-acquisition

# embed the M4 binary in the M7 app (generated file, not committed)
(cd build_m4/zephyr && xxd -i zephyr.bin) \
  | sed -E 's/^unsigned char [A-Za-z0-9_]+\[\]/unsigned char g_m4_image[]/; s/^unsigned int [A-Za-z0-9_]+ =/unsigned int g_m4_image_len =/' \
  > my_apps/m7-vision-pipeline/src/m4_image/m4_image_data.c

# M7
west build -b phyboard_atlas/mimxrt1176/cm7 -d build my_apps/m7-vision-pipeline
west flash -d build

Author

Avatar
Alejandro Daniel Conti

Passionate about space technology, quantum mechanics, and continuous learning—but especially from my daughter, Hanna!

Related Content

Comments


You May Also Like