Skip to content

Commit 0832388

Browse files
authored
Remove ATECC crypto chip placeholder code (#5461)
1 parent 601d912 commit 0832388

File tree

7 files changed

+2
-70
lines changed

7 files changed

+2
-70
lines changed

platformio.ini

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ framework = arduino
109109
lib_deps =
110110
${env.lib_deps}
111111
end2endzone/[email protected]
112-
https://github.com/meshtastic/SparkFun_ATECCX08a_Arduino_Library.git#5cf62b36c6f30bc72a07bdb2c11fc9a22d1e31da
113112
build_flags = ${env.build_flags} -Os
114113
build_src_filter = ${env.build_src_filter} -<platform/portduino/>
115114

@@ -160,4 +159,4 @@ lib_deps =
160159
https://github.com/KodinLanewave/[email protected]
161160
162161
163-
https://github.com/meshtastic/DFRobot_LarkWeatherStation#4de3a9cadef0f6a5220a8a906cf9775b02b0040d
162+
https://github.com/meshtastic/DFRobot_LarkWeatherStation#4de3a9cadef0f6a5220a8a906cf9775b02b0040d

src/configuration.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
171171
// -----------------------------------------------------------------------------
172172
// Security
173173
// -----------------------------------------------------------------------------
174-
#define ATECC608B_ADDR 0x35
175174

176175
// -----------------------------------------------------------------------------
177176
// IO Expander
@@ -362,4 +361,4 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
362361
#endif
363362

364363
#include "DebugConfiguration.h"
365-
#include "RF95Configuration.h"
364+
#include "RF95Configuration.h"

src/detect/ScanI2C.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ class ScanI2C
1212
SCREEN_SH1106,
1313
SCREEN_UNKNOWN, // has the same address as the two above but does not respond to the same commands
1414
SCREEN_ST7567,
15-
ATECC608B,
1615
RTC_RV3028,
1716
RTC_PCF8563,
1817
CARDKB,

src/detect/ScanI2CTwoWire.cpp

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#include "linux/LinuxHardwareI2C.h"
88
#endif
99
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL)
10-
#include "main.h" // atecc
1110
#include "meshUtils.h" // vformat
1211
#endif
1312

@@ -84,40 +83,6 @@ ScanI2C::DeviceType ScanI2CTwoWire::probeOLED(ScanI2C::DeviceAddress addr) const
8483

8584
return o_probe;
8685
}
87-
void ScanI2CTwoWire::printATECCInfo() const
88-
{
89-
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL)
90-
atecc.readConfigZone(false);
91-
92-
std::string atecc_numbers = "ATECC608B Serial Number: ";
93-
for (int i = 0; i < 9; i++) {
94-
atecc_numbers += vformat("%02x", atecc.serialNumber[i]);
95-
}
96-
97-
atecc_numbers += ", Rev Number: ";
98-
for (int i = 0; i < 4; i++) {
99-
atecc_numbers += vformat("%02x", atecc.revisionNumber[i]);
100-
}
101-
LOG_DEBUG(atecc_numbers.c_str());
102-
103-
LOG_DEBUG("ATECC608B Config %s, Data %s, Slot 0 %s", atecc.configLockStatus ? "Locked" : "Unlocked",
104-
atecc.dataOTPLockStatus ? "Locked" : "Unlocked", atecc.slot0LockStatus ? "Locked" : "Unlocked");
105-
106-
std::string atecc_publickey = "";
107-
if (atecc.configLockStatus && atecc.dataOTPLockStatus && atecc.slot0LockStatus) {
108-
if (atecc.generatePublicKey() == false) {
109-
atecc_publickey += "ATECC608B Error generating public key";
110-
} else {
111-
atecc_publickey += "ATECC608B Public Key: ";
112-
for (int i = 0; i < 64; i++) {
113-
atecc_publickey += vformat("%02x", atecc.publicKey64Bytes[i]);
114-
}
115-
}
116-
LOG_DEBUG(atecc_publickey.c_str());
117-
}
118-
#endif
119-
}
120-
12186
uint16_t ScanI2CTwoWire::getRegisterValue(const ScanI2CTwoWire::RegisterLocation &registerLocation,
12287
ScanI2CTwoWire::ResponseWidth responseWidth) const
12388
{
@@ -203,23 +168,6 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize)
203168
type = probeOLED(addr);
204169
break;
205170

206-
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL)
207-
case ATECC608B_ADDR:
208-
#ifdef RP2040_SLOW_CLOCK
209-
if (atecc.begin(addr.address, Wire, Serial2) == true)
210-
#else
211-
if (atecc.begin(addr.address) == true)
212-
#endif
213-
214-
{
215-
LOG_INFO("ATECC608B initialized");
216-
} else {
217-
LOG_WARN("ATECC608B initialization failed");
218-
}
219-
printATECCInfo();
220-
break;
221-
#endif
222-
223171
#ifdef RV3028_RTC
224172
case RV3028_RTC:
225173
// foundDevices[addr] = RTC_RV3028;

src/detect/ScanI2CTwoWire.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ class ScanI2CTwoWire : public ScanI2C
5353

5454
concurrency::Lock lock;
5555

56-
void printATECCInfo() const;
57-
5856
uint16_t getRegisterValue(const RegisterLocation &, ResponseWidth) const;
5957

6058
DeviceType probeOLED(ScanI2C::DeviceAddress) const;

src/main.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,6 @@ ScanI2C::DeviceAddress accelerometer_found = ScanI2C::ADDRESS_NONE;
150150
// The I2C address of the RGB LED (if found)
151151
ScanI2C::FoundDevice rgb_found = ScanI2C::FoundDevice(ScanI2C::DeviceType::NONE, ScanI2C::ADDRESS_NONE);
152152

153-
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL)
154-
ATECCX08A atecc;
155-
#endif
156-
157153
#ifdef T_WATCH_S3
158154
Adafruit_DRV2605 drv;
159155
#endif

src/main.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010
#include "mesh/generated/meshtastic/telemetry.pb.h"
1111
#include <SPI.h>
1212
#include <map>
13-
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL)
14-
#include <SparkFun_ATECCX08a_Arduino_Library.h>
15-
#endif
1613
#if defined(ARCH_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32S2)
1714
#include "nimble/NimbleBluetooth.h"
1815
extern NimbleBluetooth *nimbleBluetooth;
@@ -42,10 +39,6 @@ extern bool pmu_found;
4239
extern bool isCharging;
4340
extern bool isUSBPowered;
4441

45-
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL)
46-
extern ATECCX08A atecc;
47-
#endif
48-
4942
#ifdef T_WATCH_S3
5043
#include <Adafruit_DRV2605.h>
5144
extern Adafruit_DRV2605 drv;

0 commit comments

Comments
 (0)