Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
7ba38f1
DEV-818 Add BMP581 pressure sensor support hooks
s-varna Jul 7, 2026
826f9b1
Committing clang-format changes
github-actions[bot] Jul 7, 2026
69e1ac2
Fix ShimBrd_isBoardSrNumberGte: use correct two-part version comparison
Copilot Jul 7, 2026
f8dc3af
DEV-818 TEMP: don't NACK GET_PRESSURE_CALIBRATION_COEFFICIENTS on BMP581
s-varna Jul 9, 2026
500b678
DEV-818 NACK pressure-calib command for BMP581; add bmp581.py BT test
s-varna Jul 15, 2026
0c8c3a1
Fix stale TODO DEV-818 comment and add PRESSURE_SENSOR_BMP581 branch …
Copilot Jul 15, 2026
6423406
Remove redundant isBmp581InUse check in response builder; BMP581 alwa…
Copilot Jul 15, 2026
4fdd737
DEV-818 bmp581.py: PEP 263 encoding cookie + guard length-byte read (…
s-varna Jul 16, 2026
718a2d4
DEV-818 Address PR review (Mark): move BMP581 calib NACK to sendRsp; …
s-varna Jul 16, 2026
94eae99
DEV-818 Match BMP581 board list to Jira spec (PR review)
s-varna Jul 16, 2026
58ac87e
DEV-818 Fix BMP581 SR48 detection: exclude SR48-8-0/8-1 (PR review)
s-varna Jul 16, 2026
7705c28
DEV-818 Keep BMP581 calib NACK in ShimBt_processCmd (clean 0xFE)
s-varna Jul 16, 2026
45492c7
Committing clang-format changes
github-actions[bot] Jul 16, 2026
be1b6ab
DEV-818 Fix sendNack-in-sendRsp so calib NACKs are clean (PR review)
s-varna Jul 16, 2026
2d5ae16
DEV-818 Add BMP581/BMP390 fridge-test tooling (live plots + comparison)
s-varna Jul 29, 2026
1068a8c
DEV-818 bmp_compare.py: add --no-corr for evaluating good/unknown BMP…
s-varna Aug 6, 2026
2785b9f
DEV-818 bmp_compare.py: add --pressure pressure-tracking check (climb…
s-varna Aug 7, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions Boards/shimmer_boards.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,36 @@ uint8_t ShimBrd_isBoardSrNumber(uint8_t exp_brd_id, uint8_t exp_brd_major, uint8
&& daughterCardIdPage.expansion_brd.exp_brd_minor == exp_brd_minor));
}

uint8_t ShimBrd_isBoardSrNumberGte(uint8_t exp_brd_id, uint8_t exp_brd_major, uint8_t exp_brd_minor)
{
if (!ShimBrd_isDaughterCardIdSet() || daughterCardIdPage.expansion_brd.exp_brd_id != exp_brd_id)
{
return 0;
}
uint8_t brd_major = daughterCardIdPage.expansion_brd.exp_brd_major;
uint8_t brd_minor = daughterCardIdPage.expansion_brd.exp_brd_minor;
return (brd_major > exp_brd_major)
|| (brd_major == exp_brd_major && brd_minor >= exp_brd_minor);
}

uint8_t ShimBrd_isBmp581PresentPerSrNumber(void)
{
/* The BMP581 replaces the BMP390 on up-rev'd Shimmer3R boards. Per DEV-818
* the fitted models are (>= applies to both rev fields):
* SR31-11-2, SR47-8-2, SR48-7-2, SR48-8-2, SR49-4-2
* SR48 (GSR unified) has two lines: rev 7 from .2 AND rev 8 from .2. The
* rev-7 case must be "major == 7 && minor >= 2" (expressed as >= 7.2 AND
* < 8.0) - a plain >= 7.2 would wrongly include SR48-8-0 / SR48-8-1, which do
* not carry the BMP581. Rev 8 is covered by the separate >= 8.2 check. */
return (ShimBrd_isHwId(HW_ID_SHIMMER3R)
&& (ShimBrd_isBoardSrNumberGte(SHIMMER3_IMU, 11, 2)
|| ShimBrd_isBoardSrNumberGte(EXP_BRD_EXG_UNIFIED, 8, 2)
|| (ShimBrd_isBoardSrNumberGte(EXP_BRD_GSR_UNIFIED, 7, 2)
&& !ShimBrd_isBoardSrNumberGte(EXP_BRD_GSR_UNIFIED, 8, 0))
|| ShimBrd_isBoardSrNumberGte(EXP_BRD_GSR_UNIFIED, 8, 2)
|| ShimBrd_isBoardSrNumberGte(EXP_BRD_BR_AMP_UNIFIED, 4, 2)));
}

