Repository navigation
DEV-1108: BMP581 pressure sensor support on the Shimmer3R - #20
Merged
Merged
Conversation
The 0xA6 reply to 0xA7 is [len = 1 + n][sensorId][n coefficient bytes]. The handler dropped len and sensorId and parsed 21 BMP390 coefficients from whatever followed, which on a BMP581 (id 3, n = 0) is a 1-byte payload. It also indexed receivedBytes[1] before checking the count, and did not wait for the whole reply. - Wait for the full reply, decode len and sensorId, and reject a len that does not match the id (22/24/21/0 for ids 0/1/2/3). The sensor type is stored on PressureTempSensor. Id 2 parses the coefficients through the unchanged BMP390 path; id 3 parses none. - When 0xA7 fails or the reply is malformed, fall back to the firmware's SR-number rule (ShimBrd_isBmp581PresentPerSrNumber, incl. SR38 >= 4.2 and the two SR48 windows) plus LogAndStream >= 1.1.6. A NACK (v1.01.006 on a BMP581) only reaches the fallback once NACK handling resumes the command with a failure. - processData: BMP581 branch, Pa = u24 / 64 (reported in kPa as for the BMP390) and degC = signExtend24(u24) / 65536, masked first, no clamp. Channel names and formats are unchanged. - setInfoMom reads the oversampling MSB from ConfigSetupByte4 bit 0 (InfoMem 130) on the Shimmer3R; the 8 BMP581 labels are exposed. InfoMem writes on the Shimmer3R are still not implemented. - XCTests: shared conversion vectors, the frame vector, 0xA6 decoding and the firmware's SR-rule cases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 4, 2026
JongChern
approved these changes
Oct 15, 2026
JongChern
left a comment
Contributor
There was a problem hiding this comment.
Reviewed against the Java driver's master. The BMP581 conversion, the SR-number rule (including SR38-4-2 and both SR48 ranges) with its LogAndStream v1.01.006 guard, parsing the 0xA6 reply by its declared length, the in-band sensor ID overriding the rule, and the 3-bit resolution field all match.
Also checked:
- The firmware version and expansion board are read before the pressure request, so the fallback has what it needs.
- CI builds and runs the tests (32 pass, including the BMP581 ones). This covers the build the description says wasn't done locally.
Still open before release: a hardware check on a BMP581 Shimmer3R.
3 tasks
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.
Adds BMP581 support for the Shimmer3R, which replaces the BMP390 on up-rev'd boards (DEV-817/818). Jira: DEV-1108.
Problem
The 0xA7 handler dropped the reply's length and sensor-ID bytes and always parsed 21 BMP390 coefficients. A BMP581 replies
[A6][01][03](sensor ID 3, no coefficients) from LogAndStream_Shimmer3R v1.01.007. It also readreceivedBytes[1]before checking the count.Change
[len][sensorId][n bytes], and reject a length that doesn't match the ID (22/24/21/0 bytes for IDs 0/1/2/3). The sensor type is stored onPressureTempSensor.ShimBrd_isBmp581PresentPerSrNumber, including SR38 >= 4.2 and both SR48 ranges) plus LogAndStream >= 1.1.6.Tests
XCTests in
SensorTest.swift:0xFE5556→ −1.6667 °C, the DEV-1102 regressiontest_bmp581_gatecasesThis has not been compiled locally (no Xcode on the authoring machine). This PR's CI run is the first build.
Known limitations
Cross-API check
The same work is under way in C# (DEV-1107), pyshimmer (DEV-1109), Java (DEV-1110: in-band ID and SR38) and the Web SDK SD log (DEV-1111).
🤖 Generated with Claude Code