You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Modify this according to your environment. Default values
78
-
// are compatible with RPi and our RPi shield.
77
+
// are compatible with RPi and our RPi shield.
79
78
lt_dev_linux_spi_tdevice= {0};
80
-
strcpy(device.gpio_dev, LT_SPI_DEVKIT_GPIO_PATH); // LT_SPI_DEVKIT_GPIO_PATH is defined in CMakeLists.txt. Pass -DLT_SPI_DEVKIT_GPIO_PATH=<path> to cmake if you want to change it.
81
-
strcpy(device.spi_dev, LT_SPI_DEVKIT_SPI_PATH); // LT_SPI_DEVKIT_SPI_PATH is defined in CMakeLists.txt. Pass -DLT_SPI_DEVKIT_SPI_PATH=<path> to cmake if you want to change it.
82
-
device.spi_speed=5000000; // 5 MHz (change if needed).
83
-
device.gpio_cs_num=25; // GPIO 25 as on RPi shield.
79
+
strcpy(device.gpio_dev,
80
+
LT_SPI_DEVKIT_GPIO_PATH); // LT_SPI_DEVKIT_GPIO_PATH is defined in CMakeLists.txt. Pass
81
+
// -DLT_SPI_DEVKIT_GPIO_PATH=<path> to cmake if you want to change it.
82
+
strcpy(device.spi_dev,
83
+
LT_SPI_DEVKIT_SPI_PATH); // LT_SPI_DEVKIT_SPI_PATH is defined in CMakeLists.txt. Pass
84
+
// -DLT_SPI_DEVKIT_SPI_PATH=<path> to cmake if you want to change it.
85
+
device.spi_speed=5000000; // 5 MHz (change if needed).
86
+
device.gpio_cs_num=25; // GPIO 25 as on RPi shield.
84
87
#ifLT_USE_INT_PIN
85
88
device.gpio_int_num=5; // GPIO 5 as on RPi shield.
86
89
#endif
87
90
lt_handle.l2.device=&device;
88
91
89
-
90
92
// Crypto abstraction layer (CAL) context.
91
93
lt_ctx_mbedtls_v4_tcrypto_ctx;
92
94
lt_handle.l3.crypto_ctx=&crypto_ctx;
@@ -113,7 +115,7 @@ int main(void)
113
115
}
114
116
printf("OK\n");
115
117
116
-
if(get_fw_versions(<_handle) !=LT_OK) {
118
+
if(get_fw_versions(<_handle) !=LT_OK) {
117
119
lt_deinit(<_handle);
118
120
mbedtls_psa_crypto_free();
119
121
return-1;
@@ -133,7 +135,6 @@ int main(void)
133
135
}
134
136
printf("\nStarting firmware update...\n");
135
137
136
-
137
138
// The chip must be in Start-up Mode to be able to perform a firmware update.
// Modify this according to your environment. Default values
65
-
// are compatible with RPi and our RPi shield.
64
+
// are compatible with RPi and our RPi shield.
66
65
lt_dev_linux_spi_tdevice= {0};
67
-
strcpy(device.gpio_dev, LT_SPI_DEVKIT_GPIO_PATH); // LT_SPI_DEVKIT_GPIO_PATH is defined in CMakeLists.txt. Pass -DLT_SPI_DEVKIT_GPIO_PATH=<path> to cmake if you want to change it.
68
-
strcpy(device.spi_dev, LT_SPI_DEVKIT_SPI_PATH); // LT_SPI_DEVKIT_SPI_PATH is defined in CMakeLists.txt. Pass -DLT_SPI_DEVKIT_SPI_PATH=<path> to cmake if you want to change it.
69
-
device.spi_speed=5000000; // 5 MHz (change if needed).
70
-
device.gpio_cs_num=25; // GPIO 25 as on RPi shield.
66
+
strcpy(device.gpio_dev,
67
+
LT_SPI_DEVKIT_GPIO_PATH); // LT_SPI_DEVKIT_GPIO_PATH is defined in CMakeLists.txt. Pass
68
+
// -DLT_SPI_DEVKIT_GPIO_PATH=<path> to cmake if you want to change it.
69
+
strcpy(device.spi_dev,
70
+
LT_SPI_DEVKIT_SPI_PATH); // LT_SPI_DEVKIT_SPI_PATH is defined in CMakeLists.txt. Pass
71
+
// -DLT_SPI_DEVKIT_SPI_PATH=<path> to cmake if you want to change it.
72
+
device.spi_speed=5000000; // 5 MHz (change if needed).
73
+
device.gpio_cs_num=25; // GPIO 25 as on RPi shield.
71
74
#ifLT_USE_INT_PIN
72
75
device.gpio_int_num=5; // GPIO 5 as on RPi shield.
73
76
#endif
74
77
lt_handle.l2.device=&device;
75
78
76
-
77
79
// Crypto abstraction layer (CAL) context.
78
80
lt_ctx_mbedtls_v4_tcrypto_ctx;
79
81
lt_handle.l3.crypto_ctx=&crypto_ctx;
@@ -101,11 +103,14 @@ int main(void)
101
103
102
104
printf("Starting Secure Session with key slot %d...", (int)TR01_PAIRING_KEY_SLOT_INDEX_0);
103
105
// Keys are chosen based on the CMake option LT_SH0_KEYS.
// Modify this according to your environment. Default values
51
-
// are compatible with RPi and our RPi shield.
50
+
// are compatible with RPi and our RPi shield.
52
51
lt_dev_linux_spi_tdevice= {0};
53
-
strcpy(device.gpio_dev, LT_SPI_DEVKIT_GPIO_PATH); // LT_SPI_DEVKIT_GPIO_PATH is defined in CMakeLists.txt. Pass -DLT_SPI_DEVKIT_GPIO_PATH=<path> to cmake if you want to change it.
54
-
strcpy(device.spi_dev, LT_SPI_DEVKIT_SPI_PATH); // LT_SPI_DEVKIT_SPI_PATH is defined in CMakeLists.txt. Pass -DLT_SPI_DEVKIT_SPI_PATH=<path> to cmake if you want to change it.
55
-
device.spi_speed=5000000; // 5 MHz (change if needed).
56
-
device.gpio_cs_num=25; // GPIO 25 as on RPi shield.
52
+
strcpy(device.gpio_dev,
53
+
LT_SPI_DEVKIT_GPIO_PATH); // LT_SPI_DEVKIT_GPIO_PATH is defined in CMakeLists.txt. Pass
54
+
// -DLT_SPI_DEVKIT_GPIO_PATH=<path> to cmake if you want to change it.
55
+
strcpy(device.spi_dev,
56
+
LT_SPI_DEVKIT_SPI_PATH); // LT_SPI_DEVKIT_SPI_PATH is defined in CMakeLists.txt. Pass
57
+
// -DLT_SPI_DEVKIT_SPI_PATH=<path> to cmake if you want to change it.
58
+
device.spi_speed=5000000; // 5 MHz (change if needed).
59
+
device.gpio_cs_num=25; // GPIO 25 as on RPi shield.
57
60
#ifLT_USE_INT_PIN
58
61
device.gpio_int_num=5; // GPIO 5 as on RPi shield.
0 commit comments