kopia lustrzana https://github.com/meshtastic/firmware
Remove ATECC crypto chip placeholder code (#5461)
rodzic
601d912c6f
commit
0832388482
|
@ -109,7 +109,6 @@ framework = arduino
|
||||||
lib_deps =
|
lib_deps =
|
||||||
${env.lib_deps}
|
${env.lib_deps}
|
||||||
end2endzone/NonBlockingRTTTL@1.3.0
|
end2endzone/NonBlockingRTTTL@1.3.0
|
||||||
https://github.com/meshtastic/SparkFun_ATECCX08a_Arduino_Library.git#5cf62b36c6f30bc72a07bdb2c11fc9a22d1e31da
|
|
||||||
build_flags = ${env.build_flags} -Os
|
build_flags = ${env.build_flags} -Os
|
||||||
build_src_filter = ${env.build_src_filter} -<platform/portduino/>
|
build_src_filter = ${env.build_src_filter} -<platform/portduino/>
|
||||||
|
|
||||||
|
@ -160,4 +159,4 @@ lib_deps =
|
||||||
https://github.com/KodinLanewave/INA3221@1.0.1
|
https://github.com/KodinLanewave/INA3221@1.0.1
|
||||||
mprograms/QMC5883LCompass@1.2.3
|
mprograms/QMC5883LCompass@1.2.3
|
||||||
dfrobot/DFRobot_RTU@1.0.3
|
dfrobot/DFRobot_RTU@1.0.3
|
||||||
https://github.com/meshtastic/DFRobot_LarkWeatherStation#4de3a9cadef0f6a5220a8a906cf9775b02b0040d
|
https://github.com/meshtastic/DFRobot_LarkWeatherStation#4de3a9cadef0f6a5220a8a906cf9775b02b0040d
|
|
@ -171,7 +171,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// Security
|
// Security
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
#define ATECC608B_ADDR 0x35
|
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// IO Expander
|
// IO Expander
|
||||||
|
@ -362,4 +361,4 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "DebugConfiguration.h"
|
#include "DebugConfiguration.h"
|
||||||
#include "RF95Configuration.h"
|
#include "RF95Configuration.h"
|
|
@ -12,7 +12,6 @@ class ScanI2C
|
||||||
SCREEN_SH1106,
|
SCREEN_SH1106,
|
||||||
SCREEN_UNKNOWN, // has the same address as the two above but does not respond to the same commands
|
SCREEN_UNKNOWN, // has the same address as the two above but does not respond to the same commands
|
||||||
SCREEN_ST7567,
|
SCREEN_ST7567,
|
||||||
ATECC608B,
|
|
||||||
RTC_RV3028,
|
RTC_RV3028,
|
||||||
RTC_PCF8563,
|
RTC_PCF8563,
|
||||||
CARDKB,
|
CARDKB,
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
#include "linux/LinuxHardwareI2C.h"
|
#include "linux/LinuxHardwareI2C.h"
|
||||||
#endif
|
#endif
|
||||||
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL)
|
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL)
|
||||||
#include "main.h" // atecc
|
|
||||||
#include "meshUtils.h" // vformat
|
#include "meshUtils.h" // vformat
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -84,40 +83,6 @@ ScanI2C::DeviceType ScanI2CTwoWire::probeOLED(ScanI2C::DeviceAddress addr) const
|
||||||
|
|
||||||
return o_probe;
|
return o_probe;
|
||||||
}
|
}
|
||||||
void ScanI2CTwoWire::printATECCInfo() const
|
|
||||||
{
|
|
||||||
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL)
|
|
||||||
atecc.readConfigZone(false);
|
|
||||||
|
|
||||||
std::string atecc_numbers = "ATECC608B Serial Number: ";
|
|
||||||
for (int i = 0; i < 9; i++) {
|
|
||||||
atecc_numbers += vformat("%02x", atecc.serialNumber[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
atecc_numbers += ", Rev Number: ";
|
|
||||||
for (int i = 0; i < 4; i++) {
|
|
||||||
atecc_numbers += vformat("%02x", atecc.revisionNumber[i]);
|
|
||||||
}
|
|
||||||
LOG_DEBUG(atecc_numbers.c_str());
|
|
||||||
|
|
||||||
LOG_DEBUG("ATECC608B Config %s, Data %s, Slot 0 %s", atecc.configLockStatus ? "Locked" : "Unlocked",
|
|
||||||
atecc.dataOTPLockStatus ? "Locked" : "Unlocked", atecc.slot0LockStatus ? "Locked" : "Unlocked");
|
|
||||||
|
|
||||||
std::string atecc_publickey = "";
|
|
||||||
if (atecc.configLockStatus && atecc.dataOTPLockStatus && atecc.slot0LockStatus) {
|
|
||||||
if (atecc.generatePublicKey() == false) {
|
|
||||||
atecc_publickey += "ATECC608B Error generating public key";
|
|
||||||
} else {
|
|
||||||
atecc_publickey += "ATECC608B Public Key: ";
|
|
||||||
for (int i = 0; i < 64; i++) {
|
|
||||||
atecc_publickey += vformat("%02x", atecc.publicKey64Bytes[i]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
LOG_DEBUG(atecc_publickey.c_str());
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
uint16_t ScanI2CTwoWire::getRegisterValue(const ScanI2CTwoWire::RegisterLocation ®isterLocation,
|
uint16_t ScanI2CTwoWire::getRegisterValue(const ScanI2CTwoWire::RegisterLocation ®isterLocation,
|
||||||
ScanI2CTwoWire::ResponseWidth responseWidth) const
|
ScanI2CTwoWire::ResponseWidth responseWidth) const
|
||||||
{
|
{
|
||||||
|
@ -203,23 +168,6 @@ void ScanI2CTwoWire::scanPort(I2CPort port, uint8_t *address, uint8_t asize)
|
||||||
type = probeOLED(addr);
|
type = probeOLED(addr);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL)
|
|
||||||
case ATECC608B_ADDR:
|
|
||||||
#ifdef RP2040_SLOW_CLOCK
|
|
||||||
if (atecc.begin(addr.address, Wire, Serial2) == true)
|
|
||||||
#else
|
|
||||||
if (atecc.begin(addr.address) == true)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
{
|
|
||||||
LOG_INFO("ATECC608B initialized");
|
|
||||||
} else {
|
|
||||||
LOG_WARN("ATECC608B initialization failed");
|
|
||||||
}
|
|
||||||
printATECCInfo();
|
|
||||||
break;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef RV3028_RTC
|
#ifdef RV3028_RTC
|
||||||
case RV3028_RTC:
|
case RV3028_RTC:
|
||||||
// foundDevices[addr] = RTC_RV3028;
|
// foundDevices[addr] = RTC_RV3028;
|
||||||
|
|
|
@ -53,8 +53,6 @@ class ScanI2CTwoWire : public ScanI2C
|
||||||
|
|
||||||
concurrency::Lock lock;
|
concurrency::Lock lock;
|
||||||
|
|
||||||
void printATECCInfo() const;
|
|
||||||
|
|
||||||
uint16_t getRegisterValue(const RegisterLocation &, ResponseWidth) const;
|
uint16_t getRegisterValue(const RegisterLocation &, ResponseWidth) const;
|
||||||
|
|
||||||
DeviceType probeOLED(ScanI2C::DeviceAddress) const;
|
DeviceType probeOLED(ScanI2C::DeviceAddress) const;
|
||||||
|
|
|
@ -150,10 +150,6 @@ ScanI2C::DeviceAddress accelerometer_found = ScanI2C::ADDRESS_NONE;
|
||||||
// The I2C address of the RGB LED (if found)
|
// The I2C address of the RGB LED (if found)
|
||||||
ScanI2C::FoundDevice rgb_found = ScanI2C::FoundDevice(ScanI2C::DeviceType::NONE, ScanI2C::ADDRESS_NONE);
|
ScanI2C::FoundDevice rgb_found = ScanI2C::FoundDevice(ScanI2C::DeviceType::NONE, ScanI2C::ADDRESS_NONE);
|
||||||
|
|
||||||
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL)
|
|
||||||
ATECCX08A atecc;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef T_WATCH_S3
|
#ifdef T_WATCH_S3
|
||||||
Adafruit_DRV2605 drv;
|
Adafruit_DRV2605 drv;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -10,9 +10,6 @@
|
||||||
#include "mesh/generated/meshtastic/telemetry.pb.h"
|
#include "mesh/generated/meshtastic/telemetry.pb.h"
|
||||||
#include <SPI.h>
|
#include <SPI.h>
|
||||||
#include <map>
|
#include <map>
|
||||||
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL)
|
|
||||||
#include <SparkFun_ATECCX08a_Arduino_Library.h>
|
|
||||||
#endif
|
|
||||||
#if defined(ARCH_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32S2)
|
#if defined(ARCH_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32S2)
|
||||||
#include "nimble/NimbleBluetooth.h"
|
#include "nimble/NimbleBluetooth.h"
|
||||||
extern NimbleBluetooth *nimbleBluetooth;
|
extern NimbleBluetooth *nimbleBluetooth;
|
||||||
|
@ -42,10 +39,6 @@ extern bool pmu_found;
|
||||||
extern bool isCharging;
|
extern bool isCharging;
|
||||||
extern bool isUSBPowered;
|
extern bool isUSBPowered;
|
||||||
|
|
||||||
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL)
|
|
||||||
extern ATECCX08A atecc;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef T_WATCH_S3
|
#ifdef T_WATCH_S3
|
||||||
#include <Adafruit_DRV2605.h>
|
#include <Adafruit_DRV2605.h>
|
||||||
extern Adafruit_DRV2605 drv;
|
extern Adafruit_DRV2605 drv;
|
||||||
|
|
Ładowanie…
Reference in New Issue