Repository navigation
Emulated sensors from definitions (firmware 3.10.3 commands) - #1
Merged
Merged
Conversation
Vendored sensor_def.wasm from benchpod-firmware 3d015497062c (the same file the server vendors), its sha256 record, and scripts/update-sensor-engine.sh to refresh it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sensor_define (chunked), sensor_start, sensor_set, sensor_stop, sensor_status, sensor_regs (one base64 reply), sensor_la by instance, sensor_fault/_clear and the sensor_stimulus commands, with the reply shapes and errors of the firmware's API.md. Definitions compile and run in the pod's own engine (sensorengine): I2C/SPI register images, UART messages on the sensor's TX pin, analog values on the DAC. Up to 4 I2C sensors share a bus by address; pins are owned by sensor:<instance>. The first digital sensor loads the emulation image (2), which fpga_image now knows, and the closed loop and deep replay name the way back. The node's BMP280 now reads the library's bmp280 definition. The single-sensor sensor_start/sensor_set/sensor_types and the gps_* commands are gone, and status reports firmware 3.10.3, gateware 54, caps sensors and sensors_format 1. The MCP end-to-end test uses the new tools (embeddedci-mcp 2.13.11). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The simulated pod now speaks the pod's new sensor API (benchpod-firmware docs/API.md, "Emulated sensors") instead of the removed single-sensor and GPS commands, so the website demo and the desktop app's demo work with embeddedci-mcp 2.13.11.
sensorengine: the pod's sensor definition engine (sensor_def.wasm, built from benchpod-firmwarestm32h563/wasm, the same file the server vendors) run with wazero, with a sha256 record andscripts/update-sensor-engine.sh.benchsim:sensor_define(chunked,dry_run),sensor_start,sensor_set,sensor_stop,sensor_status,sensor_regs(one base64 reply),sensor_laby instance,sensor_fault/sensor_fault_clear,sensor_stimulus/_start/_stop, with the firmware's reply shapes and error texts. Register images, UART messages and analog values come from the engine. Up to 4 I2C sensors share a bus by address, pins are owned bysensor:<instance>, the first digital sensor loads the emulation image (fpga_image2), and analog sensors on the DAC lock out the DAC commands untilsensor_stopordac_stop.bmp280definition; the node's compensation code reads the engine's image back exactly.sensor_types, the oldsensor_start/sensor_setforms,gps_*. Status reports firmware 3.10.3, gateware 54,capssensors,sensors_format1,sensors_digital.sensors_test.go(define/chunks/errors, start checks and shared buses, regs, faults reaching the node, stimulus values and scheduled faults, UART output, an NTC on the DAC, the emulation image), andTestMCPEndToEndon the new MCP tools, green against embeddedci-mcp 2.13.11.Not modeled: the sensor FIFO, data-ready pins,
on_writerules beyond storing the byte, UART requests, the SPI bus on the wire, the 4-20 mA output (README).Note: the MCP's
sensor_capturesends no sample rate, so a pod captures at its highest rate (4096 bytes = 0.68 ms at 24 MHz), shorter than one BMP280 read; it decodes no transaction here, and likely on a real pod too (the oldi2c_sensor_capturedefaulted to 500 kHz).🤖 Generated with Claude Code