<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: [S32K3] LPSPI Master+Slave in S32K</title>
    <link>https://community.nxp.com/t5/S32K/S32K3-LPSPI-Master-Slave/m-p/2108793#M49488</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/248971"&gt;@DiaDev&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Based on the schematic, here is how I understand the connections:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="25px" class="lia-align-center"&gt;Signal&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px" class="lia-align-center"&gt;Slave (LPSPI1)&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px" class="lia-align-center"&gt;Master (LPSPI2)&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="24px" class="lia-align-center"&gt;PCS0&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;PTA21 (input)&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;PTB25 (output)&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="25px" class="lia-align-center"&gt;SCK&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;PTA28 (input)&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;PTB29 (output)&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="25px" class="lia-align-center"&gt;MOSI&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;PTA26 (input)&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;PTB28 (default: input)&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="25px" class="lia-align-center"&gt;MISO&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;PTA30 (output)&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;PTB27 (default: output)&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;As we can see, the pin setup on the master side does not match the default SPI configuration. That is why, as previously mentioned, you will need to modify the LPSPI-&amp;gt;CFGR1[PINCFG]register.&lt;/P&gt;
&lt;P&gt;You have two options:&lt;/P&gt;
&lt;P&gt;1. Update the PINCFG register to change the default direction of PTB28 and PTB27, so PTB28 becomes an output (MOSI) and PTB27 becomes an input (MISO), matching your intended configuration.&lt;/P&gt;
&lt;P&gt;2. Swap the signal roles so that PTB28 is used as the master input (MISO) and PTB27 as the master output (MOSI). This way, you can keeo the default configuration and avoid changing the PINCFG register.&lt;/P&gt;</description>
    <pubDate>Mon, 02 Jun 2025 17:10:59 GMT</pubDate>
    <dc:creator>VaneB</dc:creator>
    <dc:date>2025-06-02T17:10:59Z</dc:date>
    <item>
      <title>[S32K3] LPSPI Master+Slave</title>
      <link>https://community.nxp.com/t5/S32K/S32K3-LPSPI-Master-Slave/m-p/2108169#M49439</link>
      <description>&lt;P&gt;Platform: S32DS 3.5.14&lt;BR /&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm using the S32K344-EVB with LPSPI1 as Master and LPSPI2 as Slave. I'm facing an issue where the RX data is not being received, even though interrupts are enabled for both.&lt;/P&gt;&lt;P&gt;#define BUFFER_SIZE 10U&lt;/P&gt;&lt;P&gt;#define MASTER_EXTERNAL_DEVICE (Lpspi_Ip_DeviceAttributes_SpiExternalDevice_0_Instance_1_BOARD_InitPeripherals)&lt;BR /&gt;#define SLAVE_EXTERNAL_DEVICE (Lpspi_Ip_DeviceAttributes_SpiExternalDevice_1_Instance_1_BOARD_InitPeripherals)&lt;/P&gt;&lt;P&gt;static uint8 TxMasterBuffer[BUFFER_SIZE] = {0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA};&lt;BR /&gt;static uint8 RxMasterBuffer[BUFFER_SIZE] = {0};&lt;/P&gt;&lt;P&gt;static uint8 TxSlaveBuffer[BUFFER_SIZE] = {0xB1, 0xB2, 0xB3, 0xB4, 0xB5, 0xB6, 0xB7, 0xB8, 0xB9, 0xBA};&lt;BR /&gt;static uint8 RxSlaveBuffer[BUFFER_SIZE] = {0};&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;int main(void)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;/* Initialize system clock, pin muxing, and interrupts */&lt;BR /&gt;Clock_Ip_Init(&amp;amp;Clock_Ip_aClockConfig[0]);&lt;BR /&gt;Siul2_Port_Ip_Init(NUM_OF_CONFIGURED_PINS0, g_pin_mux_InitConfigArr0);&lt;BR /&gt;IntCtrl_Ip_Init(&amp;amp;IntCtrlConfig_0);&lt;/P&gt;&lt;P&gt;/* Initialize LPSPI1 (Master) and LPSPI2 (Slave) */&lt;BR /&gt;Lpspi_Ip_Init(&amp;amp;Lpspi_Ip_PhyUnitConfig_SpiPhyUnit_0_Instance_1_BOARD_InitPeripherals); // Master&lt;BR /&gt;Lpspi_Ip_Init(&amp;amp;Lpspi_Ip_PhyUnitConfig_SpiPhyUnit_1_Instance_2_BOARD_InitPeripherals); // Slave&lt;/P&gt;&lt;P&gt;/* Set transfer mode to interrupt for both */&lt;BR /&gt;Lpspi_Ip_UpdateTransferMode(MASTER_EXTERNAL_DEVICE.Instance, LPSPI_IP_INTERRUPT); // Master&lt;BR /&gt;Lpspi_Ip_UpdateTransferMode(SLAVE_EXTERNAL_DEVICE.Instance, LPSPI_IP_INTERRUPT); // Slave&lt;/P&gt;&lt;P&gt;/* Start Slave transfer first */&lt;BR /&gt;(void)Lpspi_Ip_AsyncTransmit(&lt;BR /&gt;&amp;amp;SLAVE_EXTERNAL_DEVICE,&lt;BR /&gt;TxSlaveBuffer,&lt;BR /&gt;RxSlaveBuffer,&lt;BR /&gt;BUFFER_SIZE,&lt;BR /&gt;SpiSlave_Callback);&lt;/P&gt;&lt;P&gt;/* Then start Master transfer */&lt;BR /&gt;(void)Lpspi_Ip_AsyncTransmit(&lt;BR /&gt;&amp;amp;MASTER_EXTERNAL_DEVICE,&lt;BR /&gt;TxMasterBuffer,&lt;BR /&gt;RxMasterBuffer,&lt;BR /&gt;BUFFER_SIZE,&lt;BR /&gt;NULL);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;while (1)&lt;BR /&gt;{&lt;BR /&gt;// Idle loop; transfers are handled via interrupts&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;return 0;&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Fri, 30 May 2025 17:20:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K3-LPSPI-Master-Slave/m-p/2108169#M49439</guid>
      <dc:creator>DiaDev</dc:creator>
      <dc:date>2025-05-30T17:20:38Z</dc:date>
    </item>
    <item>
      <title>Re: [S32K3] LPSPI Master+Slave</title>
      <link>https://community.nxp.com/t5/S32K/S32K3-LPSPI-Master-Slave/m-p/2108271#M49446</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/248971"&gt;@DiaDev&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I just have one observation based on the configuration you shared. It looks like the default pin configuration is still in place, meaning SOUT is set as output and SIN as input.&lt;/P&gt;
