Mikhail,
I had the same problem.
CWMCU 10.4
MK22FX512VLL12 2N03G
As you know, during PE's UART0_Init() function, there is an unhandled interrupt which stops the MPU. Commenting out the reg inits with UART0_*7816 will prevent the interrupt, but you have to do this every time you "Generate Code" in PE. I agree, this is a PE or MK22 bug.
To fix this just disable all interrupts prior to calling PE_low_level_init(), and enable the interrupts in your code when you are good and ready. PE should disable all INTs before init.
1. In PE Component Inspector, set "generate code" for the EnableInt and DisableInt methods in the CPU component.
2. Add Cpu_DisableInt(); in the main() function (ProcessorExpert.c) as shown below:
int main(void)
/*lint -restore Enable MISRA rule (6.3) checking. */
{
/* Write your local variable definition here */
Cpu_DisableInt(); // <-add this line
/*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
PE_low_level_init();
/*** End of Processor Expert internal initialization. ***/
...
3. In your code, after YOUR init stuff, enable the interrupts if needed.
...
Cpu_EnableInt();
...
Hope this helps,
-Brian