Ok, this avoids to overwrite the SOURCE bit of the SCG_SPLLCFG.
But as I said before, LATER in the initialization sequence, at the end of CLOCK_SYS_ConfigureModulesFromScg, a final call to CLOCK_SYS_ConfigureFIRC is done, and due to the fact that it is not understood by the code that FIRC is (indirectly) used as a main clock souce, FIRC is switched off, hanging the CPU:
/* If clock is used by system, return error. */
if (SCG_GetFircSystemClockMode(SCG))
{
status = STATUS_BUSY;
}
/* Disable FIRC */
else
{
/* Clear LK bit field */
SCG_ClearFircLock(SCG);
/* Disable monitor, disable clock and clear error. */
SCG_ClearFircControl(SCG);
}
I already tried to fiddle with SCG_GetFircSystemClockMode(SCG) in order to avoid it returning false when SPLL is supplied by FIRC, but logic is still not ok, at the end of CLOCK_SYS_ConfigureModulesFromScg it returns BUSY.
I think the logic of that part must be adapted as well.
I hope it is more clear now.
Thank you