could i disable the NMI interrupt after system reset ,before into the main function.
like change the flash data or something else.
thanks.
By definition Non Maskable Interrupts can not be disabled at run time.
Many parts do have a Flash configuration option byte that will either disable NMI completely before executing code or turn it into an alternative function such as enabling the bootloader.
Regardless of that, any NMI pin must not be asserted at reset or allowed to float.
There can be timing races in some parts that cause the NMI to happen before anything else.