S32K148 SPI Slave with Real Time Driver

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

S32K148 SPI Slave with Real Time Driver

ソリューションへジャンプ
1,782件の閲覧回数
wkim
Contributor II

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!

0 件の賞賛
1 解決策
1,528件の閲覧回数
wkim
Contributor II

Following sample could solve my issue. See attached file SPI_Slave_solved

 

Thank you for your assistance!

元の投稿で解決策を見る

0 件の賞賛
8 返答(返信)
1,529件の閲覧回数
wkim
Contributor II

Following sample could solve my issue. See attached file SPI_Slave_solved

 

Thank you for your assistance!

0 件の賞賛
1,580件の閲覧回数
wkim
Contributor II

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

0 件の賞賛
1,645件の閲覧回数
wkim
Contributor II

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

0 件の賞賛
1,743件の閲覧回数
namnguyenviet
NXP Employee
NXP Employee

Hello @wkim,

Have you checked whether the interrupt handle could be called? 

Best Regards,

Nam

0 件の賞賛
1,705件の閲覧回数
wkim
Contributor II

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

0 件の賞賛
1,700件の閲覧回数
namnguyenviet
NXP Employee
NXP Employee

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

0 件の賞賛
1,697件の閲覧回数
wkim
Contributor II

Hello @namnguyenviet,

sure. The project is in the 7zip file.

Thank you for your assistance.

Kim

0 件の賞賛
1,632件の閲覧回数
cuongnguyenphu
NXP Employee
NXP Employee

Hi @wkim ,
I'm checking your issue on be half of @namnguyenviet

0 件の賞賛