<?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: Code no longer works while debugging after enabling half-duplex SPI peripheral communication. in i.MX RT Crossover MCUs</title>
    <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Code-no-longer-works-while-debugging-after-enabling-half-duplex/m-p/1626614#M24401</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/209820"&gt;@CWRB&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Your test need the SPI slave to do the communication, and reproduce the issues, right?&lt;/P&gt;
&lt;P&gt;&amp;nbsp; If just one EVK with your code, still can't reproduce the issues, right?&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;I have a question, whether it is just related to the debugger, I mean, the debugger lost, if you download the code to the board run without the debugger, whether the code function still works?&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;From your function, when the PWM interrupt happens, then you read the LPSPI data, right? If the PWM interrupt frequency is not changed, just the PWM frequency changed, then the debugger lost issue happens? If don't connect the ADC module to the LPSPI, just RT1160-EVK running, whether can reproduce the issues or not? If fact, just don't care the adc data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;You also can record one .mp4 to me check the issues.&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Kerry&lt;/P&gt;</description>
    <pubDate>Mon, 03 Apr 2023 06:42:35 GMT</pubDate>
    <dc:creator>kerryzhou</dc:creator>
    <dc:date>2023-04-03T06:42:35Z</dc:date>
    <item>
      <title>Code no longer works while debugging after enabling half-duplex SPI peripheral communication.</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Code-no-longer-works-while-debugging-after-enabling-half-duplex/m-p/1619977#M24220</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I am currently working on a project on the i.MXRT1160 and have encountered an issue. Ever since I added an ADC using a half-duplex 4-bit LPSPI connection, the code does not run properly anymore while debugging. The code still works when I flash the device without debugging and the ADC readings seem to be correct. When I start debugging the code breaks and the message in the image below is displayed:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CWRB_0-1679497207627.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/215797i67AE20FF53BB76A2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="CWRB_0-1679497207627.png" alt="CWRB_0-1679497207627.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Debugging works again when I disable the half-duplex LPSPI connection, so that seems to be the cause of the problem. Does anyone have an idea what could be going on? The code below shows the configuration of the LPSPI module:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;const lpspi_master_config_t LPSPI1_config = {&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;.baudRate = LPSPI_ADC1_BAUDRATE,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;.bitsPerFrame = 56UL,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;.cpol = kLPSPI_ClockPolarityActiveLow,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;.cpha = kLPSPI_ClockPhaseSecondEdge,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;.direction = kLPSPI_MsbFirst,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;.pcsToSckDelayInNanoSec = 50UL,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;.lastSckToPcsDelayInNanoSec = 0UL,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;.betweenTransferDelayInNanoSec = 0UL,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;.whichPcs = kLPSPI_Pcs0,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;.pcsActiveHighOrLow = kLPSPI_PcsActiveLow,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;.pinCfg = kLPSPI_SdiInSdoOut,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;.dataOutConfig = kLpspiDataOutTristate,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;.width_config = kLPSPI_Width4,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;.pcs_config = kLPSPI_PCS_4BitsTransfer&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;};&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;static void LPSPI1_init(void)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;{&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;lpspi_which_pcs_t whichPcs;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;uint8_t txWatermark;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;uint8_t rxWatermark;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;uint8_t masterFifoSize;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;LPSPI_MasterInit(LPSPI1, &amp;amp;LPSPI1_config, BOARD_BOOTCLOCKRUN_LPSPI1_CLK_ROOT);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;whichPcs = LPSPI_MASTER_PCS_FOR_INIT;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;/* The TX and RX FIFO sizes are always the same. */&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;masterFifoSize = LPSPI_GetRxFifoSize(LPSPI1);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;if (masterFifoSize &amp;gt; 1)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;{&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;txWatermark = 1;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;rxWatermark = 0;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;{&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;txWatermark = 0;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;rxWatermark = 0;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;LPSPI_SetFifoWatermarks(LPSPI1, txWatermark, rxWatermark);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;LPSPI_Enable(LPSPI1, false);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;LPSPI1-&amp;gt;CFGR1 &amp;amp;= (~LPSPI_CFGR1_NOSTALL_MASK);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;/* Flush FIFO , clear status , disable all the inerrupts. */&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;LPSPI_FlushFifo(LPSPI1, true, true);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;LPSPI_ClearStatusFlags(LPSPI1, kLPSPI_AllStatusFlag);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;LPSPI_DisableInterrupts(LPSPI1, kLPSPI_AllInterruptEnable);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;LPSPI_SelectTransferPCS(LPSPI1, whichPcs);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;LPSPI_Enable(LPSPI1, true);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;I would really like to be able to debug my code with the ADC module activated. Any help is appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2023 15:53:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Code-no-longer-works-while-debugging-after-enabling-half-duplex/m-p/1619977#M24220</guid>
      <dc:creator>CWRB</dc:creator>
      <dc:date>2023-03-22T15:53:27Z</dc:date>
    </item>
    <item>
      <title>Re: Code no longer works while debugging after enabling half-duplex SPI peripheral communication.</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Code-no-longer-works-while-debugging-after-enabling-half-duplex/m-p/1621482#M24253</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;I did some further investigation into the issue, and it seems to arise when I set the CFGR1-&amp;gt;PCSCFG register of the LPSPI1 module to 0x1, as is required to operate in half-duplex mode. The moment I enable the LPSPI1 module with the CFGR1-&amp;gt;PCSCFG register set, the issue arises and the code stops working during debugging. When the&amp;nbsp;CFGR1-&amp;gt;PCSCFG register is not set, debugging works as normal, but the ADC readings are incorrect, as the half-duplex communication does not work as it should.&lt;/P&gt;&lt;P&gt;I write to the&amp;nbsp;CFGR1-&amp;gt;PCSCFG register while the LPSPI1 module is disabled, as instructed in the reference manual.&lt;/P&gt;&lt;P&gt;I have not yet found a solution to the issue, so any help is welcome.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Mar 2023 07:37:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Code-no-longer-works-while-debugging-after-enabling-half-duplex/m-p/1621482#M24253</guid>
      <dc:creator>CWRB</dc:creator>
      <dc:date>2023-03-24T07:37:50Z</dc:date>
    </item>
    <item>
      <title>Re: Code no longer works while debugging after enabling half-duplex SPI peripheral communication.</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Code-no-longer-works-while-debugging-after-enabling-half-duplex/m-p/1622942#M24286</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/209820"&gt;@CWRB&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;Thanks for your interest in the NXP MIMXRT product, I would like to provide service for you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;Please tell me which detail SPI pin you are using now?&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;What's the RT1160 board you are using? MIMXRT1160-EVK board?&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;What's the debugger and IDE you are using?&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;Please tell me more details, then I will help you to check it on my side.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;If you are using the MCUXpresso IDE, before you debug the code, please close the register read window in the debug mode, and try it again.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;As, if you read the related register, but the LPSPI module still didn't power on clock, it will meet the debug issues, after you run over the LPSPI module clock enable and initialization code, then open the LPSPI register read window again, that should works.&lt;/P&gt;
