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.

C6747 NDK Ethernet Transfer Large File

Other Parts Discussed in Thread: SYSBIOS

SYS/BIOS : 6.41.0.26

NDK: 2.24.1.18

I need to transfer a file around 1 Gigabyte big from the C6747 to a host PC. We have decided to transfer the file using ethernet. The program has multiple hwis and tasks running, and all of these need to be disabled when the file transfer takes place. However, I cannot disable everything as the socket calls to transfer the file use semaphores. Specifically, this error occurs.

ti.sysbios.knl.Semaphore: line 208: assertion failure: A_pendTaskDisabled: Cannot call Semaphore_pend() while the Task or Swi scheduler is disabled.

How can I disable everything but the file transfer task and the NDK tasks needed to run the ethernet?

  • Hi Josh,

    I am not sure I completely understand what you are trying to do here. Are you wanting to temporarily disable all other application tasks so they do not interfere with the file transfer ? If so, you could temporarily lower each task's priority below NDK low priority. If you do a Task_disable() or Swi_disable(), the NDK stack may not function correctly.

    Best,
    Ashish
  • Currently, I have a loop that looks like this:

    while (bytesSent < 1000000000)
    {
    bytesSent += send(clientSoc, outString, strlen(outString), 0);
    }

    I want the loop to be the only thing running when it gets to this point, as the transfer needs to happen as fast as possible. I want to disable everything the bios can do that will cause this loop the be interrupted.

    Edit:

    outString is a dummy string containing 1000 characters.

    Currently, we are only able to transfer 1-2 packets per second.

    Link is at 100Mbs Full Duplex

  • Hi Josh,

    What socket protocol are you using ? If it is TCP then you can try increasing the TCP transmitBufSize to help improve throughput. For C67x the buffer size should be 8K by default and can be increased up to 64K. You would also need to make sure that the host side TCP receive buffer size is big enough.

    In order to ensure that your networking app task is not pre-empted by some other app task in your system, you can always raise your task's priority. If you do this, you have to be careful that your task's CPU utilization is not very high as this would starve the network stack of CPU time and prevent it from functioning properly. I believe the send() function you are using in your while loop will block once the transmit buffers fill up so it should be fine to call send() in a loop.

    Best,
    Ashish
  • I am using TCP.

    I added the TCP module to my SYSBIOS and changed the default send buffer size to 64k, but that did not help. The receiving end is a simple java program that creates a client socket, connects to a server, then reads from the socket and writes to a file. I tested the java client with a java server and was able to transfer a gigabyte within 10 seconds.

    What is the highest priority I can make this task without it interfering with the network stack?
  • I found my issue, it appears there was a recv call being made in the transfer loop. Removing the call has fixed everything, thank you for your support.