SWCU185G January 2018 – June 2024 CC1312PSIP , CC1312R , CC1352P , CC1352R , CC2642R , CC2642R-Q1 , CC2652P , CC2652PSIP , CC2652R , CC2652RB , CC2652RSIP , CC2662R-Q1
The following software example in pseudocode describes the actions that are typically executed by the host software to load one or more keys into the key-store module.
// configure master control module
write ALGSEL 0x0000_0001 // enable DMA path to the key store module
write IRQCLR 0x0000_0001 // clear any outstanding events
// configure key store module (area, size)
write KEYSIZE 0x0000_0001 // 128-bit key size
write KEYWRITEAREA 0x0000_0001 // enable keys to write (e.g. Key 0)
// configure DMAC
write DMACH0CTL 0x0000_00001 // enable DMA channel 0
write DMACH0EXTADDR <ext_memory_address> // base address of the key in ext. memory
write DMACH0LEN <length> // total key length in bytes (e.g. 16 for 1 x 128-bit
// key)
// wait for completion
wait IRQSTAT[0]==’1’ // wait for operation completed
check IRQSTAT[31:30] == ‘00’ // check for absence of errors in DMA and key store
write IRQCLR 0x0000_0001 // acknowledge the interrupt
write ALGSEL 0x0000_0000 // disable master control/DMA clock
// check status
check KEYWRITTENAREA 0x0000_00001 // check that Key 0 was written
// end of algorithm