Skip to content

Commit ef37c0a

Browse files
marknolanclaude
andcommitted
DEV-1047: know the nRF52840 Span by Nordic's VID and its product string
The nRF52840 Span (verisense-firmware SR9_SPAN_NRF52840) is one CDC port under Nordic's VID, with no FTDI bridge and no MSP430 BSL. Nothing in SH_SEARCH describes it, and the only supported SPAN_VERSION assumes a BSL. - SH_SEARCH.SPAN_NRF52840 ("NeuroLynQ Span") and SERIAL_PORT.NORDIC_VEND_ID ("1915"), with isSpanNrf52840() as the one rule every platform's detection applies. It takes no PID on purpose: 0x5210 is provisional and unallocated under Nordic's VID, and a PID match would need a host release whenever it changes. - SPAN_VERSION.SPAN_NRF52840, supported, and isMspBslSupported() so a caller can tell a Span reset and programmed through a BSL from one that is not. Appended, so the existing ordinals stand. API_00012 pins the rule to the product strings Windows reported for the bench devices on 2026-09-24, including the NeuroLynQ-mode Verisense on the same VID, which is a node and must not match. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 2214648 commit ef37c0a

2 files changed

Lines changed: 111 additions & 2 deletions

File tree

‎ShimmerDriver/src/main/java/com/shimmerresearch/driverUtilities/HwDriverShimmerDeviceDetails.java‎

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,17 @@ public enum SPAN_VERSION{
5757
UNKNOWN,
5858
SPAN_SR1_3_1, // 115200 baud
5959
SPAN_SR1_3_0, // 230400 baud
60-
VIRTUAL;
60+
VIRTUAL,
61+
/** nRF52840 with native USB (verisense-firmware SR9_SPAN_NRF52840): one CDC port, no FTDI bridge and no BSL */
62+
SPAN_NRF52840;
6163

6264
public boolean isSupported(){
63-
return this==SPAN_VERSION.SPAN_SR1_3_1;
65+
return this==SPAN_VERSION.SPAN_SR1_3_1 || this==SPAN_VERSION.SPAN_NRF52840;
66+
}
67+
68+
/** Whether the Span is an MSP430 that is reset and programmed through the BSL on its FTDI's first port */
69+
public boolean isMspBslSupported(){
70+
return this==SPAN_VERSION.SPAN_SR1_3_0 || this==SPAN_VERSION.SPAN_SR1_3_1;
6471
}
6572
}
6673

@@ -107,6 +114,15 @@ public static final class SH_SEARCH {
107114
"SHIMMER SPAN SR1-3.1",
108115
};
109116

