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.

output location of assert

Other Parts Discussed in Thread: CC1310, SYSBIOS

Hi

I have a cc1310 launchpad and am working with the rfPactErrorRate example project.

My setup is ccs v6.1.3.00033

I enabled the assert runtime manager through CCS and set the diags_INTERNAL to ALWAYS_ON in the CCS/TI-RTOS/Products/SYSBIOS/Diagnostics/Assert/xdc.runtime screen (for lack of a better way to describe it).

I then ensured that an Assert_isTrue(test,NULL) ;  would trigger...but i dont see where the output from the assertion manager is displayed.

So my question is: where is the assertion output SUPPOSED to be displayed?

thanks

  • Hi Moshe,

    What version of TI-RTOS are you using?

    In general, when an assert fails an Error will be raised via Error_raise().  Some description is here: rtsc.eclipse.org/.../Assert.html

    What happens on Error_raise() depends upon the error policy configuration, as described here: rtsc.eclipse.org/.../index.html

    Can you please post the contents of your application configuration file (with .cfg extension), specifically the xdc.runtime.Error settings?

    Thanks,
    Scott

  • Hi Scott.

    tirtos_cc13xx_cc26xx_2_20_00_06

    this is from the .cfg file:

    var Assert = xdc.useModule('xdc.runtime.Assert');
    var Defaults = xdc.useModule('xdc.runtime.Defaults');
    
    
    /* ================ Error configuration ================ */
    var Error = xdc.useModule('xdc.runtime.Error');
    Error.policyFxn = Error.policySpin;
    Error.raiseHook = null;
    Error.maxDepth = 2;
    
    /* ================ TI-RTOS drivers' configuration ================ */
    var driversConfig = xdc.useModule('ti.drivers.Config');
    driversConfig.libType = driversConfig.LibType_NonInstrumented;
    Assert.common$.diags_INTERNAL = xdc.module("xdc.runtime.Diags").ALWAYS_ON;
    

    and this is from the xdc.runtime properties screen

  • Hi Moshe,

    Thanks for sending your configuration settings.

    Your error policy is set to “Error.policySpin”.  This means that when the assertion fires and does an Error_raise() there will be no output sent anywhere, the only action will be an infinite loop.

    You need to change the error policy to “Error.policyDefault”, so that Error_raise() will process the error.

    And then you can set “Error.raiseHook = Error.print:” to get the assertion message printed to the System_printf() buffer, which will get dumped to debugger console as the program aborts.

    If you make these changes, do you see the assertion you expect?

    Thanks,
    Scott

  • Hi Scott

    I tried what you suggested (and i added instrumented to the config)..see relevent cfg file below....But i still did not see any output in the debugger console...

    And at the very end of the cfg script file i see these 2 lines were added automatically:
     Error.policy = Error.UNWIND;
    Error.common$.logger = null;

    the fact that the logger is null - could that be a factor and if so what should it be set to?


    /* ================ Error configuration ================ */ var Error = xdc.useModule('xdc.runtime.Error'); Error.policyFxn = Error.policyDefault; Error.raiseHook = Error.print; Error.maxDepth = 2; /* ================ TI-RTOS drivers' configuration ================ */ var driversConfig = xdc.useModule('ti.drivers.Config'); driversConfig.libType = driversConfig.LibType_Instrumented; Assert.common$.diags_INTERNAL = xdc.module("xdc.runtime.Diags").ALWAYS_ON;
  • Hi Moshe,

    That logger being null should not matter.  I tried this myself with a simple CC26xx app, with several different combinations of settings, and always see the assert displayed to the console.

    Stepping back a bit… where specifically did you add that Assert_isTrue() call?  Is it in a C file in your project?

    And after the assert, does the program terminate, or does it continue running?

    Can you please post the full .cfg file you are using?

    Thanks,
    Scott

  • Hi Scott

    This is how i did the call (in the buttonPinHandle assignment & the rest of the function is unchanged from TI), and yes, the program happily continues..:

    int main(void)
    {
        Board_initGeneral(); /* Initialize pins and peripherals */
        Board_initUART(); /* Initialise the UART and SPI for the display driver. */
        Board_initSPI();
        menu_init(); /* Initialize the menu task and resources */
    
        buttonPinHandle = NULL;//PIN_open(&buttonPinState, buttonPinTable); /* Open Button pins */
        Assert_isTrue(buttonPinHandle != NULL, NULL);
    
        /* Setup callback for button pins */
        PIN_Status status = PIN_registerIntCb(buttonPinHandle, &buttonCallbackFunction);
        Assert_isTrue((status == PIN_SUCCESS), NULL);
    
        /* Start task execution */
        BIOS_start();
    
        return (0);
    }
    

    and herewith the WHOLE of that cfg file:

    4743.rfExamples.cfg

  • Hi Moshe,

    OK, thanks.  

    I think your assert print output was sent the SysCallback module, and since there are no stub functions configured, there is no display.

    Can you try hand-editing your .cfg file…

    Uncomment the below three lines that are commented, so you’re using the SysMin provider, and then comment out the following two lines that are selecting SysCallback:

        //var SysMin = xdc.useModule('xdc.runtime.SysMin');
        //SysMin.bufSize = 128;
        //System.SupportProxy = SysMin; 
        var SysCallback = xdc.useModule('xdc.runtime.SysCallback'); 
        System.SupportProxy = SysCallback;

    And to get your program to terminate after the assert, change:
        Error.policy = Error.UNWIND;
    to:
        Error.policy = Error.TERMINATE;

    Save the .cfg and rebuild.  Does that do it?

    Thanks,
    Scott

  • 6403.rfExamples.cfgHi Scott

    I really appreciate your efforts..but alas the changes did not work.

    It is really puzzling as to what the difference between your setup and mine is.

    I attach the .cfg file in case there is something else that's set incorrectly.

    thanks

    moshe

  • Hi Moshe,

    I experimented with your .cfg file and the rfPacketErrorRate example.  The missing piece was this:

    Main.common$.diags_INTERNAL = Diags.ALWAYS_ON;

    Can you try adding this to your .cfg file?

    It isn’t obvious that this is needed, but there is some description and example of doing this here: rtsc.eclipse.org/.../Assert.html

    I think this should do it, but please let me know if you still can’t see the assert…

    Regards,
    Scott

  • Hi Scott
    YES!! that did it! Thank you.

    So now to experiment and see if ALL the changes were needed.

    moshe