The RT1062 project debug build worked properly, but when the release build and the optimize most(-O3) are selected for fsl_spdif.c, it always enters HardFault_Handler().
The disassembly codes were analyzed as below and they seemed not correct. ".IsRxAutioSync" was interpreted as ".IsTxAutioSync", and some variables such as .txClkSource were ignored.
Hi @jasonedn,
This is definitely an unintended side effect of the aggressive optimization efforts of the GNU -O3 optimization level. Since that depends on the compiler, I'm afraid there is not much I can recommend other than to refrain from using -O3 and stick to -O2 instead.
BR,
Edwin.