&lt;P&gt;As your goal is to change this behavior, you will need to modify the LPSPI-&amp;gt;CFGR1[PINCFG] register. Since you are working with ConfigTools, I would recommend checking out the following thread, it covers how to make this change directly in the tool.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.nxp.com/t5/S32K/MR-CANHUBK344-SPI-Setup/td-p/1992828" target="_blank" rel="noopener"&gt;MR-CANHUBK344 SPI Setup&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR, VaneB&lt;/P&gt;</description>
      <pubDate>Fri, 30 May 2025 21:53:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K3-LPSPI-Master-Slave/m-p/2108271#M49446</guid>
      <dc:creator>VaneB</dc:creator>
      <dc:date>2025-05-30T21:53:40Z</dc:date>
    </item>
    <item>
      <title>Re: [S32K3] LPSPI Master+Slave</title>
      <link>https://community.nxp.com/t5/S32K/S32K3-LPSPI-Master-Slave/m-p/2108407#M49458</link>
      <description>&lt;P&gt;I noticed that the SIN and SOUT pin assignments differ between the schematic and the project’s pin configuration. To avoid issues, I went with the pinout as shown in the schematic.&lt;BR /&gt;&lt;BR /&gt;Is the schematic considered the correct reference in this case?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DiaDev_0-1748839248683.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/340827i7A402B713E2EF85D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DiaDev_0-1748839248683.png" alt="DiaDev_0-1748839248683.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DiaDev_1-1748839277634.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/340828i4633E2742181A57D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DiaDev_1-1748839277634.png" alt="DiaDev_1-1748839277634.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jun 2025 04:41:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K3-LPSPI-Master-Slave/m-p/2108407#M49458</guid>
      <dc:creator>DiaDev</dc:creator>
      <dc:date>2025-06-02T04:41:33Z</dc:date>
    </item>
    <item>
      <title>Re: [S32K3] LPSPI Master+Slave</title>
      <link>https://community.nxp.com/t5/S32K/S32K3-LPSPI-Master-Slave/m-p/2108793#M49488</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/248971"&gt;@DiaDev&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Based on the schematic, here is how I understand the connections:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="25px" class="lia-align-center"&gt;Signal&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px" class="lia-align-center"&gt;Slave (LPSPI1)&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px" class="lia-align-center"&gt;Master (LPSPI2)&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="24px" class="lia-align-center"&gt;PCS0&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;PTA21 (input)&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="24px"&gt;PTB25 (output)&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="25px" class="lia-align-center"&gt;SCK&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;PTA28 (input)&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;PTB29 (output)&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="25px" class="lia-align-center"&gt;MOSI&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;PTA26 (input)&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;PTB28 (default: input)&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="33.333333333333336%" height="25px" class="lia-align-center"&gt;MISO&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;PTA30 (output)&lt;/TD&gt;
