<?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のトピックS32K144W problems with custom SPI driver</title>
    <link>https://community.nxp.com/t5/S32K/S32K144W-problems-with-custom-SPI-driver/m-p/1848518#M34284</link>
    <description>&lt;P&gt;Hi NXP community!&lt;/P&gt;&lt;P&gt;I'm developing a custom SPI driver based on the SPI example from the AN5423 application note (&lt;A href="https://www.nxp.com/docs/en/application-note/AN5413.pdf=" target="_blank"&gt;https://www.nxp.com/docs/en/application-note/AN5413.pdf)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The problem I'm facing is that after initializing, the SPI is only able to send around 23 bytes of data, no matter what I set as the frame size in the Transmit Command Register (TCR). After that, the clock remains in high state even though I set its polarity as SCK low. While debugging, I found that it gets stuck waiting for the TDF flag of the status register to be 0. Also, the TX fifo seams to be full, but I don't know why it is not sending this data.&lt;/P&gt;&lt;P&gt;Here is my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;static void* SPI_s_vSelectModule(uint8 u8SpiModule){

	void *pAddress = (void*)NULL;

	if(u8SpiModule == (uint8)SPI_enSPI0){

		pAddress = (void*)LPSPI0_BASE_ADDR_cfg;

	}
	else if(u8SpiModule == (uint8)SPI_enSPI2){

		pAddress = (void*)LPSPI2_BASE_ADDR_cfg;

	}
	else{
		/*	 Nothing to do	*/
	}

	return pAddress;
}


void SPI_s_vInitPorts(void){

	/*	Enable clocks	*/
	PCC-&amp;gt;PCCn[PCC_PORTB_INDEX]|=PCC_PCCn_CGC_MASK; /* Enable clock for PORTB */
	PCC-&amp;gt;PCCn[PCC_PORTC_INDEX]|=PCC_PCCn_CGC_MASK; /* Enable clock for PORTC */
	PCC-&amp;gt;PCCn[PCC_PORTD_INDEX]|=PCC_PCCn_CGC_MASK; /* Enable clock for PORTD */

	/*	Config. SPI0	*/
	PORTD-&amp;gt;PCR[15]|=PORT_PCR_MUX(4); /* Port D15: MUX = ALT4, LPSPI0_SCK reloj */
	PORTD-&amp;gt;PCR[16]|=PORT_PCR_MUX(4); /* Port D16: MUX = ALT4, LPSPI0_SIN/MISO */
	PORTB-&amp;gt;PCR[4]|=PORT_PCR_MUX(3); /* Port B4: MUX = ALT3, LPSPI0_SOUT/MOSI */
	PORTB-&amp;gt;PCR[5]|=PORT_PCR_MUX(4); /* Port B5: MUX = ALT4, LPSPI0_PCS0 */

	/*	Config. SPI2	*/
	PORTC-&amp;gt;PCR[15]|=PORT_PCR_MUX(3); /* Port C15: MUX = ALT3, LPSPI2_SCK reloj */
	PORTC-&amp;gt;PCR[0]|=PORT_PCR_MUX(3); /* Port C0: MUX = ALT3, LPSPI2_SIN/MISO */
	PORTC-&amp;gt;PCR[1]|=PORT_PCR_MUX(3); /* Port C1: MUX = ALT3, LPSPI2_SOUT/MOSI */
	PORTC-&amp;gt;PCR[14]|=PORT_PCR_MUX(3); /* Port C14: MUX = ALT3, LPSPI2_PCS0 */

}

