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.

Ethercat example using SPI on ICE Board,

Hello,

i have the ethercat example running. On J12 the SPI0 is connected. I want to use this SPI0.

I saw in the Ethercat example code that SPI0 is using:

    if (AM335X_BOARD_TYPE_ICE_V2 == boardType)
    {
        InitCpswIcssPorts(ICSS_SWITCH);
        //McSPI instance 0 on ICE V2
        SpiFlashInit(0);        
    }    
    else if( AM335X_BOARD_TYPE_ICE == boardType )
    {
        //McSPI instance 0 on ICE
       SpiFlashInit(0);
    }else
    {
        //McSPI instance 1 on IDK
        SpiFlashInit(1);
    }

Is this necessary for ethercat? If i commented SpiFlashInit(0); then it seems that TwinCAT can send and receive data via etherCat.

Regards,

Daniel

  • Moving this to the SYS/BIOS forum.

  • Hi Daniel,

                 Ethercat application uses SPI flash for the non volatile storage of EEPROM information and also for the Online Application upgrade.  These features wont be available if you dont use the SPI Flash.

    You should be able to use the SPI0 in multi-channel mode for your implementation

    Thanks,

    Prajith

     

  • Thank you,

    it´s good to know.

    I´ve commented the SPI0Flash() function and don´t use it at this time. So this function saves some code from the ethercat stack in the EEPROM ?  The EtherCat example is still working, also withput SpiFlash.

    I changed in the command file the storage from SRAm to DDR, because i cant read a variable (SPI-tx-rx-buffer) when it was in the adress range 0x4....... With DDR at adress 0x8.... it works.

    Okay, due some changes, i still need SPI (SPI0 i think it´s easier, because its connected on J12). But i´ve to change SPI Master to SPI Slave .

    Thanks for the hint with multi-channel, but in slave mode i cannot use it. I want to use SPI slave in 3wire mode without ChipSelect/Enable.

    Based on that the EtherCat example works without SPI0Flash i think i can let it commented?