I am a starter with respect to high end controllers.
I am having STM32L562QE-DK. I downloaded the OTFDEC_ExecutingCryptedInstruction project out of STMCube. It works as it is.
What I tried ?! :
- I wrote a small code for subtracting two numbers and had it in a separate .c file.
- From main after OSPI in memory mapped mode and OTFDEC init (mode, nonce, key init), called the above function. Parallely I have specified in my linker file that the above .o file has to be placed in the external memory (from 0x90003000 address).
- From the built output hex I splitted the external flash part with the hex editor.
- As in the youtube link shared, I gave the bin of the external flash part to this batch file for encryption. I got an output encrypted file as specified in the video.
- I loaded this file into the external flash and the other part of the hex into internal flash and restarted the device.
- I had written a LED indication upon success but it didn't happen.
- Without encryption and OTFDEC, just by placing the code in the external flash with memory mapped mode it is getting executed with success.
What am I missing. I saw examples which loads a set of instructions or a separate project into external flash. But I want few functions out of a set of .o files to be placed in the external flash and to be executed seamlessly from the internal flash.
Please guide me on this. Many thanks already !!