Hello,
I am trying to set up a simple routine for the S32K148 EVB to act as a SPI-Slave. My issue is with the functions from the Lpspi_Ip. Following version is used:
* Project : RTD AUTOSAR 4.4
* Platform : CORTEXM
* Peripheral : LPSPI
* Dependencies :
*
* Autosar Version : 4.4.0
* Autosar Revision : ASR_REL_4_4_REV_0000
* Autosar Conf.Variant :
* SW Version : 1.0.0
* Build Version : S32K1_RTD_1_0_0_D2108_ASR_REL_4_4_REV_0000_20210810
I have tried implementing following functions:
/* Initalized clock */
Clock_Ip_Init(&Mcu_aClockConfigPB[0]);
/* Initialize interrupt */
IntCtrl_Ip_Init(&IntCtrlConfig_0);
IntCtrl_Ip_ConfigIrqRouting(&intRouteConfig);
/* Initalized spi using instance lpspi as a spi slave */
Lpspi_Ip_Init(&Lpspi_Ip_PhyUnitConfig_SpiPhyUnit_0_BOARD_InitPeripherals);
/* Update Transfer Mode */
Lpspi_Ip_UpdateTransferMode(SLAVE_EXTERNAL_DEVICE.Instance, LPSPI_IP_INTERRUPT);
/* Slave set up and waiting active signal of Cs from master to process data reception */
Lpspi_Ip_AsyncTransmitHalfDuplex(&SLAVE_EXTERNAL_DEVICE, RxSlaveBuffer, (uint16)NUMBER_OF_BYTES, LPSPI_IP_HALF_DUPLEX_RECEIVE, SpiCallBack);
I use an external device to send SPI-frames to the board. --> If I send something, the Lpspi_Ip_GetStatus(SLAVE_EXTERNAL_DEVICE.Instance); status stays BUSY. I am realy not sure how to aproach this properly.
Can you help me out somehow?
Thanks in advance for your support!
Solved! Go to Solution.
Following sample could solve my issue. See attached file SPI_Slave_solved
Thank you for your assistance!
Hello @namnguyenviet,
I urgently need assistance. Your colleague @cuongnguyenphu does not seem to answer to my request. It is quite important, that we solve this issue, due to a deadline of our customerproject.
Regards,
Kim
Hello @namnguyenviet,
could you open my project? Is there any more information I can provide to you, so you can better understand my issue?
Thanks for you Help.
Kim
Hello @namnguyenviet,
thank you for your quick reply. And also a happy new year!
The interrupt handle is called without issues using following function: Lpspi_Ip_IrqHandler(SLAVE_EXTERNAL_DEVICE.Instance);
Also I have added some void testFunction in the "generic interrupt settings" (LPSPI0_IRQn)
This function is also never called if my external device sends dome SPI commands.
Best Regards,
Kim
Hello @wkim,
I assumed you might have missed some interrupt installation. Can you share with me the project so I will check in my site?
Best Regards,
Nam
Hi @wkim ,
I'm checking your issue on be half of @namnguyenviet