spi in imx8x M4 core

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

spi in imx8x M4 core

574 Views
Ouseppachan_CR
Contributor I

Hi,

Am trying to setup lpspi from m4 core in imx8x processor and i dindnt found any sample code in SDK. can anyone help with a sample code for spi in imx8x M4 core.

 

Tags (4)
0 Kudos
Reply
3 Replies

560 Views
Chavira
NXP TechSupport
NXP TechSupport

Hi @Ouseppachan_CR!

Thank you for contacting NXP Support!

 

Sorry, unfortunately, we don't have examples for that.

 

All the examples can be found on our Git Hub.

 

https://github.com/nxp-mcuxpresso/mcux-sdk-examples/tree/main/mekmimx8qx

 

We have the documentation of our MCUXPRESSO SDK that documentation can be useful for you.

 

You can download the Documentation and the SDK by following the link:

 

 https://mcuxpresso.nxp.com/en/welcome

 

Best Regards!

Chavira

0 Kudos
Reply

556 Views
Ouseppachan_CR
Contributor I

hi @Chavira,

I saw these examples, from this i tried to initilised lpspi.

The pin settings i have done is following,

 

sc_pm_set_resource_power_mode(ipc, SC_R_SPI_2, SC_PM_PW_MODE_ON);

sc_pad_set_all(ipc, IMX8QXP_SPI2_SCK, 0U, SC_PAD_CONFIG_NORMAL, SC_PAD_ISO_OFF, 0x40 ,SC_PAD_WAKEUP_OFF); // CLK

sc_pad_set_all(ipc, IMX8QXP_SPI2_SDI, 0U, SC_PAD_CONFIG_NORMAL, SC_PAD_ISO_OFF, 0x40 ,SC_PAD_WAKEUP_OFF); // MISO

sc_pad_set_all(ipc, IMX8QXP_SPI2_SDO, 0U, SC_PAD_CONFIG_NORMAL, SC_PAD_ISO_OFF, 0x40 ,SC_PAD_WAKEUP_OFF); // MOSI

 

sc_pm_clock_enable(ipc, SC_R_SPI_2, SC_PM_CLK_PER, true, 0);

 

CLOCK_SetIpFreq(kCLOCK_DMA_Lpspi2, SC_60MHZ);

 

 

and the spi initilisation was,

LPSPI_MasterGetDefaultConfig(&Masterconfig);

LPSPI_MasterInit(ADMA__LPSPI2, &Masterconfig, SC_60MHZ);

 

LPSPI_EnableInterrupts(ADMA__LPSPI2, kLPSPI_AllInterruptEnable);

EnableIRQ(ADMA_SPI2_INT_IRQn);

 

I am sending a data by the function

LPSPI_MasterTransferNonBlocking(ADMA__LPSPI2, &g_s_handle, &slaveXfer);

 

By this i am not getting the clock on SCK pin.

 

 

with regards,

Ouseppachan CR

 

0 Kudos
Reply

535 Views
Chavira
NXP TechSupport
NXP TechSupport
0 Kudos
Reply