Hi felipegsoto !
By using common sense, yes interrupts should be disabled like we did on K82 when use it.
But LPC is not offers source code for flash routines and there are part of romcode. It cause huge amount of questions and rumor
how tere are really done.
1. I enable 2kHz Systick interrupts and 1kHz from OS timer and FLASH_write/erase routines is not failed.
It can be so that interrupts disabled some how inside FLASH API. ( K82 fail almost immideatelly )
2. If I try to utilize the same 32KB block for erase/write of my data what partially used by code and while write always have
Ecc error.
It seems to me internal flash splitted on some independant 32KB blocks even whole flash are not banked.
3. In any case flash memory should have wait loop in sram for loop end of flash operations.
Where it is located ? In stack or some area is occupied what is not disclosed in UM.
4. We have very have usage of TZ secure gates and should know what access right should be given to memory/peripherals.
And executable rights for ram where is loop as well.
5. Disabling of interrupts require privileged execution and it cause problems as well, becouse our TZ code need to be run with User privileges.
it means we need to know case if we use 32KB aligned flash block, should we disable interrupts or not
and where wait loop is allocated. And does FLASH API is used any other SRAM memory or only stack ?
For Secure SPI of ROM some SRAM area is specified but for FLASH is not documented in UM.
So you can see that implementing any adequate application on LPC require little bit more details than mentioned in UM
and DS and it is quite difficalt to find out everythyng via testing.
Regards,
Eugene