Other Parts Discussed in Thread: SYSBIOS
Tool/software:
Hello,
I want to add keys to key store memory from external memory. I looked up the reference manual document and I decided to use "12.7.4.2.1 Load Keys From External Memory" part. However, these registers are crypto registers so I can not reach directly. As I understand from the part "12.5.6 Key Area Registers", I can change these registers only via DMA. In this situation I got an error and probably this error about not configuring DMA appropriately. So, what is the way configuring DMA properly? You can see the pseudocode in the below.
12.7.4.2.1 Load Keys From External Memory
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
I am looking forward to your respond.
Thanks.