&lt;P&gt;Wish it helps you！&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Kerry&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2023 02:34:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Code-no-longer-works-while-debugging-after-enabling-half-duplex/m-p/1622942#M24286</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2023-03-28T02:34:19Z</dc:date>
    </item>
    <item>
      <title>Re: Code no longer works while debugging after enabling half-duplex SPI peripheral communication.</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Code-no-longer-works-while-debugging-after-enabling-half-duplex/m-p/1623161#M24291</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/60336"&gt;@kerryzhou&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Thank you for your response. I have tried all your suggestions but did not have any luck yet.&lt;/P&gt;&lt;P&gt;I am using the&amp;nbsp;&lt;SPAN&gt;RT1160 on a custom board. On the board, I have got the LPSPI2, LPSPI4, and LPSPI5 modules working without any issues during debugging. All these modules use conventional SPI communication, so not half-duplex.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am using the MCU-Link debug probe with the MCUXpresso IDE.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The pin configuration of the LPSPI1 module is shown in the image below.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="CWRB_0-1679992181714.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/216555iA097E5B4141674D9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="CWRB_0-1679992181714.png" alt="CWRB_0-1679992181714.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks again for taking a look.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Mar 2023 08:33:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Code-no-longer-works-while-debugging-after-enabling-half-duplex/m-p/1623161#M24291</guid>
      <dc:creator>CWRB</dc:creator>
      <dc:date>2023-03-28T08:33:39Z</dc:date>
    </item>
    <item>
      <title>Re: Code no longer works while debugging after enabling half-duplex SPI peripheral communication.</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Code-no-longer-works-while-debugging-after-enabling-half-duplex/m-p/1624004#M24331</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/209820"&gt;@CWRB&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Do you have the MIMXRT1160-EVK board, whether it also can be reproduced or not?&lt;/P&gt;