117+
/** USB product string of the nRF52840 Span (verisense-firmware
118+
* SR9_SPAN_NRF52840/pca10056/blank/config/app_config.h). It is matched with
119+
* {@link SERIAL_PORT#NORDIC_VEND_ID} and any PID: its PID, 0x5210, is
120+
* provisional and unallocated under Nordic's VID, and matching on it would need a
121+
* host release whenever it changes. See {@link HwDriverShimmerDeviceDetails#isSpanNrf52840}. */
122+
public static final String[] SPAN_NRF52840 = new String[] {
123+
"NeuroLynQ Span",
124+
};
125+
110126
public static final String[] DISK_DRIVE = new String[] {
111127
"Shimmer",
112128
"Generic" // Some docks went out unprogrammed?
@@ -195,6 +211,9 @@ public static final class SERIAL_PORT {
195211
public static final String FTDI_FT2232H_PROD_ID = "6010";
196212
public static final String FTDI_FT4232H_PROD_ID = "6011";
197213

214+
/** Nordic Semiconductor: the vendor ID of the Verisense and of the nRF52840 Span */
215+
public static final String NORDIC_VEND_ID = "1915";
216+
198217
public static final String VIRTUAL_PORT = "COM0COM";
199218

200219
public static final String[] SHIMMER_3R = new String[] {
@@ -321,6 +340,18 @@ else if(this.deviceType == DEVICE_TYPE.BASE6) {
321340
}
322341
}
323342

343+
/** Whether a USB device is an nRF52840 Span: Nordic's vendor ID with the Span's
344+
* product string, whatever its product ID. Every platform's detection calls this so
345+
* that they all apply the same rule.
346+
* @param usbVendorId the vendor ID as four hex digits, e.g. "1915"
347+
* @param usbProductString the USB product string (iProduct)
348+
*/
349+
public static boolean isSpanNrf52840(String usbVendorId, String usbProductString) {
350+
return SH_SEARCH.SERIAL_PORT.NORDIC_VEND_ID.equalsIgnoreCase(usbVendorId)
351+
&& usbProductString!=null
352+
&& UtilShimmer.stringContainsItemFromListUpperCaseCheck(usbProductString, SH_SEARCH.SPAN_NRF52840);
353+
}
354+
324355
public static DEVICE_TYPE getDeviceTypeFromLabel(String label){
325356
for (DEVICE_TYPE deviceType:DEVICE_TYPE.values()) {
326357
if(deviceType.getLabel().equals(label)){
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
package com.shimmerresearch.driverUtilities;
2+
3+
import static org.junit.Assert.assertFalse;
4+
import static org.junit.Assert.assertTrue;
5+
6+
import org.junit.Test;
7+
8+
import com.shimmerresearch.driverUtilities.HwDriverShimmerDeviceDetails.SPAN_VERSION;
9+
10+
/**
11+
* How the host recognises the nRF52840 Span, and what it assumes about one once found
12+
* (DEV-1047).
13+
* <p>
14+
* The Span is matched on Nordic's vendor ID and its USB product string, not on its
15+
* PID: 0x5210 is provisional and unallocated, and a PID match would need a host release
16+
* whenever it changes. The strings below are the ones Windows reported for the bench
17+
* devices on 2026-09-24.
18+
*/
19+
public class API_00012_SpanNrf52840IdentityTest {
20+
21+
/** iProduct of the nRF52840 Span, verisense-firmware SR9_SPAN_NRF52840 */
22+
private static final String SPAN_NRF52840_PRODUCT = "NeuroLynQ Span";
23+
/** A Verisense in NeuroLynQ mode, on the same VID. It is a node, not a Span. */
24+
private static final String VERISENSE_NEUROLYNQ_PRODUCT = "Verisense-NeuroLynQ-01-2511210195BC";
25+
private static final String VERISENSE_PRODUCT = "Verisense-01-2511210195BC";
26+
private static final String SR9_SPAN_PRODUCT = "SHIMMER SPAN SR1-3.1";
27+
28+
@Test
29+
public void matchesNordicVendorAndSpanProductString() {
30+
assertTrue(HwDriverShimmerDeviceDetails.isSpanNrf52840("1915", SPAN_NRF52840_PRODUCT));
31+
}
32+
33+
@Test
34+
public void productStringMatchIgnoresCase() {
35+
assertTrue(HwDriverShimmerDeviceDetails.isSpanNrf52840("1915", SPAN_NRF52840_PRODUCT.toUpperCase()));
36+
}
37+
38+
@Test
39+
public void rejectsTheProductStringUnderAnotherVendor() {
40+
assertFalse(HwDriverShimmerDeviceDetails.isSpanNrf52840(
41+
HwDriverShimmerDeviceDetails.SH_SEARCH.SERIAL_PORT.FTDI_VEND_ID, SPAN_NRF52840_PRODUCT));
42+
}
43+
44+
@Test
45+
public void rejectsOtherNordicDevices() {
46+
assertFalse(HwDriverShimmerDeviceDetails.isSpanNrf52840("1915", VERISENSE_NEUROLYNQ_PRODUCT));
47+
assertFalse(HwDriverShimmerDeviceDetails.isSpanNrf52840("1915", VERISENSE_PRODUCT));
48+
}
49+
50+
@Test
51+
public void rejectsTheSr9() {
52+
assertFalse(HwDriverShimmerDeviceDetails.isSpanNrf52840(
53+
HwDriverShimmerDeviceDetails.SH_SEARCH.SERIAL_PORT.FTDI_VEND_ID, SR9_SPAN_PRODUCT));
54+
}
55+
56+
@Test
57+
public void rejectsMissingValues() {
58+
assertFalse(HwDriverShimmerDeviceDetails.isSpanNrf52840(null, SPAN_NRF52840_PRODUCT));
59+
assertFalse(HwDriverShimmerDeviceDetails.isSpanNrf52840("1915", null));
60+
assertFalse(HwDriverShimmerDeviceDetails.isSpanNrf52840("", ""));
61+
}
62+
63+
@Test
64+
public void nrf52840SpanIsSupportedButHasNoBsl() {
65+
assertTrue(SPAN_VERSION.SPAN_NRF52840.isSupported());
66+
assertFalse(SPAN_VERSION.SPAN_NRF52840.isMspBslSupported());
67+
}
68+
69+
@Test
70+
public void msp430SpansKeepTheirBsl() {
71+
assertTrue(SPAN_VERSION.SPAN_SR1_3_1.isSupported());
72+
assertTrue(SPAN_VERSION.SPAN_SR1_3_1.isMspBslSupported());
73+
assertFalse(SPAN_VERSION.SPAN_SR1_3_0.isSupported());
74+
assertTrue(SPAN_VERSION.SPAN_SR1_3_0.isMspBslSupported());
75+
assertFalse(SPAN_VERSION.VIRTUAL.isMspBslSupported());
76+
assertFalse(SPAN_VERSION.UNKNOWN.isMspBslSupported());
77+
}
78+
}

0 commit comments

Comments
 (0)