We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
According to this spec I found, when the TPM is started it can be initially in ready or idle state.
If it happens to stay in idle state, tcti-spi-helper will fail here:
tpm2-tss/src/tss2-tcti/tcti-spi-helper.c
Lines 739 to 747 in 86949f7
This makes tcti-spi-helper unusable in the project I am working on now.
A quick and dirty fix is to just ask the TPM chip to transition to ready state and try again:
diff --git a/src/tss2-tcti/tcti-spi-helper.c b/src/tss2-tcti/tcti-spi-helper.c index 515a5363..f2d69c0f 100644 --- a/src/tss2-tcti/tcti-spi-helper.c +++ b/src/tss2-tcti/tcti-spi-helper.c @@ -740,6 +740,10 @@ TSS2_RC Tss2_Tcti_Spi_Helper_Init (TSS2_TCTI_CONTEXT* tcti_context, size_t* size LOG_DEBUG("Waiting for TPM to become ready..."); uint32_t expected_status_bits = TCTI_SPI_HELPER_TPM_STS_COMMAND_READY; rc = spi_tpm_helper_wait_for_status(ctx, expected_status_bits, expected_status_bits, 200); + if (rc != TSS2_RC_SUCCESS) { + spi_tpm_helper_write_sts_reg(ctx, TCTI_SPI_HELPER_TPM_STS_COMMAND_READY); + rc = spi_tpm_helper_wait_for_status(ctx, expected_status_bits, expected_status_bits, 200); + } if (rc != TSS2_RC_SUCCESS) { LOG_ERROR("Failed waiting for TPM to become ready"); return rc;
The text was updated successfully, but these errors were encountered:
wxleong
Successfully merging a pull request may close this issue.
According to this spec I found, when the TPM is started it can be initially in ready or idle state.
If it happens to stay in idle state, tcti-spi-helper will fail here:
tpm2-tss/src/tss2-tcti/tcti-spi-helper.c
Lines 739 to 747 in 86949f7
This makes tcti-spi-helper unusable in the project I am working on now.
A quick and dirty fix is to just ask the TPM chip to transition to ready state and try again:
The text was updated successfully, but these errors were encountered: