I can’t get working SPI2 port, which is labelled as SPI1 by Toradex Pinout Designer
I’m working from the M4 side on a Colibri IMX8 + Colibri Evaluation board.
The issue is that I don’t have any level in any of the port lines (CLK, MOSI) when I try to send data, they all remain low. (Jumpers are open in evaluation board to ensure lines are isolated from any peripheral).
No linux code is running, only M4, since I use Segger for testing code/debugging and I delayed UBoot start also.
Here is my initialization code:
// power on sc_pm_set_resource_power_mode(ipc, SC_R_SPI_2, SC_PM_PW_MODE_ON); // configure pins sc_pad_set_all(ipc, SC_P_SPI2_SCK, 0U, SC_PAD_CONFIG_NORMAL, SC_PAD_ISO_OFF, 0x40 ,SC_PAD_WAKEUP_OFF); // CLK sc_pad_set_all(ipc, SC_P_SPI2_SDI, 0U, SC_PAD_CONFIG_NORMAL, SC_PAD_ISO_OFF, 0x40 ,SC_PAD_WAKEUP_OFF); // MISO sc_pad_set_all(ipc, SC_P_SPI2_SDO, 0U, SC_PAD_CONFIG_NORMAL, SC_PAD_ISO_OFF, 0x40 ,SC_PAD_WAKEUP_OFF); // MOSI // enable and set clock CLOCK_EnableClockExt(kCLOCK_DMA_Lpspi2, 0); CLOCK_SetIpFreq(kCLOCK_DMA_Lpspi2, SC_60MHZ); // SPI Initialization LPSPI_MasterGetDefaultConfig(&config); LPSPI_MasterInit(ADMA__LPSPI2, &config, SC_60MHZ);
There is a reference about this in your blog, please follow this link (link)
I found that the code suggested does not work either. I have successfully initialized other ports as I2C in a very similar way. I don’t understand well why this behaves that way.
Could you please give me some support about this topic or test it from your side?