<?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>S32KのトピックS32K144 LPSPI Rx FIFO issue</title>
    <link>https://community.nxp.com/t5/S32K/S32K144-LPSPI-Rx-FIFO-issue/m-p/963591#M5409</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Sir.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I design a BMS with S32K144 and MC33664,&lt;/P&gt;&lt;P&gt;so I should open LPSPI0 (Master)and LPSPI1 (Slave),&lt;/P&gt;&lt;P&gt;TPL communication once 5 bytes,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after transmit 40-bit data, LPSPI1 using "&lt;SPAN&gt;while((LPSPI1-&amp;gt;SR &amp;amp; LPSPI_SR_RDF_MASK)&amp;gt;&amp;gt;LPSPI_SR_RDF_SHIFT==0);"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;but in the debug mode , MCU will stop on here. i have no ideal for this.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;and how to read the Rx FIFO, if over 1 word.i just read the last 32bits&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;u32 SPIRxReadBytes(u8 *u8Data, u8 maxBytes)&lt;BR /&gt;{&lt;BR /&gt; u32 u8BytesRead;&lt;BR /&gt; u8BytesRead = 0;&lt;BR /&gt; u8Data = u8Data+maxBytes; // set pointer to end of buffer&lt;BR /&gt; while((LPSPI1-&amp;gt;SR &amp;amp; LPSPI_SR_RDF_MASK)&amp;gt;&amp;gt;LPSPI_SR_RDF_SHIFT==0);&lt;BR /&gt; /* Wait at least one RxFIFO entry */&lt;BR /&gt;u8BytesRead= LPSPI1-&amp;gt;RDR; /* Read received data */&lt;BR /&gt; LPSPI1-&amp;gt;SR |= LPSPI_SR_RDF_MASK; /* Clear RDF flag */&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; return u8BytesRead; /* Return received data */&lt;BR /&gt; }&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 23 Aug 2019 08:10:35 GMT</pubDate>
    <dc:creator>kentseng</dc:creator>
    <dc:date>2019-08-23T08:10:35Z</dc:date>
    <item>
      <title>S32K144 LPSPI Rx FIFO issue</title>
      <link>https://community.nxp.com/t5/S32K/S32K144-LPSPI-Rx-FIFO-issue/m-p/963591#M5409</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Sir.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I design a BMS with S32K144 and MC33664,&lt;/P&gt;&lt;P&gt;so I should open LPSPI0 (Master)and LPSPI1 (Slave),&lt;/P&gt;&lt;P&gt;TPL communication once 5 bytes,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after transmit 40-bit data, LPSPI1 using "&lt;SPAN&gt;while((LPSPI1-&amp;gt;SR &amp;amp; LPSPI_SR_RDF_MASK)&amp;gt;&amp;gt;LPSPI_SR_RDF_SHIFT==0);"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;but in the debug mode , MCU will stop on here. i have no ideal for this.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;and how to read the Rx FIFO, if over 1 word.i just read the last 32bits&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;u32 SPIRxReadBytes(u8 *u8Data, u8 maxBytes)&lt;BR /&gt;{&lt;BR /&gt; u32 u8BytesRead;&lt;BR /&gt; u8BytesRead = 0;&lt;BR /&gt; u8Data = u8Data+maxBytes; // set pointer to end of buffer&lt;BR /&gt; while((LPSPI1-&amp;gt;SR &amp;amp; LPSPI_SR_RDF_MASK)&amp;gt;&amp;gt;LPSPI_SR_RDF_SHIFT==0);&lt;BR /&gt; /* Wait at least one RxFIFO entry */&lt;BR /&gt;u8BytesRead= LPSPI1-&amp;gt;RDR; /* Read received data */&lt;BR /&gt; LPSPI1-&amp;gt;SR |= LPSPI_SR_RDF_MASK; /* Clear RDF flag */&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; return u8BytesRead; /* Return received data */&lt;BR /&gt; }&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Aug 2019 08:10:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K144-LPSPI-Rx-FIFO-issue/m-p/963591#M5409</guid>
      <dc:creator>kentseng</dc:creator>
      <dc:date>2019-08-23T08:10:35Z</dc:date>
    </item>
    <item>
      <title>Re: S32K144 LPSPI Rx FIFO issue</title>
      <link>https://community.nxp.com/t5/S32K/S32K144-LPSPI-Rx-FIFO-issue/m-p/963592#M5410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello&amp;nbsp;&lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/kentseng"&gt;kentseng&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;I have difficulties to understand the issue.&lt;/P&gt;&lt;P&gt;Do you read the RX FIFO of the master? The FSR register provides the number of&amp;nbsp;words stored in the RX FIFO.&lt;/P&gt;&lt;P&gt;The master stall the operation when the receive FIFO&amp;nbsp;is full unless&amp;nbsp;CFGR1_NOSTALL is set.&lt;/P&gt;&lt;P&gt;Do you see any errors in the LPSPI_SR register?&lt;/P&gt;&lt;P&gt;Could you please attach a test project?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;&lt;P&gt;BR, Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Aug 2019 07:38:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K144-LPSPI-Rx-FIFO-issue/m-p/963592#M5410</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2019-08-27T07:38:40Z</dc:date>
    </item>
  </channel>
</rss>

