Hello, @glenndoiron
I have investigated the issue that you have with LPSPI interrupts and I have some ideas to explain. As Marius said PIL simulation is not intended to access hardware stuff, it is for validation purposes. In PIL simulation you put an algorithm which will run on the hardware to check if that algorithm is performing well on the target, measure the code execution profiling or to observe code coverage.
From the model deployed on target in normal mode, the entire LPSPI initialization code is executed before enabling all interrupts, as shown in the next image.

In PIL mode, the code is generated differently. The LPSPI init code is executed in the xilSystemInitialize function defined in the xil_interface.c which is generated automatically by Siumulink and we don`t have control on this, so we cannot call the functions for enabling the interrupts. Also, the main function that we defined in normal mode in the mbd_main.c file is redesigned as hw_init in the mbd_hw_init.c file and we could enable the interrupts there, but we cannot call the initialization function which contains the LPSPI init code.


So, our suggestion is to redesign you approach and try not to access hardware in PIL simulation. Also, PIL is not a real time simulation and even if you succeed to have a functional LPSPI, you could lose data in the transfer or it can block the execution of the simulation.
Best regards,
Stefan.