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.

RTOS/CC3200: System abort hook always default

Part Number: CC3200

Tool/software: TI-RTOS

Hello,

I'm trying to change the abort hook to another function. So I made this change: I can see that the change has been made. The file projectname_pem4.c has these lines:

/* --> systemAbort */
extern xdc_Void systemAbort(xdc_Void);

/* abortFxn__C */
#pragma DATA_SECTION(xdc_runtime_System_abortFxn__C, ".const:xdc_runtime_System_abortFxn__C");
__FAR__ const CT__xdc_runtime_System_abortFxn xdc_runtime_System_abortFxn__C = ((CT__xdc_runtime_System_abortFxn)((xdc_Fxn)systemAbort));

However, when I call System_abort() it executes what is defined in xdctoolsdirectory/packages/xdc/runtime/System.h

/* abort__E */
#define xdc_runtime_System_abort xdc_runtime_System_abort__E
xdc__CODESECT(xdc_runtime_System_abort__E, "xdc_runtime_System_abort")
__extern xdc_Void xdc_runtime_System_abort__E( xdc_CString str );

which is the standard abort function.

What is the difference between the __E and the __C functions? How am I supposed to change the __E version or why is it linking against that one and not what I tell it through the configuration?

Thanks in advance!

  • Hi Rodrigo,

    System_abort() is a wrapper function that is called by TI-RTOS Kernel when the application aborts. System_abort() internally calls the support proxy's abort function followed by the abort hook (System_abortFxn). Here's how System_abort() is implemented:

    Void System_abort(CString str)
    {
        Gate_enterSystem();
    
        System_SupportProxy_abort(str);
    
        System_abortFxn();
    }

    In case you want to install your own abort function, I would suggest changing the System module's support proxy as follows:

    var System = xdc.useModule('xdc.runtime.System');
    var SysCallback = xdc.useModule('xdc.runtime.SysCallback');
    System.SupportProxy = SysCallback;
    SysCallback.abortFxn = "&myUserAbort";

    If "myUserAbort" returns then System.abortFxn (which you set to your own systemAbort function) will be called.

    Best,

    Ashish

  • Thank you for your answer.
    Could you please explain what does that thing I did change, then?
  • Hi Rodrigo,

    If I understand your question correctly, you want to know why did the abort hook you set before did not work. Like I said before, System_abort() is a wrapper function that calls it's support proxy's abort function and the abort hook. I presume the default support proxy's abort function was never returning, therefore, the abort hook never got called.

    The change I suggested in my previous post would change the System module's proxy to SysCallback and install your abort function as the proxy's abort function.

    Hope I answered your question.

    Best,
    Ashish
  • Is there a way I can do that and still keep the System_printf from SysStd?
  • Hi Rodrigo,
    We generally discourage posting a new question to an old closed thread because the person who answered before may no longer be available, and also it will allow whomever is currently assigned to monitor the forum to respond to you more quickly. For these reasons, I suggest you start a new thread with your question and reference this thread.


    Thank you