diff --git a/tcl/target/max32520.cfg b/tcl/target/max32520.cfg index 8324da6724e22789d13d64f527775caf4fb0da29..710c3d4aef90cff8df9d3fe9bee8086ffaceb42f 100644 --- a/tcl/target/max32520.cfg +++ b/tcl/target/max32520.cfg @@ -17,3 +17,13 @@ set FLASH_CLK 40 set FLASH_OPTIONS 0x23 source [find target/max32xxx.cfg] + +proc max32520_aes256_reset_init {} { + # Enable encryption and 256 bit key + mww 0x40000000 0x320002 +} + +# Create custom reset sequence to set the AES keysize +if { [expr $FLASH_OPTIONS & 0x40] } { + $_CHIPNAME.cpu configure -event reset-init { max32520_aes256_reset_init } +}