<?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のトピックRe: Regarding FLEX IO SPI</title>
    <link>https://community.nxp.com/t5/S32K/Regarding-FLEX-IO-SPI/m-p/1524775#M17817</link>
    <description>&lt;P&gt;Hi&amp;nbsp;RishikeshB,&lt;/P&gt;
&lt;P&gt;Did you follow the guide of&amp;nbsp;&lt;STRONG&gt;FLEXIO SPI&lt;/STRONG&gt; RTM3.0.3 &lt;STRONG&gt;flexio_spi_s32k148&lt;/STRONG&gt;?(&lt;A target="_blank"&gt;file:///C:/NXP/S32DS_ARM_v2.2/S32DS/software/S32SDK_S32K1xx_RTM_3.0.0/doc/html_S32K148/flexio_spi_s32k148_group.html)&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Make sure Hardware Wiring, what's the value of&amp;nbsp;&lt;STRONG&gt;isTransferOk&lt;/STRONG&gt; after running the example?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="FLEXIO SPI RTM3.0.3 flexio_spi_s32k148.png" style="width: 573px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/194252i7A83156F025F3DEA/image-size/large?v=v2&amp;amp;px=999" role="button" title="FLEXIO SPI RTM3.0.3 flexio_spi_s32k148.png" alt="FLEXIO SPI RTM3.0.3 flexio_spi_s32k148.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Have you try to capture the SPI data by using&amp;nbsp;logic analyzer? (It's rather strange why I can measure the waveform, but you can't. Maybe you should go to this &lt;A href="https://community.nxp.com/t5/S32K/Problem-with-Chip-Select-S32K/td-p/1523523" target="_self"&gt;thread&lt;/A&gt;&amp;nbsp;and make sure the oscilloscope and S32K148EVB are working properly.)&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;Robin&lt;BR /&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;
&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt;Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;</description>
    <pubDate>Tue, 20 Sep 2022 07:27:13 GMT</pubDate>
    <dc:creator>Robin_Shen</dc:creator>
    <dc:date>2022-09-20T07:27:13Z</dc:date>
    <item>
      <title>Regarding FLEX IO SPI</title>
      <link>https://community.nxp.com/t5/S32K/Regarding-FLEX-IO-SPI/m-p/1524633#M17804</link>
      <description>&lt;P&gt;Hello NXP&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying the FLEXIO SPI example and i am checking the waveform on oscilloscope but i am not getting any output where should i check the output&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/* Including needed modules to compile this module/procedure */&lt;BR /&gt;#include "Cpu.h"&lt;BR /&gt;#include "clockMan1.h"&lt;BR /&gt;#include "pin_mux.h"&lt;BR /&gt;#include "dmaController1.h"&lt;BR /&gt;#include "flexio_spi1.h"&lt;BR /&gt;#include "flexio_spi2.h"&lt;BR /&gt;#if CPU_INIT_CONFIG&lt;BR /&gt;#include "Init_Config.h"&lt;BR /&gt;#endif&lt;/P&gt;&lt;P&gt;volatile int exit_code = 0;&lt;BR /&gt;/* User includes (#include below this line is not maintained by Processor Expert) */&lt;/P&gt;&lt;P&gt;#include &amp;lt;stdint.h&amp;gt;&lt;BR /&gt;#include &amp;lt;stdbool.h&amp;gt;&lt;/P&gt;&lt;P&gt;/* Declare transfer size */&lt;BR /&gt;#define TRANSFER_SIZE 16u&lt;/P&gt;&lt;P&gt;/* Struct that defines RX and TX buffer arrays */&lt;BR /&gt;typedef struct&lt;BR /&gt;{&lt;BR /&gt;uint8_t txBuffer[TRANSFER_SIZE];&lt;BR /&gt;uint8_t rxBuffer[TRANSFER_SIZE];&lt;BR /&gt;} spi_buffer_t;&lt;/P&gt;&lt;P&gt;/*!&lt;BR /&gt;* @brief Initialize the SPI buffer with different values for TX/RX&lt;BR /&gt;*&lt;BR /&gt;* &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/197964"&gt;@Param&lt;/a&gt; spiBuffer Pointer to the buffer that will be initialized&lt;BR /&gt;* &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/197964"&gt;@Param&lt;/a&gt; master True if the buffer is used with the master device,&lt;BR /&gt;* False if not&lt;BR /&gt;*/&lt;BR /&gt;void InitSPIBuffer(spi_buffer_t * spiBuffer, bool master)&lt;BR /&gt;{&lt;BR /&gt;uint8_t cnt;&lt;BR /&gt;/* Fill the buffers */&lt;BR /&gt;for(cnt = 0U; cnt &amp;lt; TRANSFER_SIZE; cnt++)&lt;BR /&gt;{&lt;BR /&gt;/* If the master flag is set, then the txBuffer will take the value of the counter,&lt;BR /&gt;* else the value will be (TRANSFER_SIZE - Counter).&lt;BR /&gt;* This approach is taken to make the data transfer more visible.&lt;BR /&gt;*/&lt;BR /&gt;spiBuffer-&amp;gt;txBuffer[cnt] = ((master == true) ? (cnt) : (TRANSFER_SIZE - cnt));&lt;BR /&gt;spiBuffer-&amp;gt;rxBuffer[cnt] = 0U;&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;/*!&lt;BR /&gt;\brief The main function for the project.&lt;BR /&gt;\details The startup initialization sequence is the following:&lt;BR /&gt;* - __start (startup asm routine)&lt;BR /&gt;* - __init_hardware()&lt;BR /&gt;* - main()&lt;BR /&gt;* - PE_low_level_init()&lt;BR /&gt;* - Common_Init()&lt;BR /&gt;* - Peripherals_Init()&lt;BR /&gt;*/&lt;BR /&gt;int main(void)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;/* Allocate the memory necessary for the FlexIO state structures */&lt;BR /&gt;flexio_device_state_t flexIODeviceState;&lt;BR /&gt;flexio_spi_master_state_t flexIOSPIState_Master, flexIOSPIState_Slave;&lt;BR /&gt;/* Declare the master and slave buffers */&lt;BR /&gt;spi_buffer_t masterBuffer, slaveBuffer;&lt;BR /&gt;volatile bool isTransferOk = true;&lt;BR /&gt;uint8_t cnt;&lt;/P&gt;&lt;P&gt;/*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/&lt;BR /&gt;#ifdef PEX_RTOS_INIT&lt;BR /&gt;PEX_RTOS_INIT(); /* Initialization of the selected RTOS. Macro is defined by the RTOS component. */&lt;BR /&gt;#endif&lt;BR /&gt;/*** End of Processor Expert internal initialization. ***/&lt;/P&gt;&lt;P&gt;/* Initialize and configure clocks&lt;BR /&gt;* - Setup system clocks, dividers&lt;BR /&gt;* - Configure FlexIO clock, Port clocks&lt;BR /&gt;* - see clock manager component for more details&lt;BR /&gt;*/&lt;BR /&gt;CLOCK_SYS_Init(g_clockManConfigsArr, CLOCK_MANAGER_CONFIG_CNT,&lt;BR /&gt;g_clockManCallbacksArr, CLOCK_MANAGER_CALLBACK_CNT);&lt;BR /&gt;CLOCK_SYS_UpdateConfiguration(0U, CLOCK_MANAGER_POLICY_AGREEMENT);&lt;/P&gt;&lt;P&gt;/* Initialize pins&lt;BR /&gt;* - Init FlexIO pins&lt;BR /&gt;* - See PinSettings component for more info&lt;BR /&gt;*/&lt;BR /&gt;PINS_DRV_Init(NUM_OF_CONFIGURED_PINS, g_pin_mux_InitConfigArr);&lt;/P&gt;&lt;P&gt;/* Init FlexIO device */&lt;BR /&gt;FLEXIO_DRV_InitDevice(INST_FLEXIO_SPI1, &amp;amp;flexIODeviceState);&lt;BR /&gt;/* Call the init function for FlexIO SPI driver */&lt;BR /&gt;FLEXIO_SPI_DRV_MasterInit(INST_FLEXIO_SPI1, &amp;amp;flexio_spi1_MasterConfig0, &amp;amp;flexIOSPIState_Master);&lt;BR /&gt;/* Initialize Slave instance of the FlexIO SPI driver */&lt;BR /&gt;FLEXIO_SPI_DRV_SlaveInit(INST_FLEXIO_SPI2, &amp;amp;flexio_spi2_SlaveConfig0, &amp;amp;flexIOSPIState_Slave);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/* Initialize master and slave buffers */&lt;BR /&gt;InitSPIBuffer(&amp;amp;masterBuffer, true);&lt;BR /&gt;InitSPIBuffer(&amp;amp;slaveBuffer, false);&lt;/P&gt;&lt;P&gt;/* Signal to the Slave FlexIO SPI driver to start listening. Set the buffers and transfer size */&lt;BR /&gt;FLEXIO_SPI_DRV_SlaveTransfer(&amp;amp;flexIOSPIState_Slave, slaveBuffer.txBuffer, slaveBuffer.rxBuffer, TRANSFER_SIZE);&lt;/P&gt;&lt;P&gt;/* Start the transmission of data */&lt;BR /&gt;FLEXIO_SPI_DRV_MasterTransferBlocking(&amp;amp;flexIOSPIState_Master,&lt;BR /&gt;masterBuffer.txBuffer,&lt;BR /&gt;masterBuffer.rxBuffer,&lt;BR /&gt;TRANSFER_SIZE,&lt;BR /&gt;1000UL);&lt;/P&gt;&lt;P&gt;/* Check if transfer is completed with no errors */&lt;BR /&gt;for (cnt = 0U; cnt &amp;lt; TRANSFER_SIZE; cnt++)&lt;BR /&gt;{&lt;BR /&gt;/* If the values are not equal, break the loop and set isTransferOk to false */&lt;BR /&gt;if((masterBuffer.txBuffer[cnt] != slaveBuffer.rxBuffer[cnt]) || (masterBuffer.rxBuffer[cnt] != slaveBuffer.txBuffer[cnt]))&lt;BR /&gt;{&lt;BR /&gt;isTransferOk = false;&lt;BR /&gt;break;&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;/* Cast isTransferOk to avoid "set but not used" warnings */&lt;BR /&gt;(void)isTransferOk;&lt;/P&gt;&lt;P&gt;/*** Don't write any code pass this line, or it will be deleted during code generation. ***/&lt;BR /&gt;/*** RTOS startup code. Macro PEX_RTOS_START is defined by the RTOS component. DON'T MODIFY THIS CODE!!! ***/&lt;BR /&gt;#ifdef PEX_RTOS_START&lt;BR /&gt;PEX_RTOS_START(); /* Startup of the selected RTOS. Macro is defined by the RTOS component. */&lt;BR /&gt;#endif&lt;BR /&gt;/*** End of RTOS startup code. ***/&lt;BR /&gt;/*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/&lt;BR /&gt;for(;;) {&lt;BR /&gt;if(exit_code != 0) {&lt;BR /&gt;break;&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;return exit_code;&lt;BR /&gt;/*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/&lt;BR /&gt;} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/&lt;/P&gt;</description>
      <pubDate>Tue, 20 Sep 2022 03:53:44 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Regarding-FLEX-IO-SPI/m-p/1524633#M17804</guid>
      <dc:creator>RishikeshB</dc:creator>
      <dc:date>2022-09-20T03:53:44Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding FLEX IO SPI</title>
      <link>https://community.nxp.com/t5/S32K/Regarding-FLEX-IO-SPI/m-p/1524775#M17817</link>
      <description>&lt;P&gt;Hi&amp;nbsp;RishikeshB,&lt;/P&gt;
&lt;P&gt;Did you follow the guide of&amp;nbsp;&lt;STRONG&gt;FLEXIO SPI&lt;/STRONG&gt; RTM3.0.3 &lt;STRONG&gt;flexio_spi_s32k148&lt;/STRONG&gt;?(&lt;A target="_blank"&gt;file:///C:/NXP/S32DS_ARM_v2.2/S32DS/software/S32SDK_S32K1xx_RTM_3.0.0/doc/html_S32K148/flexio_spi_s32k148_group.html)&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Make sure Hardware Wiring, what's the value of&amp;nbsp;&lt;STRONG&gt;isTransferOk&lt;/STRONG&gt; after running the example?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="FLEXIO SPI RTM3.0.3 flexio_spi_s32k148.png" style="width: 573px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/194252i7A83156F025F3DEA/image-size/large?v=v2&amp;amp;px=999" role="button" title="FLEXIO SPI RTM3.0.3 flexio_spi_s32k148.png" alt="FLEXIO SPI RTM3.0.3 flexio_spi_s32k148.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Have you try to capture the SPI data by using&amp;nbsp;logic analyzer? (It's rather strange why I can measure the waveform, but you can't. Maybe you should go to this &lt;A href="https://community.nxp.com/t5/S32K/Problem-with-Chip-Select-S32K/td-p/1523523" target="_self"&gt;thread&lt;/A&gt;&amp;nbsp;and make sure the oscilloscope and S32K148EVB are working properly.)&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;Robin&lt;BR /&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;
&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt;Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;</description>
      <pubDate>Tue, 20 Sep 2022 07:27:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Regarding-FLEX-IO-SPI/m-p/1524775#M17817</guid>
      <dc:creator>Robin_Shen</dc:creator>
      <dc:date>2022-09-20T07:27:13Z</dc:date>
    </item>
  </channel>
</rss>

