Hi,
1) There is while(1) loop in LPU_Stop_Init function. After the wake up, MCU will execute this infinite loop, so this could be use as the check of wake up. But do not forget, it still runs from RAM memory, not from flash, and Z4 core is still in low power. Also Z2 is in LPU_RUN mode.
2) This changes should not affect the functionality.
3) In my example, there is not any IVOR4 interrupt handler and also there are not any interrupt sources, so I think it is not possible to get IVOR4 in my example.
From your sentence "I tried both functions" I am not sure, if you understand my example correct. It is necessary to use both function in the correct order. At first, LPU_Init has to be called. This function switch MCU to LPU_RUN mode and Z4 cores are disabled. Z2 core runs from RAM memory. Then LPU_Stop_Init has to be called. This function has to be placed in the beginning of the RAM, because after mode transition to LPU_RUN, Z2 is reset and started to run from 0x40000000 address. This is also the reason, why the stack initialization has to be done again (file z2_restart.s)
At first, try my example without changes and it should works (I tested it). I also recommend you to use Lauterbach debugger, because I am not sure if it will be possible to debug this example with for example PE Micro.
Regards,
Martin