Currently, when I am using SPI to transmit data, I found that the first SPI transmission after power-on is abnormal. I configured SPI_CLK to be at a high level when idle and set the corresponding PORT to default high output level. During the initialization process, when PORT_INIT is completed, the CLK pin is at a high level. However, after the SPI initialization is finished, the CLK pin is pulled low. It is not until my first communication arrives that the CLK pin is re-raised. But in this case, my first communication becomes a wrong format.
Moreover, when there is no hardware pull-up on my PCBA and the software PORT configuration also lacks a pull-up, even if the CLK pin is set as an output and the output is at a high level, it is unable to output the actual high level (currently, I have set a software pull-up to temporarily avoid this problem). I wonder how this can be resolved?
The MCU I am using is FS32K148. The MCAL version is shown in the figure. Thank you very much for your help!!