&lt;P&gt;&amp;nbsp; If yes, you can send me your simplified code which can reproduce the issues on the MIMXRT1160-EVK, then I can help you do the testing in details.&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Kerry&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2023 08:31:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Code-no-longer-works-while-debugging-after-enabling-half-duplex/m-p/1624004#M24331</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2023-03-29T08:31:24Z</dc:date>
    </item>
    <item>
      <title>Re: Code no longer works while debugging after enabling half-duplex SPI peripheral communication.</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Code-no-longer-works-while-debugging-after-enabling-half-duplex/m-p/1624074#M24334</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/60336"&gt;@kerryzhou&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I have tried to run the code on the&amp;nbsp;&lt;SPAN&gt;MIMXRT1160-EVK board and the debugging issue does not occur. I am not able to connect the peripheral that makes use of the half-duplex SPI communication to the EVK board though, so I cannot really confirm if the LPSPI module works as intended.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Below is a simplified version of the code that triggers the issue.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;void PWM3_0_IRQHandler(void)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;{&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;uint32_t raw0, raw1;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;raw0 = LPSPI_ReadData(LPSPI1);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;raw1 = LPSPI_ReadData(LPSPI1);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;LPSPI_FlushFifo(LPSPI1, true, true);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;LPSPI_ClearStatusFlags(LPSPI1, kLPSPI_AllStatusFlag);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;LPSPI1-&amp;gt;TCR = (LPSPI1-&amp;gt;TCR &amp;amp; ~LPSPI_TCR_RXMSK_MASK) | LPSPI_TCR_TXMSK_MASK;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;PWM_ClearStatusFlags(PWM3, kPWM_Module_0, PWM_STS_CMPF_MASK);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;SDK_ISR_EXIT_BARRIER;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;The PWM3_0_IRQHandler is activated at a frequency of 360 kHz in my code. I have tried reducing the frequency to as low as 2 kHz, to see if that would resolve the issue but&amp;nbsp;without success. The issue disappears when I do not set the TCR&amp;gt;TXMSK register, but doing so is required to get the half-duplex communication working. &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Is there anything in my code that could trigger the debugging issue?&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Thanks again for your time.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Mar 2023 09:25:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Code-no-longer-works-while-debugging-after-enabling-half-duplex/m-p/1624074#M24334</guid>
      <dc:creator>CWRB</dc:creator>
      <dc:date>2023-03-29T09:25:42Z</dc:date>
    </item>
    <item>
      <title>Re: Code no longer works while debugging after enabling half-duplex SPI peripheral communication.</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Code-no-longer-works-while-debugging-after-enabling-half-duplex/m-p/1624825#M24347</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/209820"&gt;@CWRB&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; In fact, just the &lt;SPAN&gt;TCR&amp;gt;TXMSK, no directly relationship with the debugger.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;Maybe, it is related to your code, meet some issues, and caused the reset or others.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;Do you check the debugger log? the code running situation, from where to where?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;You also can try disable cache, whether it still meets issues?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Kerry&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Mar 2023 02:45:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Code-no-longer-works-while-debugging-after-enabling-half-duplex/m-p/1624825#M24347</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2023-03-30T02:45:57Z</dc:date>
    </item>
    <item>
      <title>Re: Code no longer works while debugging after enabling half-duplex SPI peripheral communication.</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Code-no-longer-works-while-debugging-after-enabling-half-duplex/m-p/1626049#M24382</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/60336"&gt;@kerryzhou&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Thank you for your response. I have tried disabling the debug memory cache, but the issues remain. Below is the debug log I got. I put a breakpoint in the PWM interrupt handler and continued the code until it crashed.&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;Program stopped.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;PWM3_0_IRQHandler () at ../source/mcmgr_core0.c:485&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;485 GPIO_PinWrite(GPIO7, 8U, 1);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;Temporary breakpoint 2, main () at ../source/mcmgr_core0.c:189&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;189 {&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;Breakpoint 1, PWM3_0_IRQHandler () at ../source/mcmgr_core0.c:485&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;485 GPIO_PinWrite(GPIO7, 8U, 1);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;Breakpoint 1, PWM3_0_IRQHandler () at ../source/mcmgr_core0.c:485&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;485 GPIO_PinWrite(GPIO7, 8U, 1);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;Breakpoint 1, PWM3_0_IRQHandler () at ../source/mcmgr_core0.c:485&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;485 GPIO_PinWrite(GPIO7, 8U, 1);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;Breakpoint 1, PWM3_0_IRQHandler () at ../source/mcmgr_core0.c:485&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;485 GPIO_PinWrite(GPIO7, 8U, 1);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;Breakpoint 1, PWM3_0_IRQHandler () at ../source/mcmgr_core0.c:485&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;485 GPIO_PinWrite(GPIO7, 8U, 1);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;Breakpoint 1, PWM3_0_IRQHandler () at ../source/mcmgr_core0.c:485&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;485 GPIO_PinWrite(GPIO7, 8U, 1);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;/mnt/workspace/workspace/GCC-10-pipeline/jenkins-GCC-10-pipeline-338_20211018_1634516203/src/gdb/gdb/utils.c:671: internal-error: virtual memory exhausted: can't allocate 4064 bytes.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;A problem internal to GDB has been detected,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;further debugging may prove unreliable.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;Quit this debugging session? (y or n) [answered Y; input not from terminal]&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;This is a bug, please report it. For instructions, see:&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;&amp;lt;&lt;A href="https://www.gnu.org/software/gdb/bugs/" target="_blank"&gt;https://www.gnu.org/software/gdb/bugs/&lt;/A&gt;&amp;gt;.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier" size="2"&gt;/mnt/workspace/workspace/GCC-10-pipeline/jenkins-GCC-10-pipeline-338_20211018_1634516203/src/gdb/gdb/utils.c:671: internal-error: virtual memory exhausted: can't allocate 4064 bytes.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;A problem internal to GDB has been detected,&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;further debugging may prove unreliable.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;Create a core file of GDB? (y or n) [answered Y; input not from terminal]&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;As you can see, the PWM interrupt handler ran a couple of times before it crashed. The number of times the interrupt handler runs before crashing is different each time. I find the "virtual memory exhausted" error interesting. Could that be the cause of the problem?&amp;nbsp;&lt;/P&gt;&lt;P&gt;To further investigate the issue, I created a new multicore project and implemented the half-duplex communication on its own, to see if I would run into the same problem. The same problem indeed occurred. I found that the debugging issue was fixed when I lowered the baud rate of the LPSPI module from 16MHz to 10MHz, but doing the same thing in my original project did not help. Could the issue be caused by too much data being read and the debugger not being able to keep up?&lt;/P&gt;&lt;P&gt;I have attached the test project. Perhaps you see the issue? I have had to make some small modifications to the fsl_lpspi.c file to get the half-duplex communication to work. Perhaps I made a mistake somewhere? The project was too large to send as a single zip file, so I split it up into three.&lt;/P&gt;&lt;P&gt;Thank you for your help,&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/209820"&gt;@CWRB&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Mar 2023 11:40:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Code-no-longer-works-while-debugging-after-enabling-half-duplex/m-p/1626049#M24382</guid>
      <dc:creator>CWRB</dc:creator>
      <dc:date>2023-03-31T11:40:40Z</dc:date>
    </item>
    <item>
      <title>Re: Code no longer works while debugging after enabling half-duplex SPI peripheral communication.</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Code-no-longer-works-while-debugging-after-enabling-half-duplex/m-p/1626614#M24401</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/209820"&gt;@CWRB&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Your test need the SPI slave to do the communication, and reproduce the issues, right?&lt;/P&gt;
