Hello,
Note, we have a new product release which may solve your issue.
The latest SCST Library version for the S32K 14x - RTM 1.0.6 release has implemented fix which protects SCST Library against external interrupts. Please, check that you are using the latest version.
The only source of SCST Library interruption can be then running SysTick timer. In case of the User Application or Operating system is using the SysTick timer, then the SCST Library must be configured properly. Please see, M4_SCST_SYSTICK_IS_RUNNING configuration parameter in the “m4_scst_configuration.h” file and configure it as follows:
#define M4_SCST_SYSTICK_IS_RUNNING 1U
where
1U – SysTick timer is used by the user application
0U – SysTick timer is not used by the user application.
Note, that this configuration parameter is available only for the latest RTM 1.0.6.
Also calling of both DISABLE_INTERRUPTS()/ENABLE_INTERRUPTS() functions is not needed for the latest RTM 1.0.6 release.
For the older releases like RTM 1.0.5, calling of DISABLE_INTERRUPTS()/ENABLE_INTERRUPTS() makes sense but only if interrupts are disabled/enabled in the NVIC controller and not in the core by using CPSID/CPSIE assembly instructions (please check how these functions are implemented). For older releases it must be ensured that SysTick timer is not active!