void SPI_vInitMaster(void){

LPSPI_Type *pstSPI;

for(uint8 u8x = 0; u8x &amp;lt; SPI_enTotalSPIs; u8x++){

if(u8x == (uint8)SPI_enSPI0){
PCC-&amp;gt;PCCn[PCC_LPSPI0_INDEX] = 0; /* Disable clocks to modify PCS ( default) */
PCC-&amp;gt;PCCn[PCC_LPSPI0_INDEX] = 0xC6000000; /* Enable PCS=SPLL_DIV2 (40 MHz func'l clock) */
pstSPI = (LPSPI_Type*)SPI_s_vSelectModule(u8x);
}
else if(u8x == (uint8)SPI_enSPI2){
PCC-&amp;gt;PCCn[PCC_LPSPI2_INDEX] = 0; /* Disable clocks to modify PCS ( default) */
PCC-&amp;gt;PCCn[PCC_LPSPI2_INDEX] = 0xC6000000; /* Enable PCS=SPLL_DIV2 (40 MHz func'l clock) */
pstSPI = (LPSPI_Type*)SPI_s_vSelectModule(u8x);
}
else{
/* Nothing to do */
}

pstSPI-&amp;gt;CR = 0x00000000; /* Disable module for configuration */

pstSPI-&amp;gt;IER = 0x00000000; /* Interrupts not used */

pstSPI-&amp;gt;DER = 0x00000000; /* DMA not used */

pstSPI-&amp;gt;CFGR0 = 0x00000000; /* Defaults: */
/* RDM0=0: rec'd data to FIFO as normal */
/* CIRFIFO=0; Circular FIFO is disabled */
/* HRSEL, HRPOL, HREN=0: Host request disabled */

pstSPI-&amp;gt;CFGR1 = 0x00000001; /* Configurations: master mode*/
/* PCSCFG=0: PCS[3:2] are enabled */
/* OUTCFG=0: Output data retains last value when CS negated */
/* PINCFG=0: SIN is input, SOUT is output */
/* MATCFG=0: Match disabled */
/* PCSPOL=0: PCS is active low */
/* NOSTALL=0: Stall if Tx FIFO empty or Rx FIFO full */
/* AUTOPCS=0: does not apply for master mode */
/* SAMPLE=0: input data sampled on SCK edge */
/* MASTER=1: Master mode */

pstSPI-&amp;gt;TCR = 0x5000001F; /* Transmit cmd: PCS0, 32bits, prescale func'l clk by 4. */
//pstSPI-&amp;gt;TCR = 0x50000007; /* Transmit cmd: PCS0, 32bits, prescale func'l clk by 4. */
/* CPOL=0: SCK inactive state is low */
/* CPHA=1: Change data on SCK lead'g, capture on trail'g edge*/
/* PRESCALE=2: Functional clock divided by 2**2 = 4 */
/* PCS=0: Transfer using PCS0 */
/* LSBF=0: Data is transferred MSB first */
/*pstSPI-&amp;gt;TCR = 0x5080001F*/ /* LSBF=1: Data is transferred LSB first */
/* BYSW=0: Byte swap disabled */
/* CONT, CONTC=0: Continuous transfer disabled */
/* RXMSK=0: Normal transfer: rx data stored in rx FIFO */
/* TXMSK=0: Normal transfer: data loaded from tx FIFO */
/* WIDTH=0: Single bit transfer */
/* FRAMESZ=15: # bits in frame = 15+1=16 */

pstSPI-&amp;gt;CCR = 0x04090808; /* Clk dividers based on prescaled func'l clk of 100 nsec */
/* SCKPCS=4: SCK to PCS delay = 4+1 = 5 (500 nsec) */
/* PCSSCK=4: PCS to SCK delay = 9+1 = 10 (1 usec) */
/* DBT=8: Delay between Transfers = 8+2 = 10 (1 usec) */
/* SCKDIV=8: SCK divider =8+2 = 10 (1 usec: 1 MHz baud rate) */

pstSPI-&amp;gt;FCR = 0x00000003; /* RXWATER=0: Rx flags set when Rx FIFO &amp;gt;0 */
/* TXWATER=3: Tx flags set when Tx FIFO &amp;lt;= 3 */

pstSPI-&amp;gt;CR = 0x00000009; /* Enable module for operation */
/* DBGEN=1: module enabled in debug mode */
/* DOZEN=0: module enabled in Doze mode */
/* RST=0: Master logic not reset */
/* MEN=1: Module is enabled */
}

SPI_s_vInitPorts();
}

