S32K311 MBDT - Issues with LPSPI0

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32K311 MBDT - Issues with LPSPI0

Jump to solution
363 Views
beginner100
Contributor II

I am using S32K311 for my project. 

I have configured LPSPI0 as Master to use with a Slave. 

Pins 

schitta_0-1751400870328.png

Peripherals

schitta_1-1751400953687.png

 

Port - configured with no issues

schitta_2-1751400980436.png

Model: Reused example model SPI Asynchronous Interrupt Transfer S32CT, modified so that an LED Blinks after a successful job instead.

 

schitta_3-1751401135033.png

This is what's inside the Initialize Block

schitta_5-1751401413326.png

 

There were issues building the model with regards to Lpspi_Ip_LPSPI_1_IRQHandler and Lpspi_Ip_LPSPI_2_IRQHandler. 

I disabled those interrupts and enabled for LPSPI0 in S32CT - Platform component

schitta_4-1751401243962.png

Then I was able to build with no issues, but when I flashed the program, I don't see expected output. I previously used S32K312 EVB and was able to check data being sent on the scope but now, I only see a solid 5V going out on MOSI line.

Attached the mex file below.

Please let me know what other steps I might be missing. Let me know if you need any additional info.

Also, I am a new user of S32CT and if there are any resources to understand the S32CT in a detailed and better way, that would be very helpful.

 

Thank you!

 

 

0 Kudos
Reply
1 Solution
341 Views
dragostoma
NXP Employee
NXP Employee

Hi, @beginner100,

Following an initial review of your .mex file, I noticed that while the LPSPI interrupt configurations have been updated, the MCU tab still enables clocks for incorrect LPSPI instances. Please ensure that the clock is also enabled for the instance you intend to use — specifically, LPSPI0. You can find this setting at the following path: Mcu -> McuModuleConfiguration -> McuModeSettingConf -> McuPeripheral

dragostoma_0-1751455935640.png

I'll continue analyzing your file in more detail, but I recommend making this adjustment and testing again.

Regarding S32 Configuration Tool (S32CT) resources, I’ll send you a list of relevant tutorials where you can see how it's typically used to configure pins, clocks, and peripherals.

1. https://community.nxp.com/t5/NXP-Model-Based-Design-Tools/Interacting-with-Digital-Inputs-Outputs-on...

2. https://community.nxp.com/t5/NXP-Model-Based-Design-Tools/Sending-data-via-UART-and-monitoring-signa...

3. https://community.nxp.com/t5/NXP-Model-Based-Design-Tools/Controlling-LED-intensity-with-ADC-and-PWM...

4. https://community.nxp.com/t5/NXP-Model-Based-Design-Tools/Communicating-over-the-CAN-Bus/ta-p/175845...

Let me know if you need further assistance.

 

Best regards,

Dragos

View solution in original post

1 Reply
342 Views
dragostoma
NXP Employee
NXP Employee

Hi, @beginner100,

Following an initial review of your .mex file, I noticed that while the LPSPI interrupt configurations have been updated, the MCU tab still enables clocks for incorrect LPSPI instances. Please ensure that the clock is also enabled for the instance you intend to use — specifically, LPSPI0. You can find this setting at the following path: Mcu -> McuModuleConfiguration -> McuModeSettingConf -> McuPeripheral

dragostoma_0-1751455935640.png

I'll continue analyzing your file in more detail, but I recommend making this adjustment and testing again.

Regarding S32 Configuration Tool (S32CT) resources, I’ll send you a list of relevant tutorials where you can see how it's typically used to configure pins, clocks, and peripherals.

1. https://community.nxp.com/t5/NXP-Model-Based-Design-Tools/Interacting-with-Digital-Inputs-Outputs-on...

2. https://community.nxp.com/t5/NXP-Model-Based-Design-Tools/Sending-data-via-UART-and-monitoring-signa...

3. https://community.nxp.com/t5/NXP-Model-Based-Design-Tools/Controlling-LED-intensity-with-ADC-and-PWM...

4. https://community.nxp.com/t5/NXP-Model-Based-Design-Tools/Communicating-over-the-CAN-Bus/ta-p/175845...

Let me know if you need further assistance.

 

Best regards,

Dragos