uint8_t ShimBrd_isHwId(uint8_t hwIdToCheck)
{
return hwId == hwIdToCheck;
Expand Down
2 changes: 2 additions & 0 deletions Boards/shimmer_boards.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ uint8_t ShimBrd_isI2cOnPPGControlledByAdcChip(void);
uint8_t ShimBrd_areMcuAdcsUsedForSensing(void);

uint8_t ShimBrd_isBoardSrNumber(uint8_t exp_brd_id, uint8_t exp_brd_major, uint8_t exp_brd_minor);
uint8_t ShimBrd_isBoardSrNumberGte(uint8_t exp_brd_id, uint8_t exp_brd_major, uint8_t exp_brd_minor);
uint8_t ShimBrd_isBmp581PresentPerSrNumber(void);
uint8_t ShimBrd_isHwId(uint8_t hwIdToCheck);
uint8_t ShimBrd_isExpBrdId(uint8_t expIdToCheck);
uint8_t ShimBrd_checkCorrectStateForBoot0(void);
Expand Down
32 changes: 31 additions & 1 deletion Comms/shimmer_bt_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,6 @@ void ShimBt_processCmd(void)
case GET_GYRO_RANGE_COMMAND:
case GET_BMP180_CALIBRATION_COEFFICIENTS_COMMAND:
case GET_BMP280_CALIBRATION_COEFFICIENTS_COMMAND:
case GET_PRESSURE_CALIBRATION_COEFFICIENTS_COMMAND:
case GET_GYRO_SAMPLING_RATE_COMMAND:
case GET_ALT_ACCEL_RANGE_COMMAND:
case GET_PRESSURE_OVERSAMPLING_RATIO_COMMAND:
Expand Down Expand Up @@ -831,6 +830,14 @@ void ShimBt_processCmd(void)
getCmdWaitingResponse = gAction;
break;
}
case GET_PRESSURE_CALIBRATION_COEFFICIENTS_COMMAND:
Comment thread
marknolan marked this conversation as resolved.
{
/* Handled in ShimBt_sendRsp alongside GET_BMP180/BMP280_CALIBRATION_
* COEFFICIENTS_COMMAND: a BMP581 self-compensates (no coefficients) and
* NACKs there; a BMP390 returns its coefficients. */
getCmdWaitingResponse = gAction;
break;
}
case TEST_CONNECTION_COMMAND:
{
break;
Expand Down Expand Up @@ -1877,6 +1884,16 @@ void ShimBt_sendRsp(void)
}
case GET_PRESSURE_CALIBRATION_COEFFICIENTS_COMMAND:
{
#if defined(SHIMMER3R)
/* BMP581 self-compensates - no calibration coefficients, so NACK (like
* the BMP180/BMP280 cases above). The switch-set NACK is turned into a
* clean single-byte NACK by the sendNack fixup after this switch. */
if (isBmp581InUse())
{
sendNack = 1;
break;
}
#endif
bmpCalibByteLen = get_bmp_calib_data_bytes_len();
*(resPacket + packet_length++) = PRESSURE_CALIBRATION_COEFFICIENTS_RESPONSE;
*(resPacket + packet_length++) = 1U + bmpCalibByteLen;
Expand All @@ -1894,6 +1911,7 @@ void ShimBt_sendRsp(void)
*(resPacket + packet_length++) = PRESSURE_SENSOR_BMP390;
}
#elif defined(SHIMMER3R)
/* Only reached when a BMP390 is fitted (BMP581 NACKs above). */
*(resPacket + packet_length++) = PRESSURE_SENSOR_BMP390;
#endif
memcpy(resPacket + packet_length, get_bmp_calib_data_bytes(), bmpCalibByteLen);
Expand Down Expand Up @@ -2181,6 +2199,18 @@ void ShimBt_sendRsp(void)
}
getCmdWaitingResponse = 0;

/* A response case above may set sendNack (an unsupported command for the
* fitted hardware - e.g. a pressure-calibration request on a self-
* compensating sensor). The ACK/NACK byte is written before the switch, so
* honour a switch-set NACK here: overwrite the staged ACK with a NACK and
* drop any response bytes so a clean single-byte NACK is sent. */
if (sendNack)
{
resPacket[0] = NACK_COMMAND_PROCESSED;
packet_length = 1;
sendNack = 0;
}

COMMS_CRC_MODE crcMode = ShimBt_getCrcMode();
if (crcMode != CRC_OFF)
{
Expand Down
3 changes: 2 additions & 1 deletion Comms/shimmer_bt_uart.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,8 @@ enum
{
PRESSURE_SENSOR_BMP180 = 0,
PRESSURE_SENSOR_BMP280 = 1,
PRESSURE_SENSOR_BMP390 = 2
PRESSURE_SENSOR_BMP390 = 2,
PRESSURE_SENSOR_BMP581 = 3
};

enum
Expand Down
5 changes: 4 additions & 1 deletion Configuration/shimmer_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,10 @@ void ShimConfig_configBytePressureOversamplingRatioSet(uint8_t value)
#if defined(SHIMMER3)
value = (value <= BMPX80_OSS_8) ? (value & 0x03) : BMPX80_OSS_1;
#elif defined(SHIMMER3R)
value = (value <= BMP3_OVERSAMPLING_32X) ? value : BMP3_NO_OVERSAMPLING;
/* The BMP581 supports two additional oversampling settings (64x and 128x)
* over the BMP390's maximum of 32x */
uint8_t maxOversamplingRatio = isBmp581InUse() ? BMP5_OVERSAMPLING_128X : BMP3_OVERSAMPLING_32X;
value = (value <= maxOversamplingRatio) ? value : BMP3_NO_OVERSAMPLING;
#endif
storedConfig.pressureOversamplingRatioLsb = value & 0x03;
#if defined(SHIMMER3R)
Expand Down
Loading
Loading