uint16 SPI_u8Transmit(uint8 u8SpiModule, uint8 *data, uint16 size)
{
	uint16 u16Return = (uint16)NOT_OK;
	LPSPI_Type *pstSPI;
	uint32 buffer=0;

	if(u8SpiModule &amp;lt; (uint8)SPI_enTotalSPIs){

		pstSPI = (LPSPI_Type*)SPI_s_vSelectModule(u8SpiModule);

		if(pstSPI != NULL){

			// Clean Tx buffer
			pstSPI-&amp;gt;CR |= 1 &amp;lt;&amp;lt; LPSPI_CR_RTF_SHIFT;

			// Configure the FRAMESZ based on the input size
			pstSPI-&amp;gt;TCR =  0x50000000 | (size*8 - 1);

			//vSpiDelayMs(5);

			// Send all 32-bit frames that we can handle
			for(int i=0; i&amp;lt;(size / 4); i++)
			{
				buffer = data[4*i + 0] &amp;lt;&amp;lt; 24;
				buffer |= data[4*i + 1] &amp;lt;&amp;lt; 16;
				buffer |= data[4*i + 2] &amp;lt;&amp;lt; 8;
				buffer |= data[4*i + 3];
				/*	Espera al que este libre	*/
				while((pstSPI-&amp;gt;SR &amp;amp; LPSPI_SR_TDF_MASK)&amp;gt;&amp;gt;LPSPI_SR_TDF_SHIFT == 0);
				/* Transmit data */
				pstSPI-&amp;gt;TDR = buffer;
				/* Se limpia la bandera TDF */
				pstSPI-&amp;gt;SR |= LPSPI_SR_TDF_MASK;
			}

			// send remaining bytes
			if(size%4 &amp;gt; 0)
			{
				buffer = 0;
				// Send the remaining data
				for(int i=(size%4); i&amp;gt;0; i--)
				{
					buffer |= data[size - i] &amp;lt;&amp;lt; (8*(i-1));
				}
				while((pstSPI-&amp;gt;SR &amp;amp; LPSPI_SR_TDF_MASK)&amp;gt;&amp;gt;LPSPI_SR_TDF_SHIFT == 0);
				pstSPI-&amp;gt;TDR = buffer;
				/* Se limpia la bandera TDF */
				pstSPI-&amp;gt;SR |= LPSPI_SR_TCF_MASK;

			}

			// Clean complete flag
			pstSPI-&amp;gt;SR |= 1 &amp;lt;&amp;lt; LPSPI_SR_TCF_SHIFT;

			u16Return = (uint16)OK;
		}
		else{
			/*	Nothing to do	*/
		}
	}
	else{
		/*	Nothing to do	*/
	}

	return u16Return;
}

uint8 u8Data[] = {0x01U, 0x02U, 0x03U, 0x04U, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F};

int main(void)
{
	WDOG_Disable();
	SOSC_init_8MHz(); /* Initialize system oscillator for 8 MHz xtal */
	SPLL_init_160MHz(); /* Initialize SPLL to 160 MHz with 8 MHz SOSC */
	NormalRUNmode_80MHz(); /* Init clocks: 80 MHz SPLL &amp;amp; core, 40 MHz bus, 20 MHz flash */
	SPI_vInitMaster();

	SPI_u8Transmit((uint8)SPI_enSPI0, u8Data, sizeof(u8Data));
	SPI_u8Transmit((uint8)SPI_enSPI0, u8Data, sizeof(u8Data));

	while(1)
	{
		vDelayMs(500);
	}
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And here are some readings from a logic analyzer:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="marco_medrano_0-1713230449402.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/273854iEE93745093AB0411/image-size/medium?v=v2&amp;amp;px=400" role="button" title="marco_medrano_0-1713230449402.png" alt="marco_medrano_0-1713230449402.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I've been struggling with this for weeks. I'd really appreciate if you can tell me if I'm missing something&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 16 Apr 2024 23:40:03 GMT</pubDate>
    <dc:creator>marco_medrano</dc:creator>
    <dc:date>2024-04-16T23:40:03Z</dc:date>
    <item>
      <title>S32K144W problems with custom SPI driver</title>
      <link>https://community.nxp.com/t5/S32K/S32K144W-problems-with-custom-SPI-driver/m-p/1848518#M34284</link>
      <description>&lt;P&gt;Hi NXP community!&lt;/P&gt;&lt;P&gt;I'm developing a custom SPI driver based on the SPI example from the AN5423 application note (&lt;A href="https://www.nxp.com/docs/en/application-note/AN5413.pdf=" target="_blank"&gt;https://www.nxp.com/docs/en/application-note/AN5413.pdf)&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The problem I'm facing is that after initializing, the SPI is only able to send around 23 bytes of data, no matter what I set as the frame size in the Transmit Command Register (TCR). After that, the clock remains in high state even though I set its polarity as SCK low. While debugging, I found that it gets stuck waiting for the TDF flag of the status register to be 0. Also, the TX fifo seams to be full, but I don't know why it is not sending this data.&lt;/P&gt;&lt;P&gt;Here is my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;static void* SPI_s_vSelectModule(uint8 u8SpiModule){

	void *pAddress = (void*)NULL;

	if(u8SpiModule == (uint8)SPI_enSPI0){

		pAddress = (void*)LPSPI0_BASE_ADDR_cfg;

	}
	else if(u8SpiModule == (uint8)SPI_enSPI2){

		pAddress = (void*)LPSPI2_BASE_ADDR_cfg;

	}
	else{
		/*	 Nothing to do	*/
	}

	return pAddress;
}