&lt;TD width="33.333333333333336%" height="25px"&gt;PTB27 (default: output)&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;As we can see, the pin setup on the master side does not match the default SPI configuration. That is why, as previously mentioned, you will need to modify the LPSPI-&amp;gt;CFGR1[PINCFG]register.&lt;/P&gt;
&lt;P&gt;You have two options:&lt;/P&gt;
&lt;P&gt;1. Update the PINCFG register to change the default direction of PTB28 and PTB27, so PTB28 becomes an output (MOSI) and PTB27 becomes an input (MISO), matching your intended configuration.&lt;/P&gt;
&lt;P&gt;2. Swap the signal roles so that PTB28 is used as the master input (MISO) and PTB27 as the master output (MOSI). This way, you can keeo the default configuration and avoid changing the PINCFG register.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jun 2025 17:10:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K3-LPSPI-Master-Slave/m-p/2108793#M49488</guid>
      <dc:creator>VaneB</dc:creator>
      <dc:date>2025-06-02T17:10:59Z</dc:date>
    </item>
    <item>
      <title>Re: [S32K3] LPSPI Master+Slave</title>
      <link>https://community.nxp.com/t5/S32K/S32K3-LPSPI-Master-Slave/m-p/2114129#M49774</link>
      <description>&lt;P&gt;I see a variable named "PortPinMscr". Where can I find the number corresponding to LPSPI? Is there any documentation for this?&lt;/P&gt;&lt;P&gt;Also, is it necessary to configure the port (using the Port module) for LPSPI communication? Is port configuration required for the LPSPI master and slave to communicate properly?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DiaDev_0-1749617677021.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/342367iA066458AAB1FD9E5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DiaDev_0-1749617677021.png" alt="DiaDev_0-1749617677021.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jun 2025 04:54:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K3-LPSPI-Master-Slave/m-p/2114129#M49774</guid>
      <dc:creator>DiaDev</dc:creator>
      <dc:date>2025-06-11T04:54:43Z</dc:date>
    </item>
    <item>
      <title>Re: [S32K3] LPSPI Master+Slave</title>
      <link>https://community.nxp.com/t5/S32K/S32K3-LPSPI-Master-Slave/m-p/2114643#M49812</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/248971"&gt;@DiaDev&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The "&lt;EM&gt;&lt;STRONG&gt;PortPin MSCR&lt;/STRONG&gt;&lt;/EM&gt;" is a numeric value representing the Multiplexed Signal Configuration Register. It can be calculated using the following formula:&lt;/P&gt;
&lt;P&gt;PortPinMscr = PinId + (PortId × 32)&lt;/P&gt;
&lt;P&gt;Where:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;PortId is the numeric identifier of the port (e.g., PortA = 0, PortB = 1, PortC = 2, etc.).&lt;/LI&gt;
&lt;LI&gt;PinId is the index of the selected pin within the port.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;For example, for PTB0, the calculation would be:&lt;/P&gt;
&lt;P&gt;PortPinMscr = 0 + (1 × 32) = 32&lt;/P&gt;
&lt;P&gt;Additionally, if you place the cursor over the "Routed pin/signal" column in the Pins Tool, this value will be displayed along with other relevant information. Please refer to the image below for a visual reference.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="VaneB_0-1749662771076.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/342502i41011A652D97BCA4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="VaneB_0-1749662771076.png" alt="VaneB_0-1749662771076.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Lastly, yes, it is necessary to add and configure all the used pins in the Port Driver to ensure proper peripheral functionality. This driver is responsible for initializing the entire PORT structure of the microcontroller.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jun 2025 17:26:37 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K3-LPSPI-Master-Slave/m-p/2114643#M49812</guid>
      <dc:creator>VaneB</dc:creator>
      <dc:date>2025-06-11T17:26:37Z</dc:date>
    </item>
  </channel>
</rss>

