<?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: Can't use transfer protocol while in an interrupt function in S32K</title>
    <link>https://community.nxp.com/t5/S32K/Can-t-use-transfer-protocol-while-in-an-interrupt-function/m-p/1941774#M40199</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;try to increase interrupt priority for LPSPI.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR, Petr&lt;/P&gt;</description>
    <pubDate>Wed, 28 Aug 2024 05:34:29 GMT</pubDate>
    <dc:creator>PetrS</dc:creator>
    <dc:date>2024-08-28T05:34:29Z</dc:date>
    <item>
      <title>Can't use transfer protocol while in an interrupt function</title>
      <link>https://community.nxp.com/t5/S32K/Can-t-use-transfer-protocol-while-in-an-interrupt-function/m-p/1941045#M40157</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I'm using a LPIT timer to trigger the reading and writing of data to my ICs through SPI &amp;amp; I2C. Before, that was done in an infinite loop in the main function but as soon as I paste it in the LPIT trigger function I am always reading STATUS_BUSY with the&amp;nbsp;LPSPI_DRV_MasterGetTransferStatus() function. Did you had this problem before ?&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;void LPIT0_Ch1_ISR(void){
	LPIT_DRV_ClearInterruptFlagTimerChannels(INST_LPIT0, 1&amp;lt;&amp;lt;LPIT0_CHANNEL1);
	uint8_t spi_data_receive[2];
	hall_singleRead(LPSPICOM0, (uint8_t *)(&amp;amp;UART_command_param.sys_param.spi_read_address), (uint8_t *)(&amp;amp;spi_data_receive), 2);
	MAX5215_setOutput(INST_LPI2C0, &amp;amp;UART_command_param);
	ADC_readConversion(INST_LPI2C0, &amp;amp;UART_command_param);
	enableBuck(&amp;amp;UART_command_param);
	UART_command_param.sys_param.spi_read_value[0] = spi_data_receive[0];
	UART_command_param.sys_param.spi_read_value[1] = spi_data_receive[1];
}

void hall_singleRead(uint32_t instance, uint8_t * sendBuffer, uint8_t * receiveBuffer, uint16_t transferByteCount){
	LPSPI_DRV_MasterTransfer(instance, sendBuffer, NULL, transferByteCount);
	while(LPSPI_DRV_MasterGetTransferStatus(instance, NULL)==STATUS_BUSY){};
	LPSPI_DRV_MasterTransfer(instance, NULL, receiveBuffer, transferByteCount);
	while(LPSPI_DRV_MasterGetTransferStatus(instance, NULL)==STATUS_BUSY){};
}&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 27 Aug 2024 07:48:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Can-t-use-transfer-protocol-while-in-an-interrupt-function/m-p/1941045#M40157</guid>
      <dc:creator>LBLDT</dc:creator>
      <dc:date>2024-08-27T07:48:53Z</dc:date>
    </item>
    <item>
      <title>Re: Can't use transfer protocol while in an interrupt function</title>
      <link>https://community.nxp.com/t5/S32K/Can-t-use-transfer-protocol-while-in-an-interrupt-function/m-p/1941774#M40199</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;try to increase interrupt priority for LPSPI.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BR, Petr&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2024 05:34:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Can-t-use-transfer-protocol-while-in-an-interrupt-function/m-p/1941774#M40199</guid>
      <dc:creator>PetrS</dc:creator>
      <dc:date>2024-08-28T05:34:29Z</dc:date>
    </item>
  </channel>
</rss>

