Skip to content

Commit 37b49da

Browse files
authored
Merge pull request #8 from 1a2m3/1a2m3-patch-20211201
Update 20211202
2 parents 0d0e967 + c4852d1 commit 37b49da

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

firmware/SpdReaderWriter.ino

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include <EEPROM.h>
1717
#include "SpdReaderWriterSettings.h" // Settings
1818

19-
#define VERSION 20211201 // Version number (YYYYMMDD)
19+
#define VERSION 20211202 // Version number (YYYYMMDD)
2020

2121
// RSWP RAM support bitmasks
2222
#define DDR5 (1 << 5) // Offline mode control
@@ -675,9 +675,16 @@ bool getRswp(uint8_t block) {
675675
byte commands[] = { RPS0, RPS1, RPS2, RPS3 };
676676
byte cmd = (block > 0 || block <= 3) ? commands[block] : commands[0];
677677

678-
setHighVoltage(OFF);
678+
// Jedec EE1002(A), TSE2002av compliance
679+
if (block == 0 && !ddr4Detect()) {
680+
setHighVoltage(ON);
681+
}
682+
683+
bool status = probeDeviceTypeId(cmd);
679684

680-
return probeDeviceTypeId(cmd); // true = unprotected; false = protected or rswp not supported
685+
resetPins();
686+
687+
return status; // true = unprotected; false = protected or rswp not supported
681688
}
682689

683690
// Clears reversible software write protection
@@ -1037,18 +1044,18 @@ bool probeDeviceTypeId(uint8_t deviceSelectCode) {
10371044
return Wire.requestFrom(cmd, (uint8_t)1) > 0; // true when ACK is received after control byte
10381045
}
10391046

1040-
// DDR4 detection test
1047+
// DDR4 detection test (address)
10411048
bool ddr4Detect(uint8_t address) {
1049+
return probeBusAddress(address) && ddr4Detect();
1050+
}
10421051

1043-
if (!probeBusAddress(address) || !scanBus()) {
1044-
return false;
1045-
}
1046-
1052+
// DDR4 detection test (generic)
1053+
bool ddr4Detect() {
10471054
return ((setPageAddress(0) ^ getPageAddress(true)) !=
10481055
(setPageAddress(1) ^ getPageAddress(true)));
10491056
}
10501057

1051-
// DDR5 detetion
1058+
// DDR5 detection test
10521059
bool ddr5Detect(uint8_t address) {
10531060

10541061
if (!probeBusAddress(address) || !scanBus()) {

src/SpdReaderWriterDll/Settings.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ public class Settings {
77
/// <summary>
88
/// DLL version
99
/// </summary>
10-
public const int DLLVERSION = 20211201;
10+
public const int DLLVERSION = 20211202;
1111

1212
/// <summary>
1313
/// Minimum device's firmware version required
1414
/// </summary>
15-
public static int MINVERSION = 20211201;
15+
public static int MINVERSION = 20211202;
1616
}
1717
}

0 commit comments

Comments
 (0)