Author Topic: ECSPI problem on Cortex-M7 core  (Read 1076 times)

0 Members and 1 Guest are viewing this topic.

Offline teleportboyTopic starter

  • Newbie
  • Posts: 8
  • Country: kg
ECSPI problem on Cortex-M7 core
« on: January 17, 2024, 04:02:36 pm »
On the board with Cortex-M7(as coprocessor, the main core is A53. The linux running on a53), ADS8028 is connected via SPI. However, attempts to communicate with the ADS8028 device end in failure. I based my approach on the spi_polling example from the SDK. I configured the multiplexing correctly, according to the .dts file. But after sending a specific sequence of bits according to the ADS8028 datasheet via SPI, the RX buffer only records 0x0 or some garbage, now what I expect. Interestingly, the same behavior occurs even if the multiplexer is deliberately misconfigured or not configured at all.

What could be the problem?

Configuring ecspi from the .dts file:
pinctrl_ecspi2: ecspi2grp {
   fsl,pins = <
      MX8MP_IOMUXC_I2C3_SCL__ECSPI2_SCLK      0x82
      MX8MP_IOMUXC_I2C3_SDA__ECSPI2_MOSI      0x82
      MX8MP_IOMUXC_I2C4_SCL__ECSPI2_MISO      0x82
      MX8MP_IOMUXC_ECSPI2_SS0__GPIO5_IO13      0x82
      MX8MP_IOMUXC_SD2_CD_B__GPIO2_IO12          0x146
   >;
};

Initializing ECSPI code:
    /* Master config:
     * masterConfig.channel = kECSPI_Channel0;
     * masterConfig.burstLength = 8;
     * masterConfig.samplePeriodClock = kECSPI_spiClock;
     * masterConfig.baudRate_Bps = TRANSFER_BAUDRATE;
     * masterConfig.chipSelectDelay = 0;
     * masterConfig.samplePeriod = 0;
     * masterConfig.txFifoThreshold = 1;
     * masterConfig.rxFifoThreshold = 0;
     */
    ECSPI_MasterGetDefaultConfig(&masterConfig);

    masterConfig.channelConfig.phase = kECSPI_ClockPhaseSecondEdge;
    masterConfig.baudRate_Bps = TRANSFER_BAUDRATE;

    ECSPI_MasterInit(EXAMPLE_ECSPI_MASTER_BASEADDR, &masterConfig, ECSPI_MASTER_CLK_FREQ);

« Last Edit: January 17, 2024, 04:04:19 pm by teleportboy »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

- - -
-->