31.4.10 Debugging
There are multiple ways of debugging CRYPTO sequences. The most straight-forward way is to write individual instructions to INSTR in
CRYPTO_CMD. An instruction can be written, and data can be read out and examined before running another instruction.
Running individual instructions to debug a program falls short when working with repeated sequences. In these cases, a sequence is
run multiple times over a set of data. This cannot be directly replicated with individual instructions
To debug a sequence, set HALT in CRYPTO_SEQCTRL. When set, CRYPTO requires software or the debugger to step it through each
instruction in the sequence. To step through the sequence, set SEQSTEP in CRYPTO_CMD. This will execute the current instruction,
and make CRYPTO ready to execute the next one.
When stepping through a sequence, the current instruction index can be read from SEQIP in CRYPTO_CSTATUS. SEQSKIP, also in
CRYPTO_CSTATUS tells whether the next instruction will be executed or not, based on previous conditionals in the program. SEQ-
PART in CRYPTO_CSTATUS shows whether CRYPTO is currently in part A or B of a sequence. Even with NOBUSYSTALL in CRYP-
TO_CTRL cleared, read and write accesses to CRYPTO will be allowed when CRYPTO is waiting to be stepped. This is to allow data
registers to be inspected during debugging.
Note:
The data registers in CRYPTO (those marked read-actionable) require shifting of data in order to return the result. For this rea-
son, reading these registers will have no effect and will return unknown values during normal debugger read accesses (see
bugger Reads of Actionable Registers
).
31.4.11 Example: Cipher Block Chaining (CBC)
In the following the setup and operation of CBC is explained and illustrated. The example can easily be adjusted to perform other cipher
block modes.
Reference Manual
CRYPTO - Crypto Accelerator
silabs.com
| Building a more connected world.
Rev. 1.1 | 1041