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.

Static vs Dynamic BIOS Object Creation

Other Parts Discussed in Thread: SYSBIOS

I am returning NULL when calling  Task_create stepping through the calls shed no light on what the issue was how can I get more info on what is causing this?

When creating Tasks or any objects statically using .cfg file is their any error check done for the same call? and where is the actual code that does the creation placed so I inspect it?

  • Mark,
    when you dynamically create a Task instance, the call ends up in alloc() function of your configured heap manager. You can probably find out from your config script which heap manager you are using, and it's probably one of SYS/BIOS heap managers (HeapMem for example). You should be able to set up a breakpoint on alloc() function for that heap manager. For HeapMem, the name of the function is _ti_sysbios_heaps_HeapMem_alloc__E, with or without leading underscore depending on whether you are building for COFF or ELF. Most of heap managers return NULL when there is no more memory available.

    The call stack from Task_create to HeapMem_alloc goes through several functions, but to figure out the return value NULL, I would start in HeapMem_alloc (or alloc for any other heap manager you might be using). You can also check Task_Instance_init. That function initializes Task instances, but if there is no enough memory you may not even reach Task_Instance_init.

    When you create objects statically, they are laid out in arrays in the generated C file, so at that time there are no any memory availability checks.

  • I was looking for specific error codes returned by RTOS API. you can close this we decided can't use dynamic memory allocation