This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RTOS/PROCESSOR-SDK-AM335X: Incorrect SPI CS signal

Part Number: PROCESSOR-SDK-AM335X

Tool/software: TI-RTOS

1. SINGLE mode

  The initialization code is attached:

MX25L_Handle EEPROM_open(uint32_t bps)
{
    SPI_Params spiParams;                /* SPI params structure */
    MX25L_Handle pHandle;            /* EEPROM handle */
    SPI_HWAttrs spi_cfg;

    /* Get the default SPI init configurations */
    SPI_socGetInitCfg(MCSPI_INSTANCE - 1, &spi_cfg);
    spi_cfg.chNum = 0;
    spi_cfg.enableIntr = false;
    spi_cfg.rxTrigLvl = 1;
    spi_cfg.txTrigLvl = 1;
    spi_cfg.chMode = MCSPI_SINGLE_CH;
    spi_cfg.rxDmaEventNumber = CSL_EDMA3_CHA0_MCSPI1_RX;
    spi_cfg.txDmaEventNumber = CSL_EDMA3_CHA0_MCSPI1_TX;
    spi_cfg.edmaHandle = MCSPIApp_edmaInit();
    spi_cfg.dmaMode = true;

    /* Set the SPI init configurations */
    SPI_socSetInitCfg(MCSPI_INSTANCE - 1, &spi_cfg);

    /* Init SPI driver */
    SPI_init();

    /* Default SPI configuration parameters */
    SPI_Params_init(&spiParams);
    spiParams.bitRate = bps;//24000U;//24000000U

    /* Open QSPI driver */
    pHandle = &eepromObject;
    /* Open SPI driver for SF25FL */
    pHandle->spiHandle = SPI_open((MCSPI_INSTANCE - 1), &spiParams);

    return pHandle;
}

waveform:

Problem:  Why is the negative pulse width of CS signal so large?    I did‘t user delay function.

2. MULTI Mode

  The initialization code is attached:

MX25L_Handle EEPROM_open(uint32_t bps)
{
    SPI_Params spiParams;                /* SPI params structure */
    MX25L_Handle pHandle;            /* EEPROM handle */
    SPI_HWAttrs spi_cfg;

    /* Get the default SPI init configurations */
    SPI_socGetInitCfg(MCSPI_INSTANCE - 1, &spi_cfg);
    spi_cfg.chNum = 0;
    spi_cfg.enableIntr = false;
    spi_cfg.rxTrigLvl = 1;
    spi_cfg.txTrigLvl = 1;
    spi_cfg.chMode = MCSPI_MULTI_CH;
    spi_cfg.rxDmaEventNumber = CSL_EDMA3_CHA0_MCSPI1_RX;
    spi_cfg.txDmaEventNumber = CSL_EDMA3_CHA0_MCSPI1_TX;
    spi_cfg.edmaHandle = MCSPIApp_edmaInit();
    spi_cfg.dmaMode = true;

    /* Set the SPI init configurations */
    SPI_socSetInitCfg(MCSPI_INSTANCE - 1, &spi_cfg);

    /* Init SPI driver */
    SPI_init();

    /* Default SPI configuration parameters */
    SPI_Params_init(&spiParams);
    spiParams.bitRate = bps;//24000U;//24000000U

    /* Open QSPI driver */
    pHandle = &eepromObject;
    /* Open SPI driver for SF25FL */
    pHandle->spiHandle = SPI_open((MCSPI_INSTANCE - 1), &spiParams);

    return pHandle;
}

waveform:

Problem: Send two bytes at a time with the SPI, But an abnormal pulse occurred in the CS signal?

MCSPI_MULTI_CH

  • The RTOS team have been notified. They will respond here.
  • Hi,

    Can you elaborate what Processor SDK RTOS release is used for this and what driver example tested? And what TI EVM and pins are used to monitor the waveform? Thanks!

    Regards, Eric
  • hi,

     "ti-processor-sdk-rtos-am335x-evm-04.01.00.06-Linux-x86-Install".

    I change the demo  "MCSPI_SerialFlash_Dma_evmAM335x_armTestProject" for my own project. and use SPI1-Channel 0 to read and write flash. and SPI Clk is 16MHz. 

    SPI1 PINMUX Configure:(The yellow Waveform is "spi1_sclk -> A13"  ; green Waveform is "spi1_cs0 -> C12")

    static pinmuxPerCfg_t gMcspi1PinCfg[] =
    {
        {
           /* SPI1 -> spi1_sclk -> A13 */
           PIN_MCASP0_ACLKX, 0, \
           ( \
               PIN_MODE(3) | \
               ((PIN_PULL_UD_EN | PIN_RX_ACTIVE) & (~PIN_PULL_TYPE_SEL)) \
           ) \
        },
        {
           /* SPI1 -> spi1_d0 -> B13 */
           PIN_MCASP0_FSX, 0, \
           ( \
               PIN_MODE(3) | \
               ((PIN_PULL_UD_EN | PIN_RX_ACTIVE) & (~PIN_PULL_TYPE_SEL)) \
           ) \
        },
        {
           /* SPI1 -> spi1_d1 -> D12 */
           PIN_MCASP0_AXR0, 0, \
           ( \
               PIN_MODE(3) | \
               ((PIN_PULL_TYPE_SEL | PIN_RX_ACTIVE) & (~PIN_PULL_UD_EN)) \
           ) \
        },
        {
           /* SPI1 -> spi1_cs0 -> C12 */
           PIN_MCASP0_AHCLKR, 0, \
           ( \
               PIN_MODE(3) | \
               ((PIN_PULL_TYPE_SEL | PIN_RX_ACTIVE) & (~PIN_PULL_UD_EN)) \
           ) \
        },
        {
           /* SPI1 -> spi1_cs1 -> A15 */
           PIN_XDMA_EVENT_INTR0, 0, \
           ( \
               PIN_MODE(4) | \
               ((PIN_PULL_TYPE_SEL | PIN_RX_ACTIVE) & (~PIN_PULL_UD_EN)) \
           ) \
        },
        {PINMUX_INVALID_PIN}
    };

     

    spi1_sclk -> A13
  • Hi, 

    Is there any progress?