Hi @ggreguer
1. Once HSE is installed, parts of flash are allocated exclusively for HSE firmware. You can take a look at following tables in the reference manual:
Table 199. Configuration details when the HSE_B firmware usage feature flag is enabled
Table 200. AB swap configuration
https://www.nxp.com/webapp/Download?colCode=S32K3XXRM
Table 199 is actually the state of memory when FULL_MEM is installed.
For example, if Pemicro debugger is used, it's up to user to select the right flash algorithm depending on installed firmware. Such flash algorithm then avoids access to reserved areas.
I believe that Segger's tools do that automatically based on status registers. You may contact Segger directly for details.
https://kb.segger.com/NXP_S32K3xx#HSE_activated
https://www.segger.com/support/technical-support/
2. Once HSE firmware is installed, two things are needed:
- It's necessary to wait until HSE_STATUS_INIT_OK flag in FSR register in MU_0 is set. Before that, you can't trigger any HSE services. For example, you can find something like this in HSE DemoExamples:

Or something like this in RTD examples:

- When clocks are being initialized after reset, it's necessary to wait for WFI bit in PRTN0_CORE2_STAT register. This bit says that SBAF/HSE is in idle state and clocks can be changed. It's not possible to change the HSE_CLK while HSE is running, this can lead to unpredictable behavior. This was not done in earlier version of RTD drivers, it was up to user. Now it's fixed and implemented in clock init functions in RTD 5.0.0 and higher.
Regards,
Lukas