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.

TMS570LS1115: HalCoGEn MIBSPI1 transfer group

Part Number: TMS570LS1115
Other Parts Discussed in Thread: HALCOGEN,

Is there any issues with using HalCoGen V04.06.00 for TMS570LS1115 to configure MIBSPI1 transfer groups 6 & 7 ? Have same issue on MIBSPI3.

I can successfully use transfer groups 0-5.  All my transfer groups are configured the same except for the Data Length.  Total buffers is less than 128.

Observe the data/clock transfer with a scope and only have issues with Transfer Group 6, 7.   Not using notifications for Group 6,7.

Transfer Group

0         = 1 byte data

1         = 2 bytes data

2         = 9 bytes data

3         = 65 bytes data

4         = 3 bytes data

5         = 18 bytes data

6         = 10 bytes data  ** fails to send clk + data

7         = 6 bytes data ** fails to send clk + data

Any suggestions on why Groups 6,7 are not working ?

Regards

Rob

  • Hello Bob,

    Are all the group used for the same chip select? or they are assigned to different chip select? In default, the HALCoGen assigns group 0 to CS0, group 1 to CS1, ... group 7 to CS7. The MibSPI1 and MibSPI3 don't have CS6 and CS7.

    Regards,
    QJ
  • Hi QJ,

    I am not using the CS option.  Have selected NONE in HalCoGen.  I use a GPIO line for CS which i control manually.  

    All the groups are connected to the same CS.

    Interesting that the two groups i am having issues with are different to the groups that are working...

    Any other suggestions ?


    Rob

  • Hi QJ,

    i have done some more testing on this issue and still cannot resolve. Seems there is a bug in the HALCoGen mibspi.c file generated although i have had a quick review of mibspi.c and it seems ok.

    My test function is as follows,

    /*--------------------------------------------------------*/
    void Debug_Test_SPI_Groups(void)
    {
    uint16_t Buffer[64];

    Set_Output_SPI1_CS();
    mibspiInit();

    /*
    * HALCoGen Configuration
    *
    * MIBSPI1 DATA FORMATS
    *
    * Data Format 0
    *
    * Baudrate (Khz): 4000
    * Wdelay: 0
    * CharLen: 8
    * Clock Phase: Enabled
    *
    * MIPSPI1 Delays
    *
    * Chip Select to Active Start 33.33 nS
    * Transit End to Chip Select Inactive 22.22 nS
    * Chip Select to ENA Timeout 0.00 nS
    * Transmit Finish to ENA Inactive Timeout 0.00 nS
    *
    * MIBSPI1 Transfer Groups
    *
    * Transfer Group Common
    *
    * Chip Select: CS_NONE
    * Data Format: 0
    * Lock Transmission: Not Selected
    * Buffer Mode: 4
    * Enable WDELAY: Not Selected
    * Chip Select Hold: Not Selected
    *
    * One Shot Transfer: Selected
    * Use Encode Chip Select: Not Selected
    * Chip Select Hold: Not Selected
    * Trigger Events: TRG_ALWAYS
    * Trigger Source: TRG_DISABLED
    * Transfer Group Pointer Reset: Not Selected
    *
    * Transfer Group 0 - Length 1
    * Transfer Group 1 - Length 2
    * Transfer Group 2 - Length 9
    * Transfer Group 3 - Length 65
    * Transfer Group 4 - Length 3
    * Transfer Group 5 - Length 18
    * Transfer Group 6 - Length 6 ** not working
    * Transfer Group 7 - Length 10 ** not working
    *
    */

    /*
    * doesn't matter which order below code is executed, always fails on groups 6 & 7
    */

    /*
    * Test Group 5 Transfer, this works OK, scope triggered on falling edge of CS
    */
    Clear_Output_SPI1_CS(); /* Chip Select Low */
    mibspiSetData(mibspiREG1, 5U, Buffer);
    mibspiTransfer(mibspiREG1, 5U);

    while (!( mibspiIsTransferComplete(mibspiREG1, 5U) ))
    {
    }
    Set_Output_SPI1_CS(); /* Chip Select High End of Transfer */

    /*
    * Test Group 6 Transfer, FAILS
    */
    Clear_Output_SPI1_CS(); /* Chip Select Low */
    mibspiSetData(mibspiREG1, 6U, Buffer);
    mibspiTransfer(mibspiREG1, 6U);

    while (!( mibspiIsTransferComplete(mibspiREG1, 6U) ))
    {
    }
    Set_Output_SPI1_CS(); /* Chip Select High End of Transfer */

    /*
    * Test Group 7 Transfer, FAILS
    */
    Clear_Output_SPI1_CS(); /* Chip Select Low */
    mibspiSetData(mibspiREG1, 7U, SPI_1_TX_Big_Buffer);
    mibspiTransfer(mibspiREG1, 7U);

    while (!( mibspiIsTransferComplete(mibspiREG1, 7U) ))
    {
    }
    Set_Output_SPI1_CS();/* Chip Select High End of Transfer */

    while(1); /* never gets here as hangs at Group6 Transfer */
    }

    /*--------------------------------------------------------*/

    I observe correct operation of SPI for Group5, but when i run the test code for Group6 & 7 i see no SPI activity.

    Any suggestions ?

    I would like to attach HalCoGen files but i cant see how to attach files here...

    Regards
    Rob