Hi. I would like to config the system clock source in case of XOSC failure. But I don't know how to select system clock source. Can anybody help me?
I my opinion, If I want to switch XOSC to IRCOSC, I only need to config AUX Clock Selector 4 and system clock selector,is that right?
For this it is needed to use Mode Entry module. For instance you have configured RUN0 mode to have system clock driven by IRCOSC and RUN1 mode to have system clock driven by XOSC. Changing is being done by transition between user modes.
However as you specifically mentioned XOSC failure, it is recommended to be followed by reset:
Also pay attention to following appnote, specifically to description NCF[24]-NCF[31]:
https://www.nxp.com/docs/en/application-note/AN5259.pdf
And here using of FCCU and it is related to this topic as well:
https://www.nxp.com/docs/en/application-note/AN5284.pdf
For mode entry module I could recommend to see for instance my example wrriten for MPC5643L but ME module principle is the same. Pay attention to ModesAndClks_init function in main.c file where you can several transitions between user modes:
https://community.nxp.com/docs/DOC-101713
Hope it helps