Working with 2 LPSPI Instances

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

Working with 2 LPSPI Instances

950 Views
govindjogesh-123
Contributor I

Hi,

I am working with s32k microcontroller with NCJ37A Secure Element using LPSPI1 with SE Host Library provided by NXP and NCx3321 NFC reader and i am able t get it working Independently, I am Initializing pins and clocks first for NFC reader and until the SE element is intialized, I am using the same clockconfig and pinmux file for both. I am using interrupt using SPI_Master_Blocking for SE, could that be the problem?

/////////////////////////////////SPI0///////////////////////////////////////////////

const lpspi_master_config_t lpspi_0_MasterConfig0 = {

.bitsPerSec = 2000000U,

.whichPcs = LPSPI_PCS1,

.pcsPolarity = LPSPI_ACTIVE_LOW,

.isPcsContinuous = true,

.bitcount = 8U,

.lpspiSrcClk = 8000000U,

.clkPhase = LPSPI_CLOCK_PHASE_1ST_EDGE,

.clkPolarity = LPSPI_SCK_ACTIVE_HIGH,

.lsbFirst = false,

.transferType = LPSPI_USING_INTERRUPTS,

.rxDMAChannel = 255,

.txDMAChannel = 255,

.callback = NULL,

.callbackParam = NULL,

};

 

////////////////////////////SPI1//////////////////////////////////

const lpspi_master_config_t lpspi_1_MasterConfig0 = {

.bitsPerSec = 500000U,

.whichPcs = LPSPI_PCS3,

.pcsPolarity = LPSPI_ACTIVE_LOW,

.isPcsContinuous = true,

.bitcount = 8U,

.lpspiSrcClk = 24000000U,

.clkPhase = LPSPI_CLOCK_PHASE_1ST_EDGE,

.clkPolarity = LPSPI_SCK_ACTIVE_HIGH,

.lsbFirst = false,

.transferType = LPSPI_USING_INTERRUPTS,

.rxDMAChannel = 255,

.txDMAChannel = 255,

.callback = NULL,

.callbackParam = NULL,

};

 Inside the main file I am just initializing the pins and clock and then calling the application layer code for SE and NFC

Tags (3)
0 Kudos
Reply
1 Reply

935 Views
Julián_AragónM
NXP TechSupport
NXP TechSupport

Hi @govindjogesh-123

If you have issues with SE or the aNFC library, please contact the respective team directly (automotive_nfc@nxp.com), as this SW is out of the community's scope of support.

I am able to help you by providing an S32K144 LPSPI example with two instances configured. Please refer to Lpspi_Ip_HalfDuplexTransfer_S32K144, from the RTD package; In this application, 10 frames of 8 bits are transferred via LPSPI_0(MASTER) to LPSPI_1(SLAVE), and vice-versa.

Best regards,
Julián

 

0 Kudos
Reply