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.

CC3220SF: Is DMA shared between Network and external Peripheral SPI?

Part Number: CC3220SF

I am using CC3220SF to communicate the sensor and other data with another MCU c2000. Also, simultaneously I am using networking functionality where CC3220SF is in AP mode and the data sharing protocol is HTTP.  SPI communication with MCU c2000 has a large size of sensor data and uses DMA on cc3220SF. I see that Networking threads also use the DMA functionality. While serving both peripheral SPI and HTTP data GET request, I faced an issue where HTTP GET Requests were getting declined. Then I had to implement mutex between network data send and SPI data send, it started working fine. So Can you please help that if DMA is getting shared in between these two applications and if it is than how to solve the issue? 

  • Hi,

    I will look into it on Sunday.

    BR,

    Shlomi 

  • Hi,

    The uDMA is indeed the main DMA that is used across many clients. Two of the clients are the GSPI for communication with the C2000 in your case and the HSPI to communicate between the NWP and the CM4 (internally). The DMA is also used by other clients that yo do not see like the HW accelerators, memory transactions, the logger pins, etc.

    Basically, the uDMA arbitrates between all client according to priorities so nothing is expected from the developer.

    In your case, would be good to see what exactly fails with the HTTP GET requests. Do you have a way to extract NWP logs? are you using the internal HTTP server or an external server running on the host?

    Regardless, if adding a mutex solves your problem, it can be used as a mitigation.

    regards,

    Shlomi

  • Dear Shlomi,

    Thank you for your input.

    I have a application where CC3220SF GSPI should communicate to SPI of C2000 continuously. Let's say for 500ksps of SPI , in each 20ms of time period, data needs to be communicated for 6ms. So, this means DMA should be allocated to GSPI for 6ms in CC3220SF to receive the data. But, In between If I am getting a HTTP GET request to send same data to HTTP client, { where CC3220SF is having an HTTP server(I am not aware about external and internal server differences). I have created an HTTP Server similar to portable example. } from HTTP server, then how to sync both HTTP GET request uDMA access and GSPI uDMA Access? or, I don't have to worry about it? Will assigning different priorities will help me? if yes, can you please help me with some example? Also, any example where GSPI is communicating with some external SPI and HTTP Server is enabled on CC3220SF will be appreciated. 

    I don't have extract of NWP logs. Do you suggest any way to do so? 

    Thank you.

    Best Regards,

    Kuldeep

  • Hi,

    Can you clarify on the rate? you said "500ksps of SPI , in each 20ms of time period, data needs to be communicated for 6ms.". What is a sample in your case? is this transmitted in a 6ms time?

    If you are using the http server portable example, then you are using an external web server and not the internal one.

    There is no example combining both and as I mentioned, the DMA should automatically do it but I first need to understand the amount of data you are trying to send to the c2000 since this might be the bottleneck.

    You can find information on the logger in the NWP user guide, chapter 20 https://www.ti.com/lit/ug/swru455m/swru455m.pdf?ts=1707091350367

    Regards,

    Shlomi

  • Dear Shlomi,

    Thank you for your input.

    Yes, the data transferred from c2000 to cc3220sf in each 20ms is 824 Bytes(6,592bits) or (412 16bit data) which takes 6.592ms with 1Mbps. 

    Also, Can you please help me understand how to identify the internal and external webservers?

    Thank you.

    Best Regards,

    Kuldeep

  • OK, so the throughput is not to high. I wouldn't expect issues. Any reason why you set the SPI clock to a minimum of 1MHz? If you set it higher, the time it takes to move the data using the DMA would be reduced.

    As for the internal vs. external server, for the internal server uses dedicated APIs to get and send HTTP data (and set the server). You can look for the netapp related APIs like sl_NetAppSend() and sl_NetAppRecv() in the code. For further reading, you can refer to the HTTP server paragraph in the NWP user guide.

    Regards,

    Shlomi

  • Dear Shlomi,

    I kept that based on SPI of C2000. I will check if I can increase it there and will modify it here accordingly.

    As I have checked, my code uses for sl_NetAppSend() and sl_NetAppRecv()  only as per dev.ti.com/.../node. Still, is it possible that it is using external server?

    Thank you.

    Best Regards,

    Kuldeep

  • Hi,

    OK, please check.

    If it uses these APIs, you are using the internal web server. You can use an external server unless you have a dedicated code that implements it.

    Regards,

    Shlomi

  • Dear Shlomi,

    I was able to increase the SPI clock to 10MHz. Both SPI and Network applications are working fine, mutex helped me in this case.

    Thank you for your help.

    Best Regards,

    Kuldeep

  • sure, thanks for the update.