void SPI_s_vInitPorts(void){

	/*	Enable clocks	*/
	PCC-&amp;gt;PCCn[PCC_PORTB_INDEX]|=PCC_PCCn_CGC_MASK; /* Enable clock for PORTB */
	PCC-&amp;gt;PCCn[PCC_PORTC_INDEX]|=PCC_PCCn_CGC_MASK; /* Enable clock for PORTC */
	PCC-&amp;gt;PCCn[PCC_PORTD_INDEX]|=PCC_PCCn_CGC_MASK; /* Enable clock for PORTD */

	/*	Config. SPI0	*/
	PORTD-&amp;gt;PCR[15]|=PORT_PCR_MUX(4); /* Port D15: MUX = ALT4, LPSPI0_SCK reloj */
	PORTD-&amp;gt;PCR[16]|=PORT_PCR_MUX(4); /* Port D16: MUX = ALT4, LPSPI0_SIN/MISO */
	PORTB-&amp;gt;PCR[4]|=PORT_PCR_MUX(3); /* Port B4: MUX = ALT3, LPSPI0_SOUT/MOSI */
	PORTB-&amp;gt;PCR[5]|=PORT_PCR_MUX(4); /* Port B5: MUX = ALT4, LPSPI0_PCS0 */

	/*	Config. SPI2	*/
	PORTC-&amp;gt;PCR[15]|=PORT_PCR_MUX(3); /* Port C15: MUX = ALT3, LPSPI2_SCK reloj */
	PORTC-&amp;gt;PCR[0]|=PORT_PCR_MUX(3); /* Port C0: MUX = ALT3, LPSPI2_SIN/MISO */
	PORTC-&amp;gt;PCR[1]|=PORT_PCR_MUX(3); /* Port C1: MUX = ALT3, LPSPI2_SOUT/MOSI */
	PORTC-&amp;gt;PCR[14]|=PORT_PCR_MUX(3); /* Port C14: MUX = ALT3, LPSPI2_PCS0 */

}

