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/PROCESSOR-SDK-AM335X: GPIO HWI issue

Part Number: PROCESSOR-SDK-AM335X
Other Parts Discussed in Thread: SYSBIOS, OMAPL138, AM3359

Tool/software: TI-RTOS

Hi,

I'm trying to create a HWI for GPIO1. I wasted 2 day and didn't get it working and there is no example to check out. This is my code:

Int main()
{
Board_initCfg boardCfg;
boardCfg = BOARD_INIT_PINMUX_CONFIG |
BOARD_INIT_MODULE_CLOCK |
BOARD_INIT_UART_STDIO;

Board_init(boardCfg);
GPIO_init();

GPIO_write((USER_LED1), GPIO_PIN_VAL_HIGH);

Hwi_Params hwiParams;

Hwi_Handle myHwi;
Error_Block eb;

Error_init(&eb);
Hwi_Params_init(&hwiParams);

hwiParams.arg = 0;
hwiParams.enableInt = FALSE;
hwiParams.eventId = 98; //<------- eventId is the int number which am335x  Manual (www.ti.com/.../spruh73p.pdf)  
myHwi = Hwi_create(98, myIsr, &hwiParams, &eb); //<----- or do I put the int number here as a interrupt number. When i watched TI rtos workshop diffrent architecture had diffrent ways in initializing this paremeter
//Dose the ISR function have to be specialy named or I can name it how i want?

if(myHwi == NULL){
System_abort("Hwi create failed");
}
Hwi_enable();
Hwi_enableInterrupt(5);

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


When I use interrupt number 98 in Hwi_create(98, myIsr, &hwiParams, &eb) and debug it the program crash and get error:

"No source available for "do_AngelSWI(int, void *) [C:/Users\OX areny VR\workspace_v7\LEDBIOS\Debug\LEDBIOS.out] at 0x8000d854" "

and 

CortxA8: Unhandled ADP_Stopped exception 0x20023

Does anyone know how to fix this error and create a Hwi cos I have no clue how to do it. 

Rafal

  • The RTOS team have been notified. They will respond here.
  • OK I started to use the pdk example "GPIO_LedBlink_bbbAM335x_armTestProject" I was able to blink led by setting the callbackfunction to interrupt, but when I create an Hwi interrupt to run my function passsed to callback function it wont work. I'm triggering the interrupt by GPIOTriggerPinInt(); same as in the example. But it wont trigger the Hwi. Why I tried to trigger the Hwi by Hwi_post everything works fine. I have no idea what im doing wrong and why GPIOTriggerPinInt(); dosent trigger the Hwi interrupt. Im posting my code (it the expamle with chenged fragments):

    main:
    #ifndef BARE_METAL

    /* XDCtools Header files */
    #include <xdc/std.h>
    #include <xdc/cfg/global.h>
    #include <xdc/runtime/System.h>
    #include <xdc/runtime/Error.h>


    /* BIOS Header files */
    #include <ti/sysbios/BIOS.h>
    #include <ti/sysbios/knl/Task.h>
    #endif

    #include <stdio.h>

    /* TI-RTOS Header files */
    #include <ti/drv/gpio/GPIO.h>
    #include <ti/drv/gpio/soc/GPIO_soc.h>

    #include "GPIO_log.h"
    #include "GPIO_board.h"

    #include <ti/board/board.h>

    /**********************************************************************
    ************************** Macros ************************************
    **********************************************************************/
    #if defined(SOC_AM574x) || defined(SOC_AM572x) || defined (SOC_AM571x)
    #if defined (__TI_ARM_V7M4__)
    #define DELAY_VALUE (0x6FFFFFU) /* Update Delay as it is not sufficent for M4 core */
    #else
    #define DELAY_VALUE (0x6FFFFFU)
    #endif
    #else
    #define DELAY_VALUE (0x6FFFFFU)
    #endif

    /**********************************************************************
    ************************** Internal functions ************************
    **********************************************************************/

    /* Delay function */
    void AppDelay(unsigned int delayVal);

    /* Callback function */
    void AppGpioCallbackFxn(UArg arg0);

    #if defined(idkAM574x) || defined(idkAM572x) || defined(idkAM571x)
    /* GPIO clock and pinmux configurations */
    extern void AppGPIOInit(void);
    #endif

    #if defined(idkAM574x) || defined(idkAM572x)
    extern void GPIOApp_UpdateBoardInfo(void);
    extern void GPIOAppUpdateConfig(uint32_t *gpioBaseAddr, uint32_t *gpioPin);
    #endif

    /*
    * ======== Board_initI2C ========
    */
    static void Board_initGPIO(void)
    {
    Board_initCfg boardCfg;

    #if defined(SOC_K2H) || defined(SOC_K2K) || defined(SOC_K2E) || defined(SOC_K2L) || defined(SOC_K2G) || defined(SOC_C6678) || defined(SOC_C6657) || defined(SOC_OMAPL137) || defined(SOC_OMAPL138)
    GPIO_v0_HwAttrs gpio_cfg;

    /* Get the default SPI init configurations */
    GPIO_socGetInitCfg(GPIO_LED0_PORT_NUM, &gpio_cfg);

    /* Modify the default GPIO configurations if necessary */

    /* Set the default GPIO init configurations */
    GPIO_socSetInitCfg(GPIO_LED0_PORT_NUM, &gpio_cfg);

    #if defined(SOC_K2G)
    /* Setup GPIO interrupt configurations */
    GPIO_socSetIntMux(GPIO_LED0_PORT_NUM, GPIO_LED0_PIN_NUM, NULL, GPIO_MUX_SEL);
    #endif
    #if defined(SOC_OMAPL137) || defined(SOC_OMAPL138)
    /* Setup GPIO interrupt configurations */
    GPIO_socSetBankInt(GPIO_LED0_PORT_NUM, GPIO_LED0_PIN_NUM, NULL);
    #endif
    #endif

    #if defined(evmK2E) || defined(evmC6678)
    boardCfg = BOARD_INIT_MODULE_CLOCK |
    BOARD_INIT_UART_STDIO;
    #else
    boardCfg = BOARD_INIT_PINMUX_CONFIG |
    BOARD_INIT_MODULE_CLOCK |
    BOARD_INIT_UART_STDIO;
    #endif
    Board_init(boardCfg);

    #if defined(idkAM572x) || defined(idkAM574x)
    GPIOApp_UpdateBoardInfo();
    #endif
    }

    /**********************************************************************
    ************************** Global Variables **************************
    **********************************************************************/
    volatile uint32_t gpio_intr_triggered = 0;
    uint32_t gpioBaseAddr;
    uint32_t gpioPin;

    /*
    * ======== test function ========
    */
    #ifndef BARE_METAL
    void gpio_test(UArg arg0, UArg arg1)
    {
    #else
    void main()
    {
    Board_initGPIO();
    #endif
    uint32_t testOutput = 1;

    /* GPIO initialization */
    GPIO_init();

    /* Set the callback function */
    // GPIO_setCallback(USER_LED0, AppGpioCallbackFxn);

    /* Enable GPIO interrupt on the specific gpio pin */
    GPIO_enableInt(USER_LED0); //<-do i have to enableInt for Hwi?

    /* Write high to gpio pin to control LED1 */
    GPIO_write((USER_LED1), GPIO_PIN_VAL_HIGH);
    AppDelay(DELAY_VALUE);

    GPIO_log("\n GPIO Led Blink Application \n");

    #if defined(SOC_K2L) || defined(SOC_C6678) || defined(SOC_C6657)
    /* No GPIO pin directly connected to user LED's on K2L/K2G/C6678/C6657 EVM, just trigger interrupt once */
    GPIO_toggle(USER_LED0);
    while (!gpio_intr_triggered);

    GPIO_log("\n All tests have passed \n");
    #else

    while(1)
    {
    #if defined(SOC_AM574x) || defined(SOC_AM572x) || defined(SOC_AM571x)|| defined(SOC_AM335x) || defined(SOC_AM437x)

    #if defined (idkAM572x) || defined (idkAM574x)
    /* Update GPIO info based on the board */
    GPIOAppUpdateConfig(&gpioBaseAddr, &gpioPin);
    #else
    gpioBaseAddr = SOC_GPIO_2_REGS;
    gpioPin = 3;
    #endif
    /* Trigger interrupt */
    GPIOTriggerPinInt(gpioBaseAddr, 0, gpioPin);<-this dont affect the Hwi interrupt
    //Hwi_post(32);<-this one trigger my Hwi interrupt 
    #endif
    #if defined(SOC_K2H) || defined(SOC_K2K) || defined(SOC_K2E) || defined(SOC_K2G) || defined(SOC_OMAPL137) || defined(SOC_OMAPL138)
    GPIO_toggle(USER_LED0);
    #endif
    AppDelay(DELAY_VALUE);
    if (testOutput)
    {
    GPIO_log("\n All tests have passed \n");
    testOutput = 0;
    }
    }
    #endif
    Task_exit();
    }

    #ifndef BARE_METAL
    /*
    * ======== main ========
    */
    int main(void)
    {
    /* Call board init functions */
    Board_initGPIO();

    #if defined(idkAM574x) || defined(idkAM572x) || defined(idkAM571x)
    AppGPIOInit();
    #endif

    /* Start BIOS */
    BIOS_start();
    return (0);
    }
    #endif

    /*
    * ======== AppDelay ========
    */
    void AppDelay(unsigned int delayVal)
    {
    while(delayVal)
    {
    delayVal--;
    }
    }

    /*
    * ======== Callback function ========
    */
    void AppGpioCallbackFxn(UArg arg0)
    {
    /* Toggle LED1 */
    GPIO_toggle(USER_LED1);

    AppDelay(DELAY_VALUE);
    gpio_intr_triggered = 1;
    }

    --------------------------------------------------------------------------------------------------------------------

    gpio_board_config_file:

    #include <stdio.h>
    #include <ti/drv/gpio/GPIO.h>
    #include <ti/drv/gpio/soc/GPIO_soc.h>

    #define GPIO_USER0_LED_PIN_NUM (0x03)
    #define GPIO_USER0_LED_PORT_NUM (0x02)
    #define GPIO_USER1_LED_PIN_NUM (0x17)
    #define GPIO_USER1_LED_PORT_NUM (0x02)


    /* GPIO Driver board specific pin configuration structure */
    GPIO_PinConfig gpioPinConfigs[] = {
    /* Input pin with interrupt enabled : User LED */
    GPIO_DEVICE_CONFIG((GPIO_USER0_LED_PORT_NUM), GPIO_USER0_LED_PIN_NUM) |
    GPIO_CFG_IN_INT_RISING | GPIO_CFG_INPUT,

    /* Output pin : User LED */
    GPIO_DEVICE_CONFIG((GPIO_USER1_LED_PORT_NUM), GPIO_USER1_LED_PIN_NUM) |
    GPIO_CFG_OUTPUT
    };

    /* GPIO Driver call back functions */
    GPIO_CallbackFxn gpioCallbackFunctions[] = {
    NULL,
    NULL
    };

    /* GPIO Driver configuration structure */
    GPIO_v1_Config GPIO_v1_config = {
    gpioPinConfigs,
    gpioCallbackFunctions,
    sizeof(gpioPinConfigs) / sizeof(GPIO_PinConfig),
    sizeof(gpioCallbackFunctions) / sizeof(GPIO_CallbackFxn),
    0x1U,
    };
    ----------------------------------------------------------------------------------------------------------
    and my HWI script config:

    var hwi0Params = new Hwi.Params();
    hwi0Params.instance.name = "hwi0";
    hwi0Params.eventId = 32;<- i still dont know do i put the int number here
    hwi0Params.enableInt = true;
    Program.global.hwi0 = Hwi.create(32, "&AppGpioCallbackFxn", hwi0Params);<- or do I do it here 32 is the GPIO2A interrupt line 2


    Plis help cos I have no idea why the board don't want to listen to me. I have the beagleboard x-15 I'a wondering is it more compatible with the TI-RTOS. Do you think I should change the baord grom beagleboneblack to beagleboard x-15?

  • Now I created more basic program. I have a idle function that only system_prinft and have a delay function, an Task which was in the basic min sys/bios default project I just add an Hwi_post() and I have an Hwi funciton that system_printf(); thats all. The problem is when I post the Hwi function it start to execute it infinite times. After waching the TI-RTOS workshop im sure it should just run once and after that start runing idle function in while loop. What is wrong with this TI-RTOS is it not compatible with AM335x and beaglebone_black or am I to dumb to understand it. Im posting my main code.

    /*
    * ======== main.c ========
    */

    #include <xdc/std.h>

    #include <xdc/runtime/System.h>

    #include <ti/sysbios/BIOS.h>

    #include <ti/sysbios/knl/Task.h>

    #include <ti/sysbios/hal/Hwi.h>
    #define DELAY_VALUE (0x6FFFFFU)
    /*
    * ======== taskFxn ========
    */
    void AppDelay(unsigned int delayVal)
    {
    while(delayVal)
    {
    delayVal--;
    }
    }
    Void myHwiFxn(UArg arg)
    {
    Hwi_clearInterrupt(5);
    System_printf("Hwi_interrupt!\n");
    AppDelay(DELAY_VALUE);
    AppDelay(DELAY_VALUE);
    AppDelay(DELAY_VALUE);
    AppDelay(DELAY_VALUE);
    }

    Void idleFxn()
    {
    System_printf("idled!\n");
    AppDelay(DELAY_VALUE);
    AppDelay(DELAY_VALUE);
    AppDelay(DELAY_VALUE);
    AppDelay(DELAY_VALUE);

    }

    Void taskFxn(UArg a0, UArg a1)
    {
    System_printf("enter taskFxn()\n");

    Task_sleep(10);
    Hwi_post(5);
    System_printf("exit taskFxn()\n");
    }

    /*
    * ======== main ========
    */
    Int main()
    {
    /*
    * use ROV->SysMin to view the characters in the circular buffer
    */
    System_printf("enter main()\n");

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



    --------------------------------------------------------------------------------------------------------------------------------------------------

    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 SysMin = xdc.useModule('xdc.runtime.SysMin');
    var System = xdc.useModule('xdc.runtime.System');
    var Text = xdc.useModule('xdc.runtime.Text');

    var BIOS = xdc.useModule('ti.sysbios.BIOS');
    var Hwi = xdc.useModule('ti.sysbios.hal.Hwi');
    var Task = xdc.useModule('ti.sysbios.knl.Task');
    var Idle = xdc.useModule('ti.sysbios.knl.Idle');

    /*
    * 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;

    /*
    * The BIOS module will create the default heap for the system.
    * Specify the size of this default heap.
    */
    BIOS.heapSize = 0x0;

    /* System stack size (used by ISRs and Swis) */
    Program.stack = 0x400;

    /* Circular buffer size for System_printf() */
    SysMin.bufSize = 128;

    /*
    * Create and install logger for the whole system
    */
    var loggerBufParams = new LoggerBuf.Params();
    loggerBufParams.numEntries = 4;
    var logger0 = LoggerBuf.create(loggerBufParams);
    Defaults.common$.logger = logger0;
    Main.common$.diags_INFO = Diags.ALWAYS_ON;

    System.SupportProxy = SysMin;

    /*
    * Build a custom BIOS library. The custom library will be smaller than the
    * pre-built "instrumented" (default) and "non-instrumented" libraries.
    *
    * The BIOS.logsEnabled parameter specifies whether the Logging is enabled
    * within BIOS for this custom build. These logs are used by the RTA and
    * UIA analysis tools.
    *
    * The BIOS.assertsEnabled parameter specifies whether BIOS code will
    * include Assert() checks. Setting this parameter to 'false' will generate
    * smaller and faster code, but having asserts enabled is recommended for
    * early development as the Assert() checks will catch lots of programming
    * errors (invalid parameters, etc.)
    */
    BIOS.libType = BIOS.LibType_Custom;
    BIOS.logsEnabled = false;
    BIOS.assertsEnabled = true;

    /*
    * Create a task. The 'taskFxn' function can be found in main.c.
    */
    var task0Params = new Task.Params();
    var task0 = Task.create("&taskFxn", task0Params);
    Idle.idleFxns[0] = "&idleFxn";
    var hwi0Params = new Hwi.Params();
    hwi0Params.instance.name = "hwi0";
    hwi0Params.arg = 0;
    hwi0Params.priority = 1;
    hwi0Params.eventId = 5;
    Program.global.hwi0 = Hwi.create(5, "&myHwiFxn", hwi0Params);

  • Hi Rafal,

    >> hwi0Params.eventId = 32;<- i still dont know do i put the int number here

    Event Id field is used only on DSPs. They are ignored on all ARM targets.

    >> Do you think I should change the baord grom beagleboneblack to beagleboard x-15?

    SYS/BIOS (TI-RTOS Kernel) is supported on both these boards so I don't think you need to switch.

    >> The problem is when I post the Hwi function it start to execute it infinite times.

    My guess is that the interrupt corresponding to the Hwi is repeatedly triggering. This can happen if the interrupt is triggered with Hwi_post() and not cleared in the Hwi function. The A8 interrupt controller does not automatically clear posted software interrupts so you have to do it manually in the interrupt function. There is a Hwi_clearPostedInterrup() API that you can use (see API cdoc link below) to clear software interrupts. This step is not required for regular interrupts triggered by peripherals.

    Best,

    Ashish

  • Thank you for an answer. I finally found out about the Hwi_clearPostedInterrup() this function was only in API for HWI that is located under the Target specific support->Arm->A8, but when I was using the default Hwi which u can find under Scheduling, it didn't have a Hwi_clearPostedInterrupt just a normal Hwi_clearinterrupt(). I had a feeling that I need to clear that posted interrupt, but when using the default Hwi I wasn't able to do. 


    Ok but I run into another major problem. I tried to use the Timer and after debugging it my program land into syscalls.c and runs the _exit(function). I add the DMTimer which is located under Target Specific support->ARM->A8->Timer. I tried it on a Sys/bios minimal project with an Task and a function called timerIsr with a System_printf in it and it still didn't work. So I guess its the problem TI-RTOS and A8 compability. Here is my code and printscreen which shows what I get after pressing the debug button and wating a couple seconds and my Timer setup:

    #include <xdc/std.h>

    #include <xdc/runtime/System.h>

    #include <ti/sysbios/BIOS.h>

    #include <ti/sysbios/knl/Task.h>

    /*
    * ======== taskFxn ========
    */

    Void timerIsr(void)
    {
    System_printf("I'm your timer!!!\n");
    }
    Void taskFxn(UArg a0, UArg a1)
    {
    System_printf("enter taskFxn()\n");

    Task_sleep(10);

    System_printf("exit taskFxn()\n");
    }

    /*
    * ======== main ========
    */
    Int main()
    {
    /*
    * use ROV->SysMin to view the characters in the circular buffer
    */
    System_printf("enter main()\n");

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

  • And under the SysMin-> OutputBuffer I get this instead of the System_printf I wanted:

    {module#53}: line 205: error {id:0x1c0000, args:[0x8000825c, 0x80008258]}
    xdc.runtime.Error.raise: terminating execution
  • Can you share the *.cfg from your project ?

    Regarding the error message, I think the error/log/assert strings are not loaded. You can enable loading strings by setting the "Text.isLoaded" option in your application's *.cfg file to true. You can hand edit the cfg file to do that. Once you do that the module name that is triggering the error will be printed so it will be easier to debug.

    Best,
    Ashish
  • Here you go:

    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 SysMin = xdc.useModule('xdc.runtime.SysMin');
    var System = xdc.useModule('xdc.runtime.System');
    var Text = xdc.useModule('xdc.runtime.Text');

    var BIOS = xdc.useModule('ti.sysbios.BIOS');
    var Hwi = xdc.useModule('ti.sysbios.hal.Hwi');
    var Task = xdc.useModule('ti.sysbios.knl.Task');
    var Timer = xdc.useModule('ti.sysbios.timers.dmtimer.Timer');

    /*
    * 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;

    /*
    * The BIOS module will create the default heap for the system.
    * Specify the size of this default heap.
    */
    BIOS.heapSize = 0x0;

    /* System stack size (used by ISRs and Swis) */
    Program.stack = 0x400;

    /* Circular buffer size for System_printf() */
    SysMin.bufSize = 128;

    /*
    * Create and install logger for the whole system
    */
    var loggerBufParams = new LoggerBuf.Params();
    loggerBufParams.numEntries = 4;
    var logger0 = LoggerBuf.create(loggerBufParams);
    Defaults.common$.logger = logger0;
    Main.common$.diags_INFO = Diags.ALWAYS_ON;

    System.SupportProxy = SysMin;

    /*
    * Build a custom BIOS library. The custom library will be smaller than the
    * pre-built "instrumented" (default) and "non-instrumented" libraries.
    *
    * The BIOS.logsEnabled parameter specifies whether the Logging is enabled
    * within BIOS for this custom build. These logs are used by the RTA and
    * UIA analysis tools.
    *
    * The BIOS.assertsEnabled parameter specifies whether BIOS code will
    * include Assert() checks. Setting this parameter to 'false' will generate
    * smaller and faster code, but having asserts enabled is recommended for
    * early development as the Assert() checks will catch lots of programming
    * errors (invalid parameters, etc.)
    */
    BIOS.libType = BIOS.LibType_Custom;
    BIOS.logsEnabled = false;
    BIOS.assertsEnabled = true;

    /*
    * Create a task. The 'taskFxn' function can be found in main.c.
    */
    var task0Params = new Task.Params();
    var task0 = Task.create("&taskFxn", task0Params);
    var timer0Params = new Timer.Params();
    timer0Params.instance.name = "timer0";
    timer0Params.period = 1000000;
    Program.global.timer0 = Timer.create(null, "&timerIsr", timer0Params);
    Timer.intFreq.lo = 32768;
  • Everything work fine untill I add the Timer. As you can see after debugging my program with timer I end up in this exit function instead of on the beggning of main and when I click start my program just ends. So there is a major problem with the timer or maybe my board configure. I specially made a minimal default project with only the timer to show you that it's the timer problem. I didn't change nothing and didn't add my code. Can you cheack if the timer is working on some of your am335x processor cos maybe it's the beaglebone black fault or maybe some kind of other configuration problem. Maybe I have to change the xdc core on older one.
  • Hi Rafal,

    We run timer tests on AM335x A8 as part of kernel regression testing before each release so the timer has been tested and is expected to work. Its likely a configuration problem.

    Did you try setting "Text.isLoaded" to true so we can see the strings in the error output you were seeing ? That would be the first step to start debugging.

    A common issue I have seen is that the Timer clock is not enabled. You can verify that the timer is enabled by viewing Timer MMRs in CCS memory browser. If you see ??????? or unable to read type error msgs then the timer clock is not enabled. Timer base address can be found under AM335x in this doc:

    Best,

    Ashish

  • I changed the Text.isLoaded to true and I get this string error:

    {module#51}: line 205: E_dataAbort: pc = 0x80008270, lr = 0x8000826c.
    xdc.runtime.Error.raise: terminating execution

    and my DMTimmer (I picked the id 1 ) is not enabled I got the ?????????? at the memory adress 0x48042000. You can cheack it on the printscreen. Is this cosing my code to stop debuging?

  • Do you have any idea what should I do or what manual should I read to fix it? I'm stuck and I don't know were should I look for help.   

    e2e.ti.com/.../150298 is this the solution for my problem do I have enable the perpiheral i mmu?

  • Hi Rafal,

    SYS/BIOS should be adding an MMU entry to map the Timer MMRs by default. I think the problem is that the timer clock is not enabled. That is something that the bootloader (in production) or gel script (during development) is expected to do.

    Here's gel code to enable the timers on a AM3359:

    hotmenu EnableTimers_32KHz()
    {
        WR_MEM_32(CM_PER_TIMER2_CLKCTRL, 0x2);
        WR_MEM_32(CLKSEL_TIMER2_CLK, 0x2);
    
        WR_MEM_32(CM_PER_TIMER3_CLKCTRL, 0x2);
        WR_MEM_32(CLKSEL_TIMER3_CLK, 0x2);
    
        WR_MEM_32(CM_PER_TIMER4_CLKCTRL, 0x2);
        WR_MEM_32(CLKSEL_TIMER4_CLK, 0x2);
    
        WR_MEM_32(CM_PER_TIMER5_CLKCTRL, 0x2);
        WR_MEM_32(CLKSEL_TIMER5_CLK, 0x2);
    
        WR_MEM_32(CM_PER_TIMER6_CLKCTRL, 0x2);
        WR_MEM_32(CLKSEL_TIMER6_CLK, 0x2);
    
        WR_MEM_32(CM_PER_TIMER7_CLKCTRL, 0x2);
        WR_MEM_32(CLKSEL_TIMER7_CLK, 0x2);
    
        GEL_TextOut("Timers 2-7 enabled for 32KHz.\n");
    }

    Once you add it to the gel file, it should show up as a gel file menu item. You would need to run it before loading and running your app. Alternately, you can add a call to this in the On_target_connect() function in the gel file so it automatically runs each time the A8 is connected in CCS.

    Best,

    Ashish

  • Thank you very much for your help!!!! My app start running. I have a question were can I learn more about this GEL files cos I'm new for TI-RTOS and is there any example for beableboneblack (am335x) or beagleboard (am572x) were there is some communication between ARM host and PRUSS it would speed up my project.
  • Hi Rafal,

    Here are some resources I found on gel files. Hope they are useful:
    processors.wiki.ti.com/.../GEL
    www.ti.com/lit/an/spraa74a/spraa74a.pdf

    Regarding example of communication between ARM and PRUSS, that is out of my area of expertise. Can you start a new thread on the Sitara forum to ask that question ? Someone from the Sitara support team should be able to help you.

    Best,
    Ashish