The program will download the .sb2 file to sdcard through BlueTooth.Then the booloader will read the AES key at the address of 0xB000,and decrypt the file from sdcard,writing the program to flash 0xA000 eventually.
I wonder where to strore AES key before wrtiing to flash and when should I write it to flash that could make the whole update process secure?