void SPI_vInitMaster(void){

LPSPI_Type *pstSPI;

for(uint8 u8x = 0; u8x &amp;lt; SPI_enTotalSPIs; u8x++){

if(u8x == (uint8)SPI_enSPI0){
PCC-&amp;gt;PCCn[PCC_LPSPI0_INDEX] = 0; /* Disable clocks to modify PCS ( default) */
PCC-&amp;gt;PCCn[PCC_LPSPI0_INDEX] = 0xC6000000; /* Enable PCS=SPLL_DIV2 (40 MHz func'l clock) */
pstSPI = (LPSPI_Type*)SPI_s_vSelectModule(u8x);
}
else if(u8x == (uint8)SPI_enSPI2){
PCC-&amp;gt;PCCn[PCC_LPSPI2_INDEX] = 0; /* Disable clocks to modify PCS ( default) */
PCC-&amp;gt;PCCn[PCC_LPSPI2_INDEX] = 0xC6000000; /* Enable PCS=SPLL_DIV2 (40 MHz func'l clock) */
pstSPI = (LPSPI_Type*)SPI_s_vSelectModule(u8x);
}
else{
/* Nothing to do */
}

pstSPI-&amp;gt;CR = 0x00000000; /* Disable module for configuration */

pstSPI-&amp;gt;IER = 0x00000000; /* Interrupts not used */

pstSPI-&amp;gt;DER = 0x00000000; /* DMA not used */

pstSPI-&amp;gt;CFGR0 = 0x00000000; /* Defaults: */
/* RDM0=0: rec'd data to FIFO as normal */
/* CIRFIFO=0; Circular FIFO is disabled */
/* HRSEL, HRPOL, HREN=0: Host request disabled */

pstSPI-&amp;gt;CFGR1 = 0x00000001; /* Configurations: master mode*/
/* PCSCFG=0: PCS[3:2] are enabled */
/* OUTCFG=0: Output data retains last value when CS negated */
/* PINCFG=0: SIN is input, SOUT is output */
/* MATCFG=0: Match disabled */
/* PCSPOL=0: PCS is active low */
/* NOSTALL=0: Stall if Tx FIFO empty or Rx FIFO full */
/* AUTOPCS=0: does not apply for master mode */
/* SAMPLE=0: input data sampled on SCK edge */
/* MASTER=1: Master mode */

pstSPI-&amp;gt;TCR = 0x5000001F; /* Transmit cmd: PCS0, 32bits, prescale func'l clk by 4. */
//pstSPI-&amp;gt;TCR = 0x50000007; /* Transmit cmd: PCS0, 32bits, prescale func'l clk by 4. */
/* CPOL=0: SCK inactive state is low */
/* CPHA=1: Change data on SCK lead'g, capture on trail'g edge*/
/* PRESCALE=2: Functional clock divided by 2**2 = 4 */
/* PCS=0: Transfer using PCS0 */
/* LSBF=0: Data is transferred MSB first */
/*pstSPI-&amp;gt;TCR = 0x5080001F*/ /* LSBF=1: Data is transferred LSB first */
/* BYSW=0: Byte swap disabled */
/* CONT, CONTC=0: Continuous transfer disabled */
/* RXMSK=0: Normal transfer: rx data stored in rx FIFO */
/* TXMSK=0: Normal transfer: data loaded from tx FIFO */
/* WIDTH=0: Single bit transfer */
/* FRAMESZ=15: # bits in frame = 15+1=16 */

pstSPI-&amp;gt;CCR = 0x04090808; /* Clk dividers based on prescaled func'l clk of 100 nsec */
/* SCKPCS=4: SCK to PCS delay = 4+1 = 5 (500 nsec) */
/* PCSSCK=4: PCS to SCK delay = 9+1 = 10 (1 usec) */
/* DBT=8: Delay between Transfers = 8+2 = 10 (1 usec) */
/* SCKDIV=8: SCK divider =8+2 = 10 (1 usec: 1 MHz baud rate) */

pstSPI-&amp;gt;FCR = 0x00000003; /* RXWATER=0: Rx flags set when Rx FIFO &amp;gt;0 */
/* TXWATER=3: Tx flags set when Tx FIFO &amp;lt;= 3 */

pstSPI-&amp;gt;CR = 0x00000009; /* Enable module for operation */
/* DBGEN=1: module enabled in debug mode */
/* DOZEN=0: module enabled in Doze mode */
/* RST=0: Master logic not reset */
/* MEN=1: Module is enabled */
}

SPI_s_vInitPorts();
}

