| Previous | Next |
| TPM_20_E_AUTH_CONTEXT | TPM_20_E_NV_SIZE |
TPM_20_E_NV_RANGE
TPM_20_E_NV_RANGE applies to an operation on an existing TPM 2.0 NV index. The requested offset and byte count do not fit within the index's declared dataSize. It is an I/O-range error for a defined index, not a failure to allocate a new one.
Why it happens
- A caller passes an offset plus read or write length that exceeds the public size of the NV index.
- Chunking code uses a buffer length that is valid for one index but not for a smaller index or for the final chunk.
- The application has cached obsolete metadata after the NV index was redefined with a different public area.
How to distinguish it
| Code | Meaning |
|---|---|
TPM_20_E_NV_RANGE | A request is outside the byte range of an existing index. |
TPM_20_E_NV_SIZE | The requested size is invalid while defining an NV index. |
TPM_20_E_NV_SPACE | The TPM lacks enough total nonvolatile storage for a new allocation. |
What to inspect
- Read the current public area, including
dataSize, before calculating offsets.tpm2_nvreadpublicreports the size, name algorithm, authorization policy, and NV attributes. - Log the exact offset and byte count sent to
TPM2_NV_Read,TPM2_NV_Write, or another NV command. Validate the addition before serializing the command. - Split a large transfer into requests that fit both the index range and the TPM's reported maximum NV command buffer size.
References: TCG TPM 2.0 Library Part 3: Commands and tpm2_nvreadpublic documentation.
Looking for a different code? Search another status or error code.
