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.

CC2340 SPI Drive

Other Parts Discussed in Thread: CC2340R5, SYSCONFIG

Hello.

I am under development with the CC2340.

I'm asking about the SPI_transfer() function.
The source code was structured as follows.
vListInsert() is called during SPI_transfer() function operation.
Please tell me the cause.

Is there a maximum value for transaction.count ?
In CC2642, it worked normally.

Thanks.

  • Hi,

    Thank you for reaching out and evaluating the CC2340Rx devices.

    I am afraid I cannot find the call to vListInsert() in the SPICC23XXDMA.c file. Could you please be more specific so I can help?

    From a theoretical point of view transaction.count is only limited by the size of the parameter count (2 bytes). In practice, you may be limited by the length of consecutive memory available, the length of each transfer, etc.

    To finish, in case you have not mentioned it so far, we have released a new CC23xx SDK (available on the MySecureResources repository) with some patch files are provided for the SPI driver.

    I hope this will help,

    Best regards,

  • I'm sorry. The explanation was lacking.

    I'm using simple_peripheral_LE_EM_CC2340R5_freertos_ticlang from simplelink_cc23xx_sdk_6_20_00_20_eng.

    If you set as below and execute SPI_transfer() function, Freertos vListInsert(list.c) function is called.


    If I set the transaction.count value to 8 or less, there is no problem.


    I have applied the updated spi driver and still have the same issue.

  • Hi,

    We are aware of a few issues with the SPI driver in SDK 6.20. Please migrate to 6.30.

    Thank you for your comprehension.

    Best regards,

  • Migration to SDK version 6.30.00.20 is complete.


    However, I am getting the same problem.
    In a Freertos environment, if transaction.count value is set to 9 or higher and SPI_transfer() function is executed, vListInsert() function is called.
    Can't pass a lot of data at once?

  • Hi,

    Thank you for the effort.

    May I ask if you have applied the SPI patches (files SPICC23XXDMA.h and SPICC23XXDMA.c) in the MySecureResources folder? These files should be copied in your project to make sure the linker uses these files and not the pre-compiled library.

    Best regards,

  • Yes, I did the SPI patch.

    I think it's related to freertos, not SPI's API problem.

    SPI communication reads tx/rx values well.

    However, while the SPI_transfer() function is running, it jumps to the vListInsert() function and becomes a hang state.

  • Hi,

    Yes, I did the SPI patch.

    This is not what I meant - you should include the SPI files to your CCS project, for example by copy-pasting them at the root of it. Otherwise, the linker will use the pre-compiled library instead of the modified source files.
    Again, I strongly recommend this patch before going any further.

    Once the patch is properly implemented, you can try the following:

    In a Freertos environment, if transaction.count value is set to 9 or higher and SPI_transfer() function is executed, vListInsert() function is called.
    Can't pass a lot of data at once?

    May I kindly ask what is the value you have set "Min DMA Transfer Size"? This value can be set using SysConfig  > TI Drivers > SPI > Min DMA Transfer Size

    I hope this will help,

    Best regards,

  • Hi.

    I downloaded the files SPICC23XXDMA.c / SPICC23XXDMA.h and copy pasted them into ti\simplelink_cc23xx_sdk_6_30_00_20_eng\source\ti\drivers\spi.
    I am using the simplelink_cc23xx_sdk_6_30_00_20_eng example code as it is.
    And I set the minimum DMA transfer size to 10.

    I have an additional question.

    I am using CC2340R5 Development kit to test.
    I wonder why the break point is not working when I run the program in Debug mode.

  • Hi,

    Thank you for the details provided.

    I downloaded the files SPICC23XXDMA.c / SPICC23XXDMA.h and copy pasted them into ti\simplelink_cc23xx_sdk_6_30_00_20_eng\source\ti\drivers\spi.
    I am using the simplelink_cc23xx_sdk_6_30_00_20_eng example code as it is.

    This actually does NOT patch the SPI code.
    To patch the SPI, you should copy the files in your CCS project:

    1. Open CCS
    2. Import the project you want
    3. Copy the two files from the MSR repository
    4. Paste the files in the CCS project
    5. Rebuild the project (right click on the project, "Rebuild Project)"

    Once the previous is done, please run a new test.

    Then, you can consider trying to increase the "Min DMA Transfer Size".

    This value can be set using SysConfig  > TI Drivers > SPI > Min DMA Transfer Size

    I hope this will help,

    Best regards,

  • Hi again,

    I missed your additional question:

    I am using CC2340R5 Development kit to test.
    I wonder why the break point is not working when I run the program in Debug mode.

    Please refer to the debugging guide included in the SDK.

    Best regards,