uint16 SPI_u8Transmit(uint8 u8SpiModule, uint8 *data, uint16 size)
{
	uint16 u16Return = (uint16)NOT_OK;
	LPSPI_Type *pstSPI;
	uint32 buffer=0;

	if(u8SpiModule &amp;lt; (uint8)SPI_enTotalSPIs){

		pstSPI = (LPSPI_Type*)SPI_s_vSelectModule(u8SpiModule);

		if(pstSPI != NULL){

			// Clean Tx buffer
			pstSPI-&amp;gt;CR |= 1 &amp;lt;&amp;lt; LPSPI_CR_RTF_SHIFT;

			// Configure the FRAMESZ based on the input size
			pstSPI-&amp;gt;TCR =  0x50000000 | (size*8 - 1);

			//vSpiDelayMs(5);

			// Send all 32-bit frames that we can handle
			for(int i=0; i&amp;lt;(size / 4); i++)
			{
				buffer = data[4*i + 0] &amp;lt;&amp;lt; 24;
				buffer |= data[4*i + 1] &amp;lt;&amp;lt; 16;
				buffer |= data[4*i + 2] &amp;lt;&amp;lt; 8;
				buffer |= data[4*i + 3];
				/*	Espera al que este libre	*/
				while((pstSPI-&amp;gt;SR &amp;amp; LPSPI_SR_TDF_MASK)&amp;gt;&amp;gt;LPSPI_SR_TDF_SHIFT == 0);
				/* Transmit data */
				pstSPI-&amp;gt;TDR = buffer;
				/* Se limpia la bandera TDF */
				pstSPI-&amp;gt;SR |= LPSPI_SR_TDF_MASK;
			}

			// send remaining bytes
			if(size%4 &amp;gt; 0)
			{
				buffer = 0;
				// Send the remaining data
				for(int i=(size%4); i&amp;gt;0; i--)
				{
					buffer |= data[size - i] &amp;lt;&amp;lt; (8*(i-1));
				}
				while((pstSPI-&amp;gt;SR &amp;amp; LPSPI_SR_TDF_MASK)&amp;gt;&amp;gt;LPSPI_SR_TDF_SHIFT == 0);
				pstSPI-&amp;gt;TDR = buffer;
				/* Se limpia la bandera TDF */
				pstSPI-&amp;gt;SR |= LPSPI_SR_TCF_MASK;

			}

			// Clean complete flag
			pstSPI-&amp;gt;SR |= 1 &amp;lt;&amp;lt; LPSPI_SR_TCF_SHIFT;

			u16Return = (uint16)OK;
		}
		else{
			/*	Nothing to do	*/
		}
	}
	else{
		/*	Nothing to do	*/
	}

	return u16Return;
}

uint8 u8Data[] = {0x01U, 0x02U, 0x03U, 0x04U, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F};

int main(void)
{
	WDOG_Disable();
	SOSC_init_8MHz(); /* Initialize system oscillator for 8 MHz xtal */
	SPLL_init_160MHz(); /* Initialize SPLL to 160 MHz with 8 MHz SOSC */
	NormalRUNmode_80MHz(); /* Init clocks: 80 MHz SPLL &amp;amp; core, 40 MHz bus, 20 MHz flash */
	SPI_vInitMaster();

	SPI_u8Transmit((uint8)SPI_enSPI0, u8Data, sizeof(u8Data));
	SPI_u8Transmit((uint8)SPI_enSPI0, u8Data, sizeof(u8Data));

	while(1)
	{
		vDelayMs(500);
	}
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And here are some readings from a logic analyzer:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="marco_medrano_0-1713230449402.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/273854iEE93745093AB0411/image-size/medium?v=v2&amp;amp;px=400" role="button" title="marco_medrano_0-1713230449402.png" alt="marco_medrano_0-1713230449402.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I've been struggling with this for weeks. I'd really appreciate if you can tell me if I'm missing something&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Apr 2024 23:40:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K144W-problems-with-custom-SPI-driver/m-p/1848518#M34284</guid>
      <dc:creator>marco_medrano</dc:creator>
      <dc:date>2024-04-16T23:40:03Z</dc:date>
    </item>
    <item>
      <title>Re: S32K144W problems with custom SPI driver</title>
      <link>https://community.nxp.com/t5/S32K/S32K144W-problems-with-custom-SPI-driver/m-p/1848882#M34302</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/232265"&gt;@marco_medrano&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Try masking the RX data (TCR[RXMSK] = 1).&lt;/P&gt;
&lt;P&gt;I don't see any code that would read RDR.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you,&lt;/P&gt;
&lt;P&gt;BR, Daniel&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2024 08:50:45 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K144W-problems-with-custom-SPI-driver/m-p/1848882#M34302</guid>
      <dc:creator>danielmartynek</dc:creator>
      <dc:date>2024-04-17T08:50:45Z</dc:date>
    </item>
    <item>
      <title>Re: S32K144W problems with custom SPI driver</title>
      <link>https://community.nxp.com/t5/S32K/S32K144W-problems-with-custom-SPI-driver/m-p/1850088#M34367</link>
      <description>&lt;P&gt;That seems to solve the issue. Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 18 Apr 2024 18:27:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K144W-problems-with-custom-SPI-driver/m-p/1850088#M34367</guid>
      <dc:creator>marco_medrano</dc:creator>
      <dc:date>2024-04-18T18:27:53Z</dc:date>
    </item>
  </channel>
</rss>

