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/AM3358: Confirm the way to enable the DMTimer of from 3 to 7

Guru 24520 points
Part Number: AM3358
Other Parts Discussed in Thread: SYSBIOS,

Tool/software: TI-RTOS

Hi TI Experts,

Please provide your answer for my question by end of tomorrow in Japan time if possible.
[Question]
Would you please teach me the way to enable all DMTIMERs?

[Enviroments]
H/W: AM335x Start Kit
S/W: bios_6_73_00_12

[Background]
According to customer, the No.0 and No.2 DMTIMER was enabled when used the StarterKit GEL file. Acutually, when they create the No.3 DMTIMER on their application, it failed with exception error. So, they would like to know the way to enable the all DMTIMERs on their application code.

If you have any questions, please let me know.
Best regards.

Kaka

  • Part Number: AM3358

    Tool/software: TI-RTOS

    Hi TI Experts,

    Please let me confirm the following question. If possible, would you give us your comments by end of tomorrow in Japan time?

    [Question]
    When customer created the Timer with using DMTimer 2 like below codes, it failed with the return value of "NULL".
    What do you think the cause of this problem? Of course, if you find any lack of settings, please let me know. Also, would you teach the way to explore the cause in such a case?

    * Cfg configuration
    var Timer = xdc.useModule('ti.sysbios.hal.Timer');
    var DMTimer = xdc.useModule('ti.sysbios.timers.dmtimer.Timer');

    *Application code
    Timer_Params_init( &aTimerParams );
    aTimerParams.arg = 1; // DMTIMER3 ID=1
    aTimerParams.extFreq.lo = 20000000;//(20MHz)
    aTimerParams.period = 0xFFFFFFFF;
    aTimerParams.periodType = ITimer_PeriodType_COUNTS;
    aTimerParams.runMode = ITimer_RunMode_CONTINUOUS;
    aTimerParams.startMode = ITimer_StartMode_USER;
    aTimerParams.intNum = -1;
    aTimerHandle = Timer_create(0, NULL、&timerParams, &aErrBlk)

    [Environments]
    Hardware: AM3358 Starter Kit
    Software: bios_6_73_00_12

    If you have any questions, please let me know.
    Best regards.
    Kaka

  • Kaka,

    It is unclear if your question is about GEL files or RTOS configuration to use DMtimer.

    GEL configuration:

    Refer to the post here. To use other timers, you need to configure the PRCM for the timer 

    https://e2e.ti.com/support/legacy_forums/embedded/tirtos/f/355/t/303860

    https://e2e.ti.com/support/legacy_forums/embedded/tirtos/f/355/t/360858

    RTOS configuration

    In RTOS each DMTimer has a Timer ID associated with it. If you select the clock or timer module and configure the timer ID you can use that DMTimer. The timer mapping is located in the BIOS package at location

    bios_6_73_01_01\packages\ti\sysbios\timers\dmtimer\doc-files

    I have attached the file for your reference

    <!--
     *  Copyright (c) 2012, Texas Instruments Incorporated
     *  All rights reserved.
     * 
     *  Redistribution and use in source and binary forms, with or without
     *  modification, are permitted provided that the following conditions
     *  are met:
     * 
     *  *  Redistributions of source code must retain the above copyright
     *     notice, this list of conditions and the following disclaimer.
     * 
     *  *  Redistributions in binary form must reproduce the above copyright
     *     notice, this list of conditions and the following disclaimer in the
     *     documentation and/or other materials provided with the distribution.
     * 
     *  *  Neither the name of Texas Instruments Incorporated nor the names of
     *     its contributors may be used to endorse or promote products derived
     *     from this software without specific prior written permission.
     * 
     *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
     *  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
     *  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     *  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
     *  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
     *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     *  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
     *  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
     *  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
     *  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
     *  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     * -->
    <!--
       - run generated javascript code that creates Timer HTML tables parsed from
       - Timer.xs
    -->
    <script Language="Javascript" type="text/javascript" src="./TimerTables.js"></script>
    

    Setting timer ID can be done as shown in the E2E thread below:

    http://processors.wiki.ti.com/index.php/Processor_SDK_RTOS:_TI_RTOS_Tips_And_Tricks#How_to_set_input_frequency_in_SYSBIOS_configuration_and_change_timer_used_by_clock_module 

    Regards,

    Rahul

  • The complete solution with with the GEL update to enable PRCM is available in the E2E thread below:

    e2e.ti.com/.../657370
  • Hi Rahul,

    Thank you for your response.
    Customer would like to know the case of enabling the DMTIMER on RTOS.(not GEL file)
    I would like to know how should I do the process to enable the Timers on RTOS like the following GEL file description.
    ***************
    #define CM_PER (0x44e00000)
    #define CM_DPLL (0x44e00500)
    #define CLKSEL_TIMER4_CLK (CM_DPLL + 0x0C)
    #define CM_PER_TIMER4_CLKCTRL (CM_PER + 0x88)
    ----
    WR_MEM_32(CM_PER_TIMER4_CLKCTRL, 0x2);
    WR_MEM_32(CLKSEL_TIMER4_CLK, 0x2);
    -----
    ***************

    Would you please guide it? Does they only follow the following guide?
    processors.wiki.ti.com/.../Processor_SDK_RTOS:_TI_RTOS_Tips_And_Tricks

    For example, used the DMTimer 4

    var Timer = xdc.useModule('ti.sysbios.timers.dmtimer.Timer');
    Clock= xdc.useModule('ti.sysbios.knl.Clock');
    Clock.timerId = 2;

    If you have any questions, please let me know.
    Best regard.
    Kaka
  • Hi Rahul,

    Thank you for your information.
    I confirmed the GEL solution to enable the DMTimer. As I said previous post, I would like to know the solution/method to enable the DMTimer on the RTOS.

    Best regards.
    kaka