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.

CCS/EK-TM4C1294XL: Use Console to See All Messages

Part Number: EK-TM4C1294XL
Other Parts Discussed in Thread: SYSBIOS

Tool/software: Code Composer Studio

When using Console to show the big printf messages, it passes all the way to the end and the previous messages have been missed.  How can we set the Console in CCS and get all the messages?  Thanks, 

  • Neil,

    By default the console will scroll to where the cursor is (just after the last message that is printed).  If you don't want it to automatically scroll then you can turn on scroll lock. The scroll lock button is on the toolbar for the console and looks like this:

    Note that if you do this then you are not going to see new messages as they come in unless you scroll down.

    Regards,

    John

  • Thank you, John, you are correct that there is a scroll lock button.  here is my program printout:

    1. Before adding more messages, it prints all the messages without a problem as follows:

    CORTEX_M4_0: GEL Output:
    Memory Map Initialization Complete

    Running Welder Machine
    Running Feeder
    Running Stack Monitor
    Running Welder Machine
    Running Feeder
    Running Stack Monitor
    Running Welder Machine
    Running Feeder
    Running Stack Monitor
    Running Welder Machine
    Running Feeder
    Running Stack Monitor
    Running Welder Machine
    Running Feeder
    Running Stack Monitor
    Running Welder Machine
    Calling BIOS_exit from Feeder

    You can see OS has run five times until calling BIOS_exit from Feeder.  It is supposed like this.

    2. After adding more messages, the Console only shows the following, which is less than two cycles:

    stat stackSize = 1024.
    Feeder's stat used = 260.
    Monitor's stat priority = 1.
    Monitor's stat stackSize = 512.
    Monitor's stat used = 292.
    Running Welder Machine
    Running Feeder
    Running Stack Monitor
    Wedler's stat priority = 10.
    Wdler's stat stackSize = 2048.
    Welder's stat used = 276.
    Feeder's stat priority = 5.
    Feeder's stat stackSize = 1024.
    Feeder's stat used = 260.
    Monitor's stat priority = 1.
    Monitor's stat stackSize = 512.
    Monitor's stat used = 292.
    Running Welder Machine
    Calling BIOS_exit from Feeder

    The scroll was working, but the messages went out of the Console window.  Is there any way to set the Console window to keep the all the messages on the window?  Thank you!

  • The console buffer size is 80000 characters by default.  You should not be losing messages.  It should be possible to scroll through all of them.  If you want you can increase or remove the limit in the preferences dialog.  Click on show advanced settings the bottom and then under Run/Debug -> Console.

    I am not sure that this is an issue with the console.  Could it be that when adding the extra messages your welder/feeder/monitor sequence is running fewer times?  I see the BIOS_exit call at the end in both cases.  What determines how many time the sequence is run?  Keep in mind that printf is very intrusive.  There is a breakpoint that is hit, the data is transferred and then the target is run again.

    Regards,

    John

  • Thanks, John, my Preference window looks the same as your except of Enable auto scroll lock that yours does not have.  I tried both checked and unchecked, the result is the same as shown previous.

    My CCS version is 9.0.1.0004

    Here is my code:

    /* XDC module Headers */

    #include <xdc/std.h>
    #include <xdc/runtime/System.h>

    /* BIOS module Headers */
    #include <ti/sysbios/BIOS.h>
    #include <ti/sysbios/knl/Clock.h>
    #include <ti/sysbios/knl/Task.h>
    #include <ti/sysbios/knl/Semaphore.h>

    /* Example/Board Header files */
    #include "Board.h"

    #define WDTASKSTACKSIZE 2048
    #define FDTASKSTACKSIZE 1024
    #define MTTASKSTACKSIZE 512

    Void wdFxn(UArg arg0, UArg arg1); // Welder Machine
    Void fdFxn(UArg arg0, UArg arg1); // Wire Feeder
    Void mtFxn(UArg arg0, UArg arg1); // stack monitor

    Int resource = 0;
    Int finishCount = 0;
    UInt32 sleepTickCount;

    Task_Struct wdStruct, fdStruct, mtStruct;
    Char wdStack[WDTASKSTACKSIZE], fdStack[FDTASKSTACKSIZE], mtStack[MTTASKSTACKSIZE];
    Semaphore_Struct semStruct;
    Semaphore_Handle semHandle;

    Int main()
    {
    /* Construct BIOS objects */
    Task_Params taskParams;
    Semaphore_Params semParams;

    /* Call board init functions */
    Board_initGeneral();

    /* Construct writer/reader Task threads */
    Task_Params_init(&taskParams);
    taskParams.stackSize = WDTASKSTACKSIZE;
    taskParams.stack = &wdStack;
    taskParams.priority = 10;
    Task_construct(&wdStruct, (Task_FuncPtr)wdFxn, &taskParams, NULL);

    taskParams.stackSize = FDTASKSTACKSIZE;
    taskParams.stack = &fdStack;
    taskParams.priority = 5;
    Task_construct(&fdStruct, (Task_FuncPtr)fdFxn, &taskParams, NULL);

    taskParams.stackSize = MTTASKSTACKSIZE;
    taskParams.stack = &mtStack;
    taskParams.priority = 1;
    Task_construct(&mtStruct, (Task_FuncPtr)mtFxn, &taskParams, NULL);

    /* Construct a Semaphore object to be use as a resource lock, inital count 1 */
    Semaphore_Params_init(&semParams);
    Semaphore_construct(&semStruct, 1, &semParams);

    /* Obtain instance handle */
    semHandle = Semaphore_handle(&semStruct);

    /* We want to sleep for 10000 microseconds */
    sleepTickCount = 10000 / Clock_tickPeriod;

    BIOS_start(); /* Does not return */
    return(0);
    }

    /*
    * ======== task1Fxn ========
    */
    Void wdFxn(UArg arg0, UArg arg1)
    {
    UInt32 time;
    // Task_Stat statbuf; /* declare buffer */
    int t1Arr[] = {1, 2, 3};
    for (;;) {
    System_printf("Running Welder Machine\n");


    if (Semaphore_getCount(semHandle) == 0) {
    System_printf("Sem blocked in Welder\n");
    }

    /* Get access to resource */
    Semaphore_pend(semHandle, BIOS_WAIT_FOREVER);

    /* Do work by waiting for 2 system ticks to pass */
    time = Clock_getTicks();
    while (Clock_getTicks() <= (time + 1)) {
    ;
    }

    /* Do work on locked resource */
    resource += 1;
    /* Unlock resource */

    Semaphore_post(semHandle);

    Task_sleep(sleepTickCount);
    }
    }

    /*
    * ======== task2Fxn ========
    */
    Void fdFxn(UArg arg0, UArg arg1)
    {
    // Task_Stat statbuf; /* declare buffer */

    for (;;) {
    System_printf("Running Feeder\n");
    // Task_stat(&task1Struct, &statbuf); /* call func to get status */

    if (Semaphore_getCount(semHandle) == 0) {
    System_printf("Sem blocked in Feeder\n");
    }

    /* Get access to resource */
    Semaphore_pend(semHandle, BIOS_WAIT_FOREVER);

    /* Do work on locked resource */
    resource += 1;
    /* Unlock resource */

    Semaphore_post(semHandle);

    Task_sleep(sleepTickCount);

    finishCount++;
    if (finishCount == 5) {
    System_printf("Calling BIOS_exit from Feeder\n");
    BIOS_exit(0);
    }
    }
    }


    Void mtFxn(UArg arg0, UArg arg1)
    {
    UInt32 time;
    Task_Stat statbuf; /* declare buffer */

    for (;;) {
    System_printf("Running Stack Monitor \n");
    Task_stat(&wdStruct, &statbuf); /* call func to get status */
    System_printf("Wedler's stat priority = %d.\n", statbuf.priority);
    System_printf("Wdler's stat stackSize = %d.\n", statbuf.stackSize);
    System_printf("Welder's stat used = %d.\n", statbuf.used);

    Task_stat(&fdStruct, &statbuf); /* call func to get status */
    System_printf("Feeder's stat priority = %d.\n", statbuf.priority);
    System_printf("Feeder's stat stackSize = %d.\n", statbuf.stackSize);
    System_printf("Feeder's stat used = %d.\n", statbuf.used);

    Task_stat(Task_self(), &statbuf); /* call func to get status */

    System_printf("Monitor's stat priority = %d.\n", statbuf.priority);
    System_printf("Monitor's stat stackSize = %d.\n", statbuf.stackSize);
    System_printf("Monitor's stat used = %d.\n", statbuf.used);

    if (Semaphore_getCount(semHandle) == 0) {
    System_printf("Sem blocked in Monitor\n");
    }

    /* Get access to resource */
    Semaphore_pend(semHandle, BIOS_WAIT_FOREVER);

    /* Do work by waiting for 2 system ticks to pass */
    time = Clock_getTicks();
    while (Clock_getTicks() <= (time + 1)) {
    ;
    }

    /* Do work on locked resource */
    resource += 1;
    /* Unlock resource */

    Semaphore_post(semHandle);

    Task_sleep(sleepTickCount);
    }
    }

    It should be running five cycles because the following code:

    finishCount++;
    if (finishCount == 5) {
    System_printf("Calling BIOS_exit from Feeder\n");
    BIOS_exit(0);
    }

  • Ok so you are using System_printf() and not printf().  I don't think the console is filtering anything out here.  I will need to loop in a BIOS expert.

  • Neil,

    In your SYS/BIOS kernel.cfg file, I assume you are using SysMin.

    Try increasing your output buffer.

    var SysMin = xdc.useModule('xdc.runtime.SysMin');
    SysMin.bufSize = 2048;
    System.SupportProxy = SysMin;

    Derrick

  • Great thanks, Derrick and John, Derrick's answer solved the problem!