No data after SPI slave read sequence in S32K344T172 EVB

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

No data after SPI slave read sequence in S32K344T172 EVB

921 次查看
ErwinR
Contributor III

I am trying to communicate with a IsoSPI transciever using two SPI modules - LPSPI4 as master and LPSPI1 as slave. The master manages to send the data and the device responds by sending data to the slave, yet after saving the read data to a variable the variable seems to be empty (equal to 0). I tried to make an example project without the transciever, just between a S32K344 and S32K144 boards and everything seems to work well, I could see all the data transfered in FreeMaster, but when it comes to communicating with the isoSPI transciever, all of the data variables in FreeMaster are equal to 0x00 without any change through time. I am attaching the project and the configuration since I am unable to find the reason why the read variable is empty when tested on the communication with another device. As mentioned before, the device sends a 48 bit response, the s32k344 evb does not manage to write it to the variable..

ErwinR_0-1745579834357.png

 

标记 (5)
0 项奖励
回复
6 回复数

885 次查看
stefanvlad
NXP Employee
NXP Employee

Hi @ErwinR ,

 

From last time we discussed Solved: Re: SPI no data transfer in S32K344_T172 MBDT example project - NXP Community

What isolated SPI transceiver or board are you using?  The complete setup that you have, maybe a connection diagram ? 

 

NXP does have some isolation transceivers: MC33664 and MC33665A PDF file: Isolated network high-speed transceiver .

Mainly i have seen them being used in the BMS domain,

Stefan V.

0 项奖励
回复

820 次查看
ErwinR
Contributor III

Hi @stefanvlad ,

I am using a MC33664 transciever evalboard which is connected to a board with a BCC MC33771C. 
I can provide a connection table between the S32K344T172 EVB and the FRDM33664BEVBUG:

S32K344T172 EVBFRDM33664BEVBUG
LPSPI1_SCKPTB14J4-11SCLK_TXJ1-9
LPSPI1_PCS3PTB17J4-5CSB_TXJ1-14
LPSPI1_SOUTPTB16J4-7DATA_TXJ2-8
LPSPI4_SCKPTB10J4-12SCLK_RXJ9-7
LPSPI4_PCS0PTC10J4-3CSB_RXJ9-5
LPSPI4_SINPTB11J39-11DATA_RXJ2-19
INTBPTB13J2-4INTBJ1-8
ENPTB12J2-1ENJ2-18
5V J39-13VCCJ9-10

3V3

 J39-10VCCIOJ9-8
GND  GNDJ2-14;J9-12;J9-14

 

LPSPI1 is set as Master and LPSPI4 is set as Slave.
The baudrate for both LPSPI peripherals is set to 2MHz.

The master send command works well and the BCC device is able to read the data and send a reply. The problem I've encoutered is with the Slave recieve command, it seems that either the timing of the recieve command is bad or maybe I've missed something while setting up the slave based on the example I was doing from the previous post. 
Recently I've tried running the slave recieve block during a hardware interrupt which is triggered after the master send transmission ends. I've added a Led enable block to debug the interrupt.

ErwinR_0-1746424107350.jpeg

 

From the logic analysis it seems that the transmit sequence ends in the middle of the recieve sequence, thus LSPSPI4 cannot recieve the whole message. Though I am not entirely sure about that. From the SPI_GetSequenceResult block for LPSPI1 recieve the result is written as 2 which means that the sequence ended in failure.

0 项奖励
回复

716 次查看
stefanvlad
NXP Employee
NXP Employee

Hi @ErwinR ,

 

After talking with my colleagues from the BMS toolbox, they recommended you install: 

MBDT battery management system 1.2.0

NXP Model-Based Design Toolbox for S32K3xx - version 1.4.0

and then use the example inside the BMS toolbox: s32k344_664_774_s32ct

 

Also please check the Interrupt controller priorities, and check if the SPI priority is lower than the PIT0 step_timer of the model:

stefanvlad_0-1747815381767.png

Scrolling down the page we can see the LPSPI interrupt priorities: 

stefanvlad_1-1747815522913.png

in this case the PIT_0_ISR interrupt Priority must be higher than the LPSPI_IRQ.

 

Best regards,

Stefan V.

 

0 项奖励
回复

667 次查看
ErwinR
Contributor III

Hi @stefanvlad ,

Thank you for the suggestion — I’ll try installing those toolboxes. However, MathWorks is currently experiencing an outage due to a ransomware attack. As a result, I’m unable to download the "NXP Support Package for BMS" and the "Support Package for S32K3xx," and it’s unclear how long the MATLAB Add-On servers will be unavailable.

Would it be possible for you to share those packages with me, if you have them available?

Thanks in advance,
Erwin R

0 项奖励
回复

649 次查看
stefanvlad
NXP Employee
NXP Employee

Hi @ErwinR ,

 

You can download the packages from NXP directly by login into: https://www.nxp.com/webapp/swlicensing/urlRedirect.sp?nextURL=switchaccount

then you can download:

Model-Based Design Toolbox for Battery Management System version 1.2.0 RFP

and

Model-Based Design Toolbox for S32K3xx version 1.4.0

then you need to rename the SW32_MBDT_BMS_1.2.0_D2411.zip to SW32_MBDT_BMS_1.2.0_D2411.mltbx and open it with Matlab to install it.

stefanvlad_1-1748342361605.png

 

And for the license file, you need to generate it on the above links, in the tab License Keys:

stefanvlad_0-1748341980525.png

then you generate the corresponding license.dat by clicking Save All.

And then copy license.dat file in the lic folder:

stefanvlad_2-1748342786733.png

Last step, go to patches folder, unzip the archive inside, and run the NXP_MBDToolbox_S32K3xx_patch.m script:

 

stefanvlad_0-1748349951732.png

 

Then you can open the s32k344_664_774_s32ct.mdl:

stefanvlad_3-1748343375812.png

 

Best regards,

Stefan V.

 

0 项奖励
回复

430 次查看
ErwinR
Contributor III

Hi @stefanvlad ,

I've downloaded the toolboxes a few weeks ago and launched the s32k344_664_774_s32ct.mdl yet I keep having problems with this example. The original project is designed for a BCC 744 device which means it has a different length of TPL data and different commands. I tried modifying the project and configuration tool for the BCC 772C with the C1P1AE core which is similar to the BCC 771C to some point yet the project does not seem to be able to build and upload and gives an error of "Code generation information file does not exist". I tried to find ways on how to modify the configuration tool for the BCC771C yet I can't seem to find the possibilities to launch a succesfull build.

0 项奖励
回复