LPSPI0 interfacing with AS5147 is not working

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

LPSPI0 interfacing with AS5147 is not working

318 Views
Ganapathy
Contributor I

We are interfacing the AS5147 magnetic sensor with LPSPI0 of S32K142 is not working, since we are using LPSPI1 for GDU driver is working fine. But LPSPI0 is waiting at SemWait function.

Below are the generated code from S32DS:

const lpspi_master_config_t spi_cfg0_MasterConfig0 = {
.bitsPerSec = 500000U,
.whichPcs = LPSPI_PCS0,
.pcsPolarity = LPSPI_ACTIVE_LOW,
.isPcsContinuous = false,
.bitcount = 8U,
.lpspiSrcClk = 40000000U,
.clkPhase = LPSPI_CLOCK_PHASE_2ND_EDGE,
.clkPolarity = LPSPI_SCK_ACTIVE_HIGH,
.lsbFirst = false,
.transferType = LPSPI_USING_INTERRUPTS,
.rxDMAChannel = 255,
.txDMAChannel = 255,
.callback = NULL,
.callbackParam = NULL,
};

We are using internal clock, and clock configuration working fine with LPSPI1

we are static file which is available from sdk as it is for driver.
code struck in while loop, in line number 343 in function OSIF_SemaWait in file of osif_baremetal.c

Pin configuration we are using PTB0 - PCS0, PTE0-SCK, PTE1-SIN, PTE2-SOUT, these are connected to AS5147 properly,

we verified the toggling the pin after configuring these pins as GPIO, its working fine.

but after configuring as LPSPI0, we are not able transfer any data, because its struck in the while loop

0 Kudos
0 Replies