Hi Roy,
Are you using NMI functionality in your application? if not, you can disable it permanently via FOPT setting. In IAR IDE, you should have vector.h file, modify CONFIG_4 to following value will disalbe NMI and EZ-PORT mode.
#define CONFIG_4 (pointer*)0xfffff9fe, //nmi = 0, EZPORT = 0, LPBOOT = 1
or just disable EZ-PORT mode
#define CONFIG_4 (pointer*)0xfffffdfe, //nmi = 1, EZPORT = 0, LPBOOT = 1
See more details in Chapter 6 FOPT boot options session.
Make sure you have the option of --enable_config_write to use IAR flash loader to program flash configuration filed.
If you want to use NMI and Ez-Mode, make sure following items checked in NMI isr routine.
1. checking if MCU wakeup from VLLSx mode, if yes, make sure to disable WDOG for VLLSx mode recovery time may be up to 100us.
2. checking if MCU wakeup from VLLSx mode, if yes, make sure no printf or any registers accessing before the clock for certain modules enabled in your NMI isr
Hope this helpful.
Sandy