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.

AM3358: Debug issue

Part Number: AM3358
Other Parts Discussed in Thread: CCSTUDIO, SYSBIOS

My target configuration is Connection is Texas Instruments XDS100v2 USB Debug Probe. Board or Device is BeagleBone Black. Test Configuration seem to be good. But I can't debug with Break at address "0x2412a" with no debug information available, or outside of program code. What should I do? or where I did wrong? Thanks

  • Hi Anping,

    BEAGLEBK board comes with no embedded JTAG emulator. BEAGLEBK includes a TI 20 pin JTAG connector, and you need to supply External Emulator by yourself. Do you have external XDS100v2 USB JTAG emulator?

    Do you successfully run the Cortex-A8 bare metal test (link below)?

    Regards,
    Pavel

  • Hi Pavel

       I have external XDS100v2 USB JTAG emulator. Thanks

  • Hi Pavel

         I use Putty to connect serial port COM4. COM$-Putty output C... I go to View->Target Configuration, right click NewTargetConfiguration.ccxml{Default]-> Launch Selected Configuration, right click Texas Instruments XDS100v2 USB Debug Probe_0/CortxA8->Connect Target, COM$-Putty stop to output C, Load my project, Restart, UART_write crash. Is there relationship between COM$-Putty stop to output C and UART_write crash? Thanks

  • Anping,

    To load the out file from UART_BasicExample_bbbAM335x_armTestProject, please follow below steps:

    The procedure is similar between Cortex-A8 and Cortex-A15.


    For how to setup CCStudio with bbbAM335x, refer to below user guides. These are not specific for bbbAM335x, but you can adjust easy to bbAM335x.

    Regards,
    Pavel

  • In order to test Processor SDK RTOS software on BeagleBone, you will need to connect a JTAG to the BeagleBone. With the default configuration of the board, we have observed that connecting a JTAG causes a reset. Users need to follow the procedure provided here to prevent a reset from occurring.

    Regards,
    Pavel

  • Hi Pavel

         I debug UART_BasicExample_Dma_evmAM335x_armTestProject. after task = Task_create(taskFxn, &taskParams, &eb); task = NULL. What is going on? If it can create task, I set what kind of breakpoint at the begining of function taskFxn in order for code to stop there? Thanks

  • The system cannot find the file specified in NewTargetConfiguration

  • Anping Chen said:
    I debug UART_BasicExample_Dma_evmAM335x_armTestProject

    This example is for evmAM335x, not for bbbAM335x

    Regards,
    Pavel

  • Anping Chen said:
    The system cannot find the file specified in NewTargetConfiguration

    I would suggest you below sequence:

    Open CCS 9.0.1

    File -> New -> Target Configuration File

    Rename default NewtargetConfiguration.ccxml to BBB_AM335x.ccxml

    Finish

    Connection: Texas Instruments XDS100v2 USB Debug Probe

    Board or Device: BeagleBone_Black

    Save Configuration -> Save

    Power on BBB board

    Test connection - with this button you can test if your JTAG emulator is setup correctly or not, check the result from this test

    See also below screen shot for reference:

    Regards,
    Pavel

  • Hi Pavel

         It is my mistake. I use UART_BasicExample_bbbAM335x_armExampleProject. The Task_create failed. UART_write crash. I want it to write to serial port for display. Thanks

  • Anping,

    Anping Chen said:
    I use UART_BasicExample_bbbAM335x_armExampleProject. The Task_create failed. UART_write crash. I want it to write to serial port for display. Thanks

    Can you provide me a screen shot of your CCS when your first error occur? Is it "Task_create() failed!"?

    Regards,
    Pavel

  • /*

    * ======== main ========

    */

    Int main()

    {

    Task_Handle task;

    Error_Block eb;

    Task_Params taskParams;

    if (Board_initUART() == false)

    {

    System_printf("\nBoard_initUART failed!\n");

    return(0);

    }

    Error_init(&eb);

    /* Initialize the task params */

    Task_Params_init(&taskParams);

    /* Set the task priority higher than the default priority (1) */

    taskParams.priority = 2;

    taskParams.stackSize = 0x8000;

    task = Task_create(taskFxn, &taskParams, &eb);

    if (task == NULL) {

    BIOS_exit(0);  <== It come here bacause task == NULL

    }

    BIOS_start(); /* does not return */

    return(0);

    }

  • Anping,

    UART_BasicExample_bbbAM335x_armExampleProject is using below files:

    PDK_INSTALL_PATH/ti/drv/uart/example/sample/src/main_uart_example.c

    PDK_INSTALL_PATH/ti/drv/uart/example/sample/am335x/armv7/bios/am335x_app_bbbam335x.cfg

    And it seems to me you are making significant changes in main_uart_example.c file, is that correct? Why?

    Regards,
    Pavel

  • Hi Pavel

         I don't change your example. I use

    UART_BasicExample_bbbAM335x_armExampleProject

    and

    UART_BasicExample_bbbAM335x_armTestProject

    UART_BasicExample_bbbAM335x_armExampleProject works fine. But UART_BasicExample_bbbAM335x_armTestProject not.

    Task_create return NULL. The code which I post is from UART_BasicExample_bbbAM335x_armTestProject. Thanks

  • Hi Pavel

         When I build UART_BasicExample_bbbAM335x_armTestProject Here is what I get

    C:/ti/pdk_am335x_1_0_15/packages/ti/drv/uart/test/src/main_uart_test.c:504:5: warning: implicit declaration of function 'PRCMModuleEnable'; did you mean 'Task_Module_name'? [-Wimplicit-function-declaration]

    Is this the reason Task_create return NULL? Thanks

  • task->qElem's all feilds value are Memory map prevented reading xxxx. How should I do to fix "Task_create return NULL"?

  • Hi Pavel

        I replace  taskParams.stackSize = 0x8000; by taskParams.stackSize = 1024*8;

    Task_Params_init(&taskParams);

    /* Set the task priority higher than the default priority (1) */

    taskParams.priority = 2;

    // taskParams.stackSize = 0x8000;

    taskParams.stackSize = 1024*8;

    task = Task_create(taskFxn, &taskParams, &eb);

    if (task == NULL)

    {

    BIOS_exit(0);

    }

    Task_create doesn't return NULL any more. But when the code execute UART_write(uart, (void *)(uintptr_t)crPrompt, sizeof(crPrompt)); I get

    Can't find a source file at "/db/ztree/library/trees/newlib/newlib-a00/src/linaro/gcc-arm-none-eabi-7-2017-q4-major/src/newlib/libgloss/arm/swi.h"

    What should I do? Thanks

  • Anping,

    UART_BasicExample_bbbAM335x_armTestProject is using below files:

    PDK_INSTALL_PATH/ti/drv/uart/soc/am335x/UART_soc.c

    PDK_INSTALL_PATH/ti/drv/uart/test/am335x/armv7/bios/am335x_app_bbbam335x.cfg

    PDK_INSTALL_PATH/ti/drv/uart/test/src/main_uart_test.c

    This test should be running successfully on bbbAM335x board by default. Have you test the default test (no source code modifications)? What error (if any) you have when trying the default test?

    Regards,
    Pavel

  • Hi Pavel

        I  test the default test. Task_create return NULL. When I change

    //    taskParams.stackSize = 0x8000;
        taskParams.stackSize = 1024*8;

    Task_create doesn't return NULL any more. But line 2292 UART_write(uart, (void *)(uintptr_t)crPrompt, sizeof(crPrompt)); failed. Thanks

  • But when the code execute UART_write(uart, (void *)(uintptr_t)crPrompt, sizeof(crPrompt)); I get

    Can't find a source file at "/db/ztree/library/trees/newlib/newlib-a00/src/linaro/gcc-arm-none-eabi-7-2017-q4-major/src/newlib/libgloss/arm/swi.h"

    What should I do? Thanks

  • Part Number: AM3358

    Here is my main

    Int main()

    {

    System_printf("enter main()\n");

    Error_Block eb;

    Error_init(&eb);

    Board_initCfg boardCfg = BOARD_INIT_PINMUX_CONFIG |

    BOARD_INIT_MODULE_CLOCK |

    BOARD_INIT_UART_STDIO;

    Board_STATUS boardStatus = Board_init(boardCfg);

    if (boardStatus != BOARD_SOK)

    {

    return (0);

    }

    /* Initialize the task params */

    Task_Params taskParams;

    Task_Params_init(&taskParams);

    taskParams.stackSize = 4*1024;

    /* Set the task priority higher than the default priority (1) */

    taskParams.priority = 2;

    Task_Handle task = Task_create(taskFxn, &taskParams, &eb);

    if (task == NULL) {

    System_printf("Task_create() failed!\n");

    BIOS_exit(0);

    }

    start_app(); /* does not return */

    return(0);

    }

    here my app.cfg

    var Defaults = xdc.useModule('xdc.runtime.Defaults');

    var Diags = xdc.useModule('xdc.runtime.Diags');

    var Error = xdc.useModule('xdc.runtime.Error');

    var Log = xdc.useModule('xdc.runtime.Log');

    var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');

    var Main = xdc.useModule('xdc.runtime.Main');

    var Memory = xdc.useModule('xdc.runtime.Memory')

    var SysMin = xdc.useModule('xdc.runtime.SysMin');

    var System = xdc.useModule('xdc.runtime.System');

    var Text = xdc.useModule('xdc.runtime.Text');

    var GIO = xdc.useModule('ti.sysbios.io.GIO');

    var Clock = xdc.useModule('ti.sysbios.knl.Clock');

    var Swi = xdc.useModule('ti.sysbios.knl.Swi');

    var Task = xdc.useModule('ti.sysbios.knl.Task');

    var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');

    var Mailbox = xdc.useModule('ti.sysbios.knl.Mailbox');

    var Hwi = xdc.useModule('ti.sysbios.hal.Hwi');

    var Timer = xdc.useModule('ti.sysbios.hal.Timer');

    var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');

    var Edma = xdc.loadPackage ("ti.sdo.edma3.drv.sample");

    var drv = xdc.loadPackage ("ti.sdo.edma3.drv");

    var rm = xdc.loadPackage ("ti.sdo.edma3.rm");

    /* ================ BIOS configuration ================ */

    var BIOS = xdc.useModule('ti.sysbios.BIOS');

    /*

    * The BIOS module will create the default heap for the system.

    * Specify the size of this default heap.

    */

    BIOS.heapSize = 0x1000;

    /*

    * Build a custom SYS/BIOS library from sources.

    */

    BIOS.libType = BIOS.LibType_Custom;

    BIOS.customCCOpts = BIOS.customCCOpts.replace(" -g ","");

    BIOS.assertsEnabled = false;

    BIOS.logsEnabled = false;

    BIOS.swiEnabled = false;

    /*

    * The BIOS module will create the default heap for the system.

    * Specify the size of this default heap.

    */

    BIOS.heapSize = 0x8000;

    Swi.common$.namedInstance = true;

    Program.sectionsExclude = ".*";

    Clock.tickPeriod = 1000;

    Hwi.dispatcherSwiSupport = true;

    Hwi.dispatcherTaskSupport = true;

    Hwi.dispatcherAutoNestingSupport = true;

    Task.enableIdleTask = false;

    Task.initStackFlag = false;

    Task.checkStackFlag = false;

    /* ================ Driver configuration ================ */

    /* Load the Osal package */

    var osType = "tirtos";

    var Osal = xdc.loadPackage('ti.osal');

    Osal.Settings.osType = osType;

    /*use CSL package*/

    var socType = "am335x";

    var Csl = xdc.loadPackage('ti.csl');

    Csl.Settings.deviceType = socType;

    /* Load the board package */

    var Board = xdc.loadPackage('ti.board');

    Board.Settings.boardName = "bbbAM335x";

    /* Load the driver packages, starting with mcasp */

    var McASP = xdc.loadPackage('ti.drv.mcasp');

    McASP.Settings.socType = socType;

    /* Load the spi package */

    var Spi = xdc.loadPackage('ti.drv.spi');

    Spi.Settings.socType = socType;

    /* Load the I2C package */

    var I2C = xdc.loadPackage('ti.drv.i2c');

    I2C.Settings.socType = socType;

    /* Load the uart package */

    var Uart = xdc.loadPackage('ti.drv.uart');

    Uart.Settings.socType = socType;

    /* Load Profiling package */

    var Utils = xdc.loadPackage('ti.utils.profiling');

    /* Load the gpio package */

    var Gpio = xdc.loadPackage('ti.drv.gpio');

    Gpio.Settings.socType = socType;

    Gpio.Settings.enableProfiling = true;

    /* ================ Cache and MMU configuration ================ */

    var Cache = xdc.useModule('ti.sysbios.family.arm.a8.Cache');

    Cache.enableCache = true;

    var Mmu = xdc.useModule('ti.sysbios.family.arm.a8.Mmu');

    Mmu.enableMMU = true;

    /* Force peripheral section to be NON cacheable strongly-ordered memory */

    var peripheralAttrs = {

    type : Mmu.FirstLevelDesc_SECTION, // SECTION descriptor

    tex: 0,

    bufferable : false, // bufferable

    cacheable : false, // cacheable

    shareable : false, // shareable

    noexecute : true, // not executable

    };

    /* Define the base address of the 1 Meg page the peripheral resides in. */

    var peripheralBaseAddr = 0x44e00400;;

    /* Configure the corresponding MMU page descriptor accordingly */

    Mmu.setFirstLevelDescMeta(peripheralBaseAddr,

    peripheralBaseAddr,

    peripheralAttrs);

     

    /* Define the base address of the 1 Meg page the peripheral resides in. */

    var peripheralBaseAddr = 0x481a6000;

    /* Configure the corresponding MMU page descriptor accordingly */

    Mmu.setFirstLevelDescMeta(peripheralBaseAddr,

    peripheralBaseAddr,

    peripheralAttrs);

    /*

    * Uncomment this line to globally disable Asserts.

    * All modules inherit the default from the 'Defaults' module. You

    * can override these defaults on a per-module basis using Module.common$.

    * Disabling Asserts will save code space and improve runtime performance.

    */

    /*Defaults.common$.diags_ASSERT = Diags.ALWAYS_OFF; */

    /*

    * Uncomment this line to keep module names from being loaded on the target.

    * The module name strings are placed in the .const section. Setting this

    * parameter to false will save space in the .const section. Error and

    * Assert messages will contain an "unknown module" prefix instead

    * of the actual module name.

    Defaults.common$.namedModule = false;

    */

    /*

    * Minimize exit handler array in System. The System module includes

    * an array of functions that are registered with System_atexit() to be

    * called by System_exit().

    */

    System.maxAtexitHandlers = 4;

    /*

    * Uncomment this line to disable the Error print function.

    * We lose error information when this is disabled since the errors are

    * not printed. Disabling the raiseHook will save some code space if

    * your app is not using System_printf() since the Error_print() function

    * calls System_printf().

    Error.raiseHook = null;

    */

    /*

    * Uncomment this line to keep Error, Assert, and Log strings from being

    * loaded on the target. These strings are placed in the .const section.

    * Setting this parameter to false will save space in the .const section.

    * Error, Assert and Log message will print raw ids and args instead of

    * a formatted message.

    Text.isLoaded = false;

    */

    /*

    * Uncomment this line to disable the output of characters by SysMin

    * when the program exits. SysMin writes characters to a circular buffer.

    * This buffer can be viewed using the SysMin Output view in ROV.

    SysMin.flushAtExit = false;

    */

    /* System stack size (used by ISRs and Swis) */

    Program.stack = 0x4000;

    /* Circular buffer size for System_printf() */

    SysMin.bufSize = 0x200;

    /*

    * Create and install logger for the whole system

    */

    var loggerBufParams = new LoggerBuf.Params();

    loggerBufParams.numEntries = 16;

    var logger0 = LoggerBuf.create(loggerBufParams);

    Defaults.common$.logger = logger0;

    Main.common$.diags_INFO = Diags.ALWAYS_ON;

    System.SupportProxy = SysMin;

    var timer0Params = new Timer.Params();

    timer0Params.instance.name = "timer0";

    Program.global.timer0 = Timer.create(null, null, timer0Params);

     Thank you for your help.

  • Part Number: AM3358

    Where does UART_write go? It doesn't go to serial port! Thanks

  • When I step into Task_create. Here is what I get

    Can't find a source file at "package/cfg/app_pa8fg.c"

    What am I wrong?

  • Part Number: AM3358

    Tool/software: Code Composer Studio

    I do all what I can think to fix this issue. But Task_create still return NULL. I post the question on e2e yesterday.

    Here is

    Int main()

    {

    System_printf("enter main()\n");

    Error_Block eb;

    Error_init(&eb);

    Board_initCfg boardCfg = BOARD_INIT_PINMUX_CONFIG |

    BOARD_INIT_MODULE_CLOCK |

    BOARD_INIT_UART_STDIO;

    Board_STATUS boardStatus = Board_init(boardCfg);

    if (boardStatus != BOARD_SOK)

    {

    return (0);

    }

    /* Initialize the task params */

    Task_Params taskParams;

    Task_Params_init(&taskParams);

    taskParams.stackSize = 2*1024;

    /* Set the task priority higher than the default priority (1) */

    taskParams.priority = 2;

    Task_Handle task = Task_create(taskFxn, &taskParams, &eb);

    if (task == NULL)

    {

    System_printf("Task_create() failed!\n");

    BIOS_exit(0);

    }

    start_app(); /* does not return */

    return(0);

    }

    Here is app.cfg

    var Defaults = xdc.useModule('xdc.runtime.Defaults');

    var Diags = xdc.useModule('xdc.runtime.Diags');

    var Error = xdc.useModule('xdc.runtime.Error');

    var Log = xdc.useModule('xdc.runtime.Log');

    var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');

    var Main = xdc.useModule('xdc.runtime.Main');

    var Memory = xdc.useModule('xdc.runtime.Memory')

    var SysMin = xdc.useModule('xdc.runtime.SysMin');

    var System = xdc.useModule('xdc.runtime.System');

    var Text = xdc.useModule('xdc.runtime.Text');

    var Clock = xdc.useModule('ti.sysbios.knl.Clock');

    var Swi = xdc.useModule('ti.sysbios.knl.Swi');

    var Task = xdc.useModule('ti.sysbios.knl.Task');

    var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');

    var Mailbox = xdc.useModule('ti.sysbios.knl.Mailbox');

    var Hwi = xdc.useModule('ti.sysbios.hal.Hwi');

    var Timer = xdc.useModule('ti.sysbios.hal.Timer');

    var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');

    var Edma = xdc.loadPackage ("ti.sdo.edma3.drv.sample");

    var drv = xdc.loadPackage ("ti.sdo.edma3.drv");

    var rm = xdc.loadPackage ("ti.sdo.edma3.rm");

    /* ================ BIOS configuration ================ */

    var BIOS = xdc.useModule('ti.sysbios.BIOS');

    /*

    * Build a custom SYS/BIOS library from sources.

    */

    BIOS.libType = BIOS.LibType_Custom;

    BIOS.customCCOpts = BIOS.customCCOpts.replace(" -g ","");

    BIOS.assertsEnabled = false;

    BIOS.logsEnabled = false;

    BIOS.swiEnabled = false;

    /*

    * The BIOS module will create the default heap for the system.

    * Specify the size of this default heap.

    */

    BIOS.heapSize = 0x8000;

    Swi.common$.namedInstance = true;

    Program.sectionsExclude = ".*";

    Clock.tickPeriod = 1000;

    Hwi.dispatcherSwiSupport = true;

    Hwi.dispatcherTaskSupport = true;

    Hwi.dispatcherAutoNestingSupport = true;

    Task.enableIdleTask = false;

    Task.initStackFlag = false;

    Task.checkStackFlag = false;

    /* ================ Driver configuration ================ */

    /* Load the Osal package */

    var osType = "tirtos";

    var Osal = xdc.loadPackage('ti.osal');

    Osal.Settings.osType = osType;

    /*use CSL package*/

    var socType = "am335x";

    var Csl = xdc.loadPackage('ti.csl');

    Csl.Settings.deviceType = socType;

    /* Load the driver packages, starting with mcasp */

    var McASP = xdc.loadPackage('ti.drv.mcasp');

    McASP.Settings.socType = socType;

    /* Load the spi package */

    var Spi = xdc.loadPackage('ti.drv.spi');

    Spi.Settings.socType = socType;

    /* Load the I2C package */

    var I2C = xdc.loadPackage('ti.drv.i2c');

    I2C.Settings.socType = socType;

    /* Load the uart package */

    var Uart = xdc.loadPackage('ti.drv.uart');

    Uart.Settings.socType = socType;

    /* Load the board package */

    var Board = xdc.loadPackage('ti.board');

    Board.Settings.boardName = "bbbAM335x";

    /* Load Profiling package */

    var Utils = xdc.loadPackage('ti.utils.profiling');

    /* Load the gpio package */

    var Gpio = xdc.loadPackage('ti.drv.gpio');

    Gpio.Settings.socType = socType;

    Gpio.Settings.enableProfiling = true;

    /* ================ Cache and MMU configuration ================ */

    var Cache = xdc.useModule('ti.sysbios.family.arm.a8.Cache');

    Cache.enableCache = true;

    var Mmu = xdc.useModule('ti.sysbios.family.arm.a8.Mmu');

    Mmu.enableMMU = true;

    /* Force peripheral section to be NON cacheable strongly-ordered memory */

    var peripheralAttrs = {

    type : Mmu.FirstLevelDesc_SECTION, // SECTION descriptor

    tex: 0,

    bufferable : false, // bufferable

    cacheable : false, // cacheable

    shareable : false, // shareable

    noexecute : true, // not executable

    };

    /* Define the base address of the 1 Meg page the peripheral resides in. */

    var peripheralBaseAddr = 0x44e00400;;

    /* Configure the corresponding MMU page descriptor accordingly */

    Mmu.setFirstLevelDescMeta(peripheralBaseAddr,

    peripheralBaseAddr,

    peripheralAttrs);

     

    /* Define the base address of the 1 Meg page the peripheral resides in. */

    var peripheralBaseAddr = 0x481a6000;

    /* Configure the corresponding MMU page descriptor accordingly */

    Mmu.setFirstLevelDescMeta(peripheralBaseAddr,

    peripheralBaseAddr,

    peripheralAttrs);

    /*

    * Uncomment this line to globally disable Asserts.

    * All modules inherit the default from the 'Defaults' module. You

    * can override these defaults on a per-module basis using Module.common$.

    * Disabling Asserts will save code space and improve runtime performance.

    */

    /*Defaults.common$.diags_ASSERT = Diags.ALWAYS_OFF; */

    /*

    * Uncomment this line to keep module names from being loaded on the target.

    * The module name strings are placed in the .const section. Setting this

    * parameter to false will save space in the .const section. Error and

    * Assert messages will contain an "unknown module" prefix instead

    * of the actual module name.

    Defaults.common$.namedModule = false;

    */

    /*

    * Minimize exit handler array in System. The System module includes

    * an array of functions that are registered with System_atexit() to be

    * called by System_exit().

    */

    System.maxAtexitHandlers = 4;

    /*

    * Uncomment this line to disable the Error print function.

    * We lose error information when this is disabled since the errors are

    * not printed. Disabling the raiseHook will save some code space if

    * your app is not using System_printf() since the Error_print() function

    * calls System_printf().

    Error.raiseHook = null;

    */

    /*

    * Uncomment this line to keep Error, Assert, and Log strings from being

    * loaded on the target. These strings are placed in the .const section.

    * Setting this parameter to false will save space in the .const section.

    * Error, Assert and Log message will print raw ids and args instead of

    * a formatted message.

    Text.isLoaded = false;

    */

    /*

    * Uncomment this line to disable the output of characters by SysMin

    * when the program exits. SysMin writes characters to a circular buffer.

    * This buffer can be viewed using the SysMin Output view in ROV.

    SysMin.flushAtExit = false;

    */

    /* System stack size (used by ISRs and Swis) */

    Program.stack = 0x4000;

    /* Circular buffer size for System_printf() */

    SysMin.bufSize = 0x200;

    /*

    * Create and install logger for the whole system

    */

    var loggerBufParams = new LoggerBuf.Params();

    loggerBufParams.numEntries = 16;

    var logger0 = LoggerBuf.create(loggerBufParams);

    Defaults.common$.logger = logger0;

    Main.common$.diags_INFO = Diags.ALWAYS_ON;

    System.SupportProxy = SysMin;

    var timer0Params = new Timer.Params();

    timer0Params.instance.name = "timer0";

    Program.global.timer0 = Timer.create(null, null, timer0Params);

    Here is my Directories

    Here is my Symbols

    What should I do to fix the issue? I think .cfg file have impact on it. Is there any tutorial about how to write CCS project cfg file? Thanks

  • Anping Chen said:

    C:/ti/pdk_am335x_1_0_15/packages/ti/drv/uart/test/src/main_uart_test.c:504:5: warning: implicit declaration of function 'PRCMModuleEnable'; did you mean 'Task_Module_name'? [-Wimplicit-function-declaration]

    Is this the reason Task_create return NULL? Thanks

    I do not think this is the reason for Task_create NULL issue. I have the same warning on skAM335x board and I see that UART1 is enabled successful by this function (CM_PER_UART1_CLKCTRL = 0x2). UART0 is already enabled by the ROM Code.

    I confirm Task_create() returns NULL on my side also. Let me frurther check why this UART test does not work. Meanwhile I will suggest you to use the one that works - ART_BasicExample_bbbAM335x_armExampleProject.

    Regards,
    Pavel

  • Anping Chen said:
    But when the code execute UART_write(uart, (void *)(uintptr_t)crPrompt, sizeof(crPrompt)); I get

    UART_write() and UART_write2() are defined and declared in below files:

    pdk_am335x_1_0_15/packages/ti/drv/uart/src/UART_drv.c

    pdk_am335x_1_0_15/packages/ti/drv/uart/src/v2/UART_v2.c

    pdk_am335x_1_0_15/packages/ti/drv/uart/UART.h

    Regards,
    Pavel

  • Task_create() returns NULL because of stackSize issue. When I update main_uart_test.c file as below (reduce stack size twice), task is created successful and I can see in UART console messages to enter a string.

    Int main()
    {
        Task_Handle task;
        Error_Block eb;
        Task_Params taskParams;

        if (Board_initUART() == false)
        {
            System_printf("\nBoard_initUART failed!\n");
            return(0);
        }

        Error_init(&eb);

        /* Initialize the task params */
        Task_Params_init(&taskParams);

        /* Set the task priority higher than the default priority (1) */
        taskParams.priority = 2;
        //taskParams.stackSize = 0x8000;
        taskParams.stackSize = 0x4000;

        task = Task_create(taskFxn, &taskParams, &eb);
        if (task == NULL) {




    UART UT 1

     UART non-DMA read write test in block mode

     enter the data of 16 character

  • Hi Pavel

          I change the stack size like what you did. Task_create still return 0. My project need to use UART, SPI, I2C and McASP. Here is

    Int main()

    {

    System_printf("enter main()\n");

    Error_Block eb;

    Error_init(&eb);

    Board_initCfg boardCfg = BOARD_INIT_PINMUX_CONFIG |

    BOARD_INIT_MODULE_CLOCK |

    BOARD_INIT_UART_STDIO;

    Board_STATUS boardStatus = Board_init(boardCfg);

    if (boardStatus != BOARD_SOK)

    {

    return (0);

    }

    /* Initialize the task params */

    Task_Params taskParams;

    Task_Params_init(&taskParams);

    taskParams.stackSize = 0x4000;

    /* Set the task priority higher than the default priority (1) */

    taskParams.priority = 2;

    Task_Handle task = Task_create(taskFxn, &taskParams, &eb);

    if (task == NULL)

    {

    System_printf("Task_create() failed!\n");

    BIOS_exit(0);

    }

    start_app(); /* does not return */

    return(0);

    }

    Here is my cfg file

    var Defaults = xdc.useModule('xdc.runtime.Defaults');

    var Diags = xdc.useModule('xdc.runtime.Diags');

    var Error = xdc.useModule('xdc.runtime.Error');

    var Log = xdc.useModule('xdc.runtime.Log');

    var LoggerBuf = xdc.useModule('xdc.runtime.LoggerBuf');

    var Main = xdc.useModule('xdc.runtime.Main');

    var Memory = xdc.useModule('xdc.runtime.Memory')

    var SysMin = xdc.useModule('xdc.runtime.SysMin');

    var System = xdc.useModule('xdc.runtime.System');

    var Text = xdc.useModule('xdc.runtime.Text');

    var Clock = xdc.useModule('ti.sysbios.knl.Clock');

    var Swi = xdc.useModule('ti.sysbios.knl.Swi');

    var Task = xdc.useModule('ti.sysbios.knl.Task');

    var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore');

    var Mailbox = xdc.useModule('ti.sysbios.knl.Mailbox');

    var Hwi = xdc.useModule('ti.sysbios.hal.Hwi');

    var Timer = xdc.useModule('ti.sysbios.hal.Timer');

    var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem');

    var Edma = xdc.loadPackage ("ti.sdo.edma3.drv.sample");

    var drv = xdc.loadPackage ("ti.sdo.edma3.drv");

    var rm = xdc.loadPackage ("ti.sdo.edma3.rm");

    /* ================ BIOS configuration ================ */

    var BIOS = xdc.useModule('ti.sysbios.BIOS');

    /*

    * Build a custom SYS/BIOS library from sources.

    */

    BIOS.libType = BIOS.LibType_Custom;

    BIOS.customCCOpts = BIOS.customCCOpts.replace(" -g ","");

    BIOS.assertsEnabled = false;

    BIOS.logsEnabled = false;

    BIOS.swiEnabled = false;

    /*

    * The BIOS module will create the default heap for the system.

    * Specify the size of this default heap.

    */

    BIOS.heapSize = 0x8000;

    Swi.common$.namedInstance = true;

    Program.sectionsExclude = ".*";

    Clock.tickPeriod = 1000;

    Hwi.dispatcherSwiSupport = true;

    Hwi.dispatcherTaskSupport = true;

    Hwi.dispatcherAutoNestingSupport = true;

    Task.enableIdleTask = false;

    Task.initStackFlag = false;

    Task.checkStackFlag = false;

    /* ================ Driver configuration ================ */

    /* Load the Osal package */

    var osType = "tirtos";

    var Osal = xdc.loadPackage('ti.osal');

    Osal.Settings.osType = osType;

    /*use CSL package*/

    var socType = "am335x";

    var Csl = xdc.loadPackage('ti.csl');

    Csl.Settings.deviceType = socType;

    /* Load the driver packages, starting with mcasp */

    var McASP = xdc.loadPackage('ti.drv.mcasp');

    McASP.Settings.socType = socType;

    /* Load the spi package */

    var Spi = xdc.loadPackage('ti.drv.spi');

    Spi.Settings.socType = socType;

    /* Load the I2C package */

    var I2C = xdc.loadPackage('ti.drv.i2c');

    I2C.Settings.socType = socType;

    /* Load the uart package */

    var Uart = xdc.loadPackage('ti.drv.uart');

    Uart.Settings.socType = socType;

    /* Load the board package */

    var Board = xdc.loadPackage('ti.board');

    Board.Settings.boardName = "bbbAM335x";

    /* Load Profiling package */

    var Utils = xdc.loadPackage('ti.utils.profiling');

    /* Load the gpio package */

    var Gpio = xdc.loadPackage('ti.drv.gpio');

    Gpio.Settings.socType = socType;

    Gpio.Settings.enableProfiling = true;

    /* ================ Cache and MMU configuration ================ */

    var Cache = xdc.useModule('ti.sysbios.family.arm.a8.Cache');

    Cache.enableCache = true;

    var Mmu = xdc.useModule('ti.sysbios.family.arm.a8.Mmu');

    Mmu.enableMMU = true;

    /* Force peripheral section to be NON cacheable strongly-ordered memory */

    var peripheralAttrs = {

    type : Mmu.FirstLevelDesc_SECTION, // SECTION descriptor

    tex: 0,

    bufferable : false, // bufferable

    cacheable : false, // cacheable

    shareable : false, // shareable

    noexecute : true, // not executable

    };

    /* Define the base address of the 1 Meg page the peripheral resides in. */

    var peripheralBaseAddr = 0x44e00400;;

    /* Configure the corresponding MMU page descriptor accordingly */

    Mmu.setFirstLevelDescMeta(peripheralBaseAddr,

    peripheralBaseAddr,

    peripheralAttrs);

     

    /* Define the base address of the 1 Meg page the peripheral resides in. */

    var peripheralBaseAddr = 0x481a6000;

    /* Configure the corresponding MMU page descriptor accordingly */

    Mmu.setFirstLevelDescMeta(peripheralBaseAddr,

    peripheralBaseAddr,

    peripheralAttrs);

    /*

    * Uncomment this line to globally disable Asserts.

    * All modules inherit the default from the 'Defaults' module. You

    * can override these defaults on a per-module basis using Module.common$.

    * Disabling Asserts will save code space and improve runtime performance.

    */

    /*Defaults.common$.diags_ASSERT = Diags.ALWAYS_OFF; */

    /*

    * Uncomment this line to keep module names from being loaded on the target.

    * The module name strings are placed in the .const section. Setting this

    * parameter to false will save space in the .const section. Error and

    * Assert messages will contain an "unknown module" prefix instead

    * of the actual module name.

    Defaults.common$.namedModule = false;

    */

    /*

    * Minimize exit handler array in System. The System module includes

    * an array of functions that are registered with System_atexit() to be

    * called by System_exit().

    */

    System.maxAtexitHandlers = 4;

    /*

    * Uncomment this line to disable the Error print function.

    * We lose error information when this is disabled since the errors are

    * not printed. Disabling the raiseHook will save some code space if

    * your app is not using System_printf() since the Error_print() function

    * calls System_printf().

    Error.raiseHook = null;

    */

    /*

    * Uncomment this line to keep Error, Assert, and Log strings from being

    * loaded on the target. These strings are placed in the .const section.

    * Setting this parameter to false will save space in the .const section.

    * Error, Assert and Log message will print raw ids and args instead of

    * a formatted message.

    Text.isLoaded = false;

    */

    /*

    * Uncomment this line to disable the output of characters by SysMin

    * when the program exits. SysMin writes characters to a circular buffer.

    * This buffer can be viewed using the SysMin Output view in ROV.

    SysMin.flushAtExit = false;

    */

    /* System stack size (used by ISRs and Swis) */

    Program.stack = 0x4000;

    /* Circular buffer size for System_printf() */

    SysMin.bufSize = 0x200;

    /*

    * Create and install logger for the whole system

    */

    var loggerBufParams = new LoggerBuf.Params();

    loggerBufParams.numEntries = 16;

    var logger0 = LoggerBuf.create(loggerBufParams);

    Defaults.common$.logger = logger0;

    Main.common$.diags_INFO = Diags.ALWAYS_ON;

    System.SupportProxy = SysMin;

    var timer0Params = new Timer.Params();

    timer0Params.instance.name = "timer0";

    Program.global.timer0 = Timer.create(null, null, timer0Params);

    I am struggling on it for one week. Thank you for your help.

  • Anping,

    Anping Chen said:
       I change the stack size like what you did. Task_create still return 0.

    0x4000 value works fine on my side. But it seems to me you are not using the default UART AM335x example, but you are making some custom modifications. I would also suggest you to try with 0x2000 stack size value.

    I can see you have opened new e2e threads regarding this stack size issue. I think will be better to switch to this thread and close this one.

    Regards,
    Pavel