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.

adding task hooks

Other Parts Discussed in Thread: SYSBIOS

I'm using CCSv5, SysBios 6.33, NDK 2.21.  I'm trying to install taskCreate, taskDelete and taskExit hooks.  I haven't found a way to do this with the GUI, so I added the following lines to the .cfg file by hand:

/*
* Hand addition to try to get hooks in for task create/delete/exit
*/
var hooks = new Task.HookSet();
hooks.createFxn = '&insertTaskTrack';
hooks.deleteFxn = '&deleteTaskTrack';
hooks.exitFxn = '&exitTaskTrack';
Task.addHookSet(hooks);

After adding these lines to the .cfg file, I can see the hooks showing up in the XGCONF/Task/Advanced tab, but they aren't getting called.  

If there were a way to do this with the GUI, I would prefer it, but I would settle for anything that can make the hooks work.  Any ideas?

  • Your hook declarations look correct to me. 

    Do none of them get called? I'd expect the create hook to definitely get called.

    But the delete and exit hooks only get called when tasks are deleted and if there task function falls thru the bottom, respectively. 

    Alan

  • Can you try this syntax for adding your hook set instead:

    Task.addHookSet({
         createFxn:   '&insertTaskTrack',
         exitFxn:        '&exitTaskTrack',
         deleteFxn:    '&deleteTaskTrack'
    });

    I'm not confident about using new Task.HookSet();

    All of our regression tests use the syntax I suggest.

    Alan

  • Thank you for your suggestions.

    My method of determining if the function is called is to set a breakpoint in it - early, before any conditional statements.  I don't reach that breakpoint.  Or so it seemed.  After it failed again with the modified .cfg file, I started to be suspicious of the breakpoint.  I could see the little blue dot, and it was listed in the breakpoints tab, but I still wasn't sure, so I deleted all the breakpoints, closed and re-opened the file in the debug view, and reset the breakpoint after getting to the start of main.  Then I hit it.

    So, I think that this whole thing may have been a false alarm.  I'm sorry to have troubled you.

    Just a note on the earlier method with "new".  It also worked.  I had found that method in one of the NDK files and copied it.  It's comforting to know that the method used by the NDK does work.

    Sorry again, and thanks again.

  • Hello,

    I know that the Hooks are created by adding below text in .cfg file.

    /* Hook Set 1 */
    Swi.addHookSet({
          registerFxn: '&myRegister1',
          createFxn: '&myCreate1',
          readyFxn: '&myReady1',
          beginFxn: '&myBegin1',
          endFxn: '&myEnd1',
          deleteFxn: '&myDelete1'
    });

    What I want to know is that , is there any graphical way to add Hooks (Swi Hookfor example)? So, that I dont have to write in .cfg file but the stuff in .cfg file shall come automatically. (i.e. when I apply XGCONFG-->BIOS--> Use BIOS, then the entry shall appear in .cfg file...Similar for Hooks)

    Thanks in advance.

  • Hi Priyank Soni,

    I don't see a way to do this from the GUI.

    However, it's perfectly acceptable to modify your configuration by using a text editor.  Just be sure to close any XGCONF views of that configuration file before editing.

    Once you've added changes textually, save and close the *.cfg file and then open again in XGCONF.  Any changes you make in XGCONF will then be added to the text of the *.cfg file, and your Swi hook settings should remain in the file.

    Steve

  • Hello Steven,

    Thanks for the information.

    /Priyank