Hi There,
I was unable to change the Baud rate in LPSPI1 (the only one I tried) and I tracked it down to this logic in fsl_lpspi.c -> LPSPI_MasterSetBaudRate()
((base->CR & LPSPI_CR_MEN_MASK) != 0U)
For whatever reason this always evaluates as false, resulting in us sticking with the default 500K baud. Commenting out that check resolves the problem. The comment above says
"the LPSPI module needs to be disabled first, if enabled, return 0" but I'm not sure how to work around this since it always returns out and never resolves.
Here is my config:
const lpspi_master_config_t LPSPI1_config = {
.baudRate = 1000000UL,
.bitsPerFrame = 8UL,
.cpol = kLPSPI_ClockPolarityActiveHigh,
.cpha = kLPSPI_ClockPhaseFirstEdge,
.direction = kLPSPI_MsbFirst,
.pcsToSckDelayInNanoSec = 1000UL,
.lastSckToPcsDelayInNanoSec = 1000UL,
.betweenTransferDelayInNanoSec = 1000UL,
.whichPcs = kLPSPI_Pcs0,
.pcsActiveHighOrLow = kLPSPI_PcsActiveHigh,
.pinCfg = kLPSPI_SdiInSdoOut,
.dataOutConfig = kLpspiDataOutRetained
};
Hi @functional_des ,
You mean the following code always return 0, right?
If yes, I think, you can use the SDK lpspi code to test it instead of your own configuration, then do the baudrate change and test it, whether still have this issues.
SDK_2_11_1_EVKB-MIMXRT1060\boards\evkmimxrt1060\driver_examples\lpspi\polling_b2b_transfer\master
If you can reproduce the issues with the SDK demo, just kindly let me know.
Best Regards,
kerry
Yes that line always returns 0 and returns out. I will check out the example and let you know what I see