From 4d4ee9971695644492724afb0a31629415536842 Mon Sep 17 00:00:00 2001 From: Andrew Kozlik Date: Tue, 25 Jun 2024 06:46:48 +0200 Subject: [PATCH] fix(core): Increase Optiga MAX_RETRY_READ_MS to 6 sec. --- core/.changelog.d/+optiga.fixed | 1 + core/embed/trezorhal/optiga/optiga_transport.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 core/.changelog.d/+optiga.fixed diff --git a/core/.changelog.d/+optiga.fixed b/core/.changelog.d/+optiga.fixed new file mode 100644 index 000000000..6bb8d9350 --- /dev/null +++ b/core/.changelog.d/+optiga.fixed @@ -0,0 +1 @@ +Fix Optiga-related RSODs diff --git a/core/embed/trezorhal/optiga/optiga_transport.c b/core/embed/trezorhal/optiga/optiga_transport.c index eafd430b7..7eba26b38 100644 --- a/core/embed/trezorhal/optiga/optiga_transport.c +++ b/core/embed/trezorhal/optiga/optiga_transport.c @@ -66,7 +66,10 @@ static const uint32_t I2C_TIMEOUT_MS = 25; static const int I2C_MAX_RETRY_COUNT = 10; // Maximum time in millisecods to retry reading Optiga's response to a command. -static const int MAX_RETRY_READ_MS = 300; +// If the SEC is high, then the throttling down delay can be as high as +// t_max = 5000 ms. The maximum time to execute a non-RSA operation is 130 ms. +// We round the total up to the nearest second. +static const int MAX_RETRY_READ_MS = 6000; // Maximum number of times to retry reading Optiga's response to a command when // it claims it's not busy executing a command.