I downloaded the MCAL code package named UJA116xA SBC AUTOSAR R21-11 Version from NXP's official website and used it as the driver for my UJA1169. However, occasional initialization failures occur when using this code.
This is a portion of the waveform during normal initialization. The first waveform comes from Sbc_uja116xa_TransferDataForDriverInit in Sbc_43_uja116xa_SetOpMode, which is the first step of the SBC initialization.
However, when I repeatedly power cycle the SBC (turning the power off and on repeatedly while connected to the PLS debugger), initialization failures occasionally occur. Below are the first few waveforms during an initialization failure. It can be seen that there is no feedback from the SBC on the MISO line, which causes the initialization to fail.
Although the initialization failed, after a period of time, the SPI communication resumed normal operation, and data could be read normally from the MISO line. As shown in the figure below.
What could be the possible causes of this issue? I noticed that there is a delay function called Tm_BusyWait1us16bit(10) before the initialization. What is the purpose of this delay, and could it be related to the issue?
Hi Bai,
Please see below the answer from our SW engineer.
The Tm_BusyWait1us16bit function was added there to perform the required delay time before the UJA1169 exits Reset mode and allows SPI communication again.
Snippet is taken from the UJA1169 datasheet, section 7.1.1.4:
Can you please provide some additional information about the timing you are using for the SBC power cycles? Maybe that is why you are having the problem with the communication as the SBC does not have enough time to exit the Reset mode and resume normal SPI operation.
BRs, Tomas