Hi @Luis1
First, based on the information provided, it appears that you are mixing low-level drivers (IP layer) with high-level drivers (MCAL). This approach is generally not recommended, particularly if your implementation is intended to be AUTOSAR-compliant.
Regarding your configuration, I have the following observation:
- For LPSPI1, you have assigned AIPS_PLAT_CLK as the SpiPhyUnitClockRef. However, the source clock for this is AIPS_SLOW_CLK. Therefore, you need to include this clock in the McuClockReferencePoint configuration within the MCU driver and assign it accordingly to this SPI instance.
Regarding your code, as mentioned earlier, you are mixing both software layers, which is not recommended. There are some exceptions when working with low-level drivers, as certain modules are only available in MCAL (for example, the RM), where mixing layers may be expected.
I suggest reviewing the following thread, where two examples are provided: one using the IP layer and another using MCAL. This will help you understand the differences in the APIs required for each approach. Please note that the examples are not specifically intended for S32K396 devices, but they can still serve as a useful reference.
Example S32K344 SPI Transmit & Receive Using DMA DS3.5 RTD500
BR, VaneB