Hello,
I've a couple of issues about the security on my XRT1040. I'm working with the EVK.MIMXRT1040.
I'm creating my L2BOOT but now, to make it easy, I turned it in a very simple led toggle code.

This is my flash configuration:
- BOARD FLASH area in which i put the application code
- ENCRYPTED AREA where I want to save some data that I want to encrypt with OTPMK

Basically I'm in this situation, I have a large amount of empty flash between my boot code area and the area I reserved for encryption.

As I already mentioned, I want the Encrypted area to be encrypted with the OTPMK, but I want also the authentication of the boot image, so this is how I set up the Provisioning Tool:

After this, I loaded the application on my EVK and, after the reset, the application start as expected (just a simple toggle of the the green led).
Now my problems:
- I read the entire memory content using the Flash Programmer utility in the Provisioning Tool. What I saw is an encrypted region, at addres 0x607F8000, larger than the lenght I set in the building image settings. Why this difference?

2. After the previous procedere my boot applications starts properly. But, when I try to write some datas in my empty area (the space between the end of my application and the beggining of the encrypted area) the application doens't start.
For example, if I write just a simple value at address 0x6005E000 and then I restart the device, my boot application doesn't start the execution (it's easy to see since it is a simple toggle led example)

I suppose that the problem regards the HAB and the authentication process of the image. But this space should be outside my application code, so it shouldn't be interested about the HAB process...
It would be very appreciated your help.
Regards