&lt;P&gt;&amp;nbsp; If just one EVK with your code, still can't reproduce the issues, right?&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;I have a question, whether it is just related to the debugger, I mean, the debugger lost, if you download the code to the board run without the debugger, whether the code function still works?&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;From your function, when the PWM interrupt happens, then you read the LPSPI data, right? If the PWM interrupt frequency is not changed, just the PWM frequency changed, then the debugger lost issue happens? If don't connect the ADC module to the LPSPI, just RT1160-EVK running, whether can reproduce the issues or not? If fact, just don't care the adc data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;You also can record one .mp4 to me check the issues.&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Kerry&lt;/P&gt;</description>
      <pubDate>Mon, 03 Apr 2023 06:42:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Code-no-longer-works-while-debugging-after-enabling-half-duplex/m-p/1626614#M24401</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2023-04-03T06:42:35Z</dc:date>
    </item>
    <item>
      <title>Re: Code no longer works while debugging after enabling half-duplex SPI peripheral communication.</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Code-no-longer-works-while-debugging-after-enabling-half-duplex/m-p/1628275#M24448</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/60336"&gt;@kerryzhou&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;You are right, the issue only seems to occur when an SPI slave is connected. I think that is the reason why it works on the EVK without issues.&lt;/P&gt;&lt;P&gt;The code runs when I download the code to the board and run it without the debugger. It only does not work when I try to debug from the MCUXpresso IDE.&lt;/P&gt;&lt;P&gt;I tried changing the PWM frequency, but that did not solve the issue.&lt;/P&gt;&lt;P&gt;I have not been able to recreate the issue on the EVK, as I am not able to connect the ADC to the EVK. Without the ADC connected, the issue does not occur.&lt;/P&gt;&lt;P&gt;I attached two short videos. The orange LEDs on the PCB indicate that the PWM interrupt is active and the ADC is being read out. When debugging the LEDs light up briefly, but turn off shortly after and the code stops running. Wh&lt;SPAN&gt;en running the code without the debugger,&amp;nbsp;&lt;/SPAN&gt;they light up and remain lit, meaning the code is running.&lt;/P&gt;&lt;P&gt;Note: The error windows in the video with the debugger connected popped up after I tried pausing the debug session.&lt;/P&gt;&lt;P&gt;I hope the videos make the issue more clear.&lt;/P&gt;&lt;P&gt;Thank you for your help,&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/209820"&gt;@CWRB&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Apr 2023 13:23:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Code-no-longer-works-while-debugging-after-enabling-half-duplex/m-p/1628275#M24448</guid>
      <dc:creator>CWRB</dc:creator>
      <dc:date>2023-04-05T13:23:15Z</dc:date>
    </item>
    <item>
      <title>Re: Code no longer works while debugging after enabling half-duplex SPI peripheral communication.</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Code-no-longer-works-while-debugging-after-enabling-half-duplex/m-p/1629684#M24487</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/209820"&gt;@CWRB&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;Thanks for your updated information.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; I think this is good:&amp;nbsp;&lt;SPAN&gt;The code runs when I download the code to the board and run it without the debugger.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;At least, your project can move forward.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Could you help to test this situation: don't use the PWM interrupt, just write a simple code add the LPSPI, then whether it reproduce the issues or not?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I mean, this code:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;uint32_t raw0, raw1;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;raw0 = LPSPI_ReadData(LPSPI1);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;raw1 = LPSPI_ReadData(LPSPI1);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;LPSPI_FlushFifo(LPSPI1, true, true);&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;LPSPI_ClearStatusFlags(LPSPI1, kLPSPI_AllStatusFlag);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;LPSPI1-&amp;gt;TCR = (LPSPI1-&amp;gt;TCR &amp;amp; ~LPSPI_TCR_RXMSK_MASK) | LPSPI_TCR_TXMSK_MASK;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;PWM_ClearStatusFlags(PWM3, kPWM_Module_0, PWM_STS_CMPF_MASK);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Just write a API to call it, and in the main while, don't use PWM, whether debug works when you call &lt;SPAN&gt;TCR&amp;gt;TXMSK?&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Best Regards,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;Kerry&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Apr 2023 09:29:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Code-no-longer-works-while-debugging-after-enabling-half-duplex/m-p/1629684#M24487</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2023-04-07T09:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: Code no longer works while debugging after enabling half-duplex SPI peripheral communication.</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Code-no-longer-works-while-debugging-after-enabling-half-duplex/m-p/1633201#M24572</link>
      <description>&lt;P&gt;Hi Kerry,&lt;/P&gt;&lt;P&gt;I have tried to run the code outside of the PWM interrupt in a new project and the problem indeed does not occur. When I put the code back into the PWM interrupt, the issue recurs.&lt;/P&gt;&lt;P&gt;Weirdly, in my actual project, moving the code outside the PWM interrupt does not solve the issue. I tried disabling all other interrupts as well, but without any success.&lt;/P&gt;&lt;P&gt;When trying some stuff in my test project, I found that the connection between the SPI module and MCU influences the issue. When I connect the module directly to the MCU by connecting their respective PCBs, the SPI communication works for high baud rates (16MHz) during debugging. When I use an adapter board (to more easily measure the signals with an oscilloscope) the SPI communication only works for lower baud rates (&amp;lt;10MHz). For higher baud rates the debugging issue returns. High baud rates can be used while using the adapter board when running the code without debugging.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Perhaps some timing issues occur when debugging while using the SPI communication? Or perhaps there is some interference between the debug signals and the SPI signals? Do you have any Idea?&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/209820"&gt;@CWRB&lt;/a&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Apr 2023 13:40:09 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Code-no-longer-works-while-debugging-after-enabling-half-duplex/m-p/1633201#M24572</guid>
      <dc:creator>CWRB</dc:creator>
      <dc:date>2023-04-13T13:40:09Z</dc:date>
    </item>
    <item>
      <title>Re: Code no longer works while debugging after enabling half-duplex SPI peripheral communication.</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Code-no-longer-works-while-debugging-after-enabling-half-duplex/m-p/1633808#M24608</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/209820"&gt;@CWRB&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; So, seems still related to your project, not just the SPI.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Do you also try to comment the PWM interrupt in your project, whether that works or not?&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;kerry&lt;/P&gt;</description>
      <pubDate>Fri, 14 Apr 2023 10:05:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Code-no-longer-works-while-debugging-after-enabling-half-duplex/m-p/1633808#M24608</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2023-04-14T10:05:23Z</dc:date>
    </item>
    <item>
      <title>Re: Code no longer works while debugging after enabling half-duplex SPI peripheral communication.</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Code-no-longer-works-while-debugging-after-enabling-half-duplex/m-p/1638978#M24778</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/60336"&gt;@kerryzhou&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Yes, I have also tried disabling the PWM interrupt by commenting it out. It sadly did not solve the issue.&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/209820"&gt;@CWRB&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2023 13:06:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Code-no-longer-works-while-debugging-after-enabling-half-duplex/m-p/1638978#M24778</guid>
      <dc:creator>CWRB</dc:creator>
      <dc:date>2023-04-24T13:06:39Z</dc:date>
    </item>
    <item>
      <title>Re: Code no longer works while debugging after enabling half-duplex SPI peripheral communication.</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Code-no-longer-works-while-debugging-after-enabling-half-duplex/m-p/1639651#M24792</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/209820"&gt;@CWRB&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;You mentioned:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;I have tried to run the code outside of the PWM interrupt in a new project and the problem indeed does not occur. When I put the code back into the PWM interrupt, the issue recurs.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;Weirdly, in my actual project, moving the code outside the PWM interrupt does not solve the issue.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;So, seems related to your project, can you try to test it on the NXP EVK, whether it can be reproduced or not? I mean, you can simplify it, or test your project directly, whether that can reproduce or not?&lt;/P&gt;
&lt;P&gt;Another method, your own project, copy it, then comment API in the main one by one, just to check, which detail code may influence it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Kerry&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2023 09:30:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/Code-no-longer-works-while-debugging-after-enabling-half-duplex/m-p/1639651#M24792</guid>
      <dc:creator>kerryzhou</dc:creator>
      <dc:date>2023-04-25T09:30:31Z</dc:date>
    </item>
  </channel>
</rss>

