• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Embedded Software » BIOS » BIOS forum » Socket creation : invalid task priority
Share
BIOS
  • Forum
  • Announcements
Options
  • Subscribe via RSS

Forums

Socket creation : invalid task priority

This question is answered
Soumya Sardar
Posted by Soumya Sardar
on May 16 2012 22:35 PM
Intellectual510 points

Hi,

Using sys bios6 from 6616 simulator..

Trying to create socket from a user defined task and getting error "

ti.sysbios.knl.Task: line 895: assertion failure: A_badPriority: An invalid task priority was used"

Task created like below:

Task_Params taskParams;

Task_Params_init(&taskParams);

taskParams.stackSize = 1024;

taskParams.priority = 15;

taskParams.instance->name =

"my task";

taskParams.arg0 = 2;

Error_Block eb;

Error_init(&eb);

task = Task_create(taskFxn, &taskParams, &eb);

 

Socket function called and getting error from below line.

if(0 > (fd_ = ::socket(sockDomain, sockType, protocol)))

 

Please let me know why this is happening...Also this is not done in idle task as NDK may try to increase the priotiy. So why this problem is happening in a user defined task?

regards

Soumya

Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • Nick Bedbury78040
    Posted by Nick Bedbury78040
    on May 17 2012 09:16 AM
    Expert1345 points

    Do you setup a file descriptor (fd) session before calling the socket function?  This can be done in the Task itself.  e.g.:

    static HANDLE hMyTask=0;

    hMyTask = TaskCreate(taskFxn, "&tskFxn", OS_TASKPRINORM, OS_TASKSTKNORM, 0,0, 0);
    fdOpenSession(hMyTask);

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • MarkGrosen
    Posted by MarkGrosen
    on May 17 2012 11:27 AM
    Verified Answer
    Verified by David Friedland
    Expert3445 points

    Soumya,

    The network stack subsystem internally uses tasks. It relies on task priorities to insure mutual exclusion so internal data structures are not corrupted. This means that application tasks that use networking need to have priorities lower than the network stack task(s) priority. This is documented in the NDK Reference Guide in Section 2.1.1. The default network task priority is 9, so your example above with priority of 15 will not work. It needs to be priority 7 or lower (explained in doc above). You can change the priority settings for the network stack through the graphical config tool (if you are using that) or via the C code that initializes the stack.

    Mark

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Soumya Sardar
    Posted by Soumya Sardar
    on May 17 2012 22:38 PM
    Intellectual510 points

    Hi Nick and Mark,

    Thanks for your response.The priority problem is solved but still the socket is not getting created.

    I saw at ROV that NDK task running at priority 5, i kept my app task priority at 1. Also I have used fdOpenSession() with task handle before creating the socket. But still the socket descriptor value is 0xffffffff. Also the fderror() output is also coming 0xffffffff.

     I have put almost all the section in DDR3 still its OOM coming..is it the problem?

    [TMS320C66x_0] 00000.000 fdOpenSession: OOM

    [TMS320C66x_0] socket descriptor = ffffffff ffffffff

    Please note I have configured my ccsv5 simulator as per http://processors.wiki.ti.com/index.php/BIOS_MCSDK_2.0_User_Guide#Building_and_running_NDK_client_example_with_simulator.

    Please help me to solve this problem.

    Code block:

    fdOpenSession(task);  

    if ((s=socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP))== INVALID_SOCKET)


    System_printf(" socket descriptor = %x %x\n",s, fdError());

     

    Regards

    Soumya

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Steven Connell
    Posted by Steven Connell
    on May 18 2012 17:32 PM
    Mastermind20540 points

    Soumya,

    This looks like your heap is all used up.  You can verify in ROV under heaps.

    You can set/increase the heap size in your *.cfg file with the following:

        BIOS.heapSize = <desired heap size>;

    Steve

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Soumya Sardar
    Posted by Soumya Sardar
    on May 21 2012 01:43 AM
    Intellectual510 points

    Well this got solved when I executed the same from the call back of Netstart.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.

© Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use