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.

AM6442: AM64 TIMER_IOx pins in SYSCONFIG tool

Part Number: AM6442
Other Parts Discussed in Thread: SYSCONFIG, AM6422

Dear TI support team,

According to datasheet et TRM, AM64 has 12 timers module in MAIN domain and 4 timer modules in MCU domain.

There is 11 TIMER_IO pins and 4 MCU_TIMER_IO pins that can be configured as input capture or PWM/Output Compare.

In SYSCONFIG tool, I don't find all these timers neither MAIN nor MCU timers. There are only 6 "timers" named DMTIMER0 to DMTIMER5. Moreover, for these 6 timers, I don't find how to configure a TIMER_IOx pin to be used with the timer.

I am using SysConfig 1.25.0+4268. With this tool :

  • Can you explain how to setup the MAIN and the MCU domain timers ?
  • Can you explain how to configure a TIMER_IO pin to be driven by these timers ?

Regards,
Philippe

  • Hello,

    Allow me sometime to comment on this.

    Thanks,

    Vaibhav

  • Hello,

    When working on an application in MCU+ SDK, you can open the example.syscfg GUI.

    In this GUI, you will see the option to configure Timer.

    Please see the relevant screenshot below:

    I see when I am using the R5 example, I see that 6 timers are available:

    For the M4 example, I see 4 Timers seen:

    PLEASE NOTE: For your question of why the rest of the timers not available, they are used for FreeRTOS. So, they are not available for normal applications.

    Currently there are no examples on Timer. You can watch out for updates on this here: https://github.com/TexasInstruments/mcupsdk-core/tree/next/examples/drivers/timer/timer_interrupt

    I am preparing an example for your timer usecase.

    Meanwhile, you can refer the following as well:  [FAQ] PROCESSOR-SDK-AM64X: How to create a PWM using a timer 

    Regards,

    Vaibhav

  • Hi,

    I have prepared a timer example, showing how to use it and configure it.

    Basically a mechanism where Timer Starts and timer callback is called.

    You can simply use this example. Attaching the example here:

    r5fss0-0_nortos.zip

    Please note, that this is an empty R5 NORTOS example, where I have configured TIMER as follows:

    Attaching the empty.c file as well, for you to test out:

    /*
     *  Copyright (C) 2021 Texas Instruments Incorporated
     *
     *  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.
     */
    
    #include <stdio.h>
    #include <kernel/dpl/DebugP.h>
    #include "ti_drivers_config.h"
    #include "ti_drivers_open_close.h"
    #include "ti_board_open_close.h"
    
    /*
     * This is an empty project provided for all cores present in the device.
     * User can use this project to start their application by adding more SysConfig modules.
     *
     * This application does driver and board init and just prints the pass string on the console.
     * In case of the main core, the print is redirected to the UART console.
     * For all other cores, CCS prints are used.
     */
    
    static uint32_tloopCount = 0;
    
    void TimerCallback(void *args)
    {
        loopCount++;
    }
    
    void empty_main(void *args)
    {
        /* Open drivers to open the UART driver for console */
        Drivers_open();
        Board_driversOpen();
    
    
        TimerP_start(gTimerBaseAddr[CONFIG_TIMER0]);
        while(1)
        {
            DebugP_log("Loop: %u \r\n", loopCount);
        }
    
    #if defined(AMP_FREERTOS_A53)
        DebugP_log("All tests have passed on a53_core%d!!\r\n", Armv8_getCoreId());
    #else
        DebugP_log("All tests have passed!!\r\n");
    #endif 
        Board_driversClose();
        Drivers_close();
    }
    

    Hope this helps.

    Regards,

    Vaibhav

  • Hi Vaibhav, thanks for your response and your example.

    However, this needs some clarification and raises some more questions.

    Question 1: First, can you please check you have the same version of sysconfig (SysConfig 1.25.0+4268) that I am using. I notice some differences between your screenshot of sysconfig and my own sysconfig tool display; like RAT, DPL Config and PROFILE lines that is not shown on mine:

    On the TIMER configuration, I have only the 6 DMTIMER shown:

    Question 2 : Can you explain where sysconfig displays the 4 MCU_DMTIMER ?

    As explained in my ticket and coming from AM64 datasheet and TRM, AM64 features 12 TIMER in MAIN domain and 4 TIMER in MCU domain. FreeRTOS (or even Linux) may need a timer for their own purpose like periodic scheduler calls. But not all configuration needs FreeRTOS. On our configuration, we may use Linux on the 2 A53 cores but NORTOS on the 2 R5F cores (AM6422 chip).

    Question 3: Do you confirm that the 4 remaining MAIN domain timers are used or at least reserved internally by FreeRTOS instances ?

    Question 4: What if we use NORTOS config for R5F cores and linux for A53 cores ? Are these timers available ? Where are they displayed in sysconfig tool ?

    As I am currently working on a detailed pinout study to derisk a HW architecture, the most important point is regarding TIMER_IO pins

    From AM64 TRM :

     

    From AM64 datasheet :

    Question 5: Can you explain how to configure, in sysconfig tool, a TIMER_IOx pin to be driven by these timers ? Or in other words, what to do in sysconfig tool to have pinmux to configure these pins as TIMER_IO pins ?

    Question 6: On MAIN domain, there are only 6 "DMTIMER" available from sysconfig, can you confirm that:

    • DMTIMER0 (a named in sysconfig tool) correspond to TIMER0 (as named in AM64 datasheet and TRM) and TIMER_IO0 pin (as named in AM64 datasheet and TRM) is the PWM output of TIMER0.
    • DMTIMER1 (a named in sysconfig tool) correspond to TIMER1 (as named in AM64 datasheet and TRM) and TIMER_IO1 pin (as named in AM64 datasheet and TRM) is the PWM output of TIMER1.
    • ... etc... 
    • DMTIMER5 (a named in sysconfig tool) correspond to TIMER5 (as named in AM64 datasheet and TRM) and TIMER_IO5 pin (as named in AM64 datasheet and TRM) is the PWM output of TIMER5.

    Question 7: As a consequence of previous statements, can you confirm that TIMER6 to TIMER11 and therefore TIMER_IO6 to TIMER_IO11 pins are not usable as PWM or input capture event for user application ?

    Hope that my questions are clear. If not, don't hesitate to ask for clarification before answering.
    Thanks for your help, regards,
    Philippe.

  • Hello,

    Question 1: First, can you please check you have the same version of sysconfig (SysConfig 1.25.0+4268) that I am using. I notice some differences between your screenshot of sysconfig and my own sysconfig tool display; like RAT, DPL Config and PROFILE lines that is not shown on mine:

    On the TIMER configuration, I have only the 6 DMTIMER shown:

    In my setup as well, I see 6 options shown.

    Question 2 : Can you explain where sysconfig displays the 4 MCU_DMTIMER ?

    As explained in my ticket and coming from AM64 datasheet and TRM, AM64 features 12 TIMER in MAIN domain and 4 TIMER in MCU domain. FreeRTOS (or even Linux) may need a timer for their own purpose like periodic scheduler calls. But not all configuration needs FreeRTOS. On our configuration, we may use Linux on the 2 A53 cores but NORTOS on the 2 R5F cores (AM6422 chip).

    You have to select the M4 project in order to configure the MCU TIMER, for R5 Project you would see the DM Timer.

    Question 3: Do you confirm that the 4 remaining MAIN domain timers are used or at least reserved internally by FreeRTOS instances ?

    That is a correct understanding.

    For questions 4, 5 and 6, I would let Anil answer the same.

      can you help answer the questions 4, 5 and 6?

    Kind Regards,

    Vaibhav

  • Hi Anil, 

    Is it possible to answer the 3 remaining questions please ? 

    Thank you, 

    Geoffrey

  • Hello Geoffrey,

    The TIME_IOX pins cannot be configured from SysConfig.
    If the user wants to enable this functionality, it must be done manually in the application.

    I have created an FAQ on this topic that explains how to generate PWM using the Timer module.
    This FAQ covers:
    • How to enable the TIME_IOX pins
    • How to use them for PWM generation

    Please note:
    • SysConfig is mainly intended for MCU+SDK-based applications.
    • For Linux-based applications, Timer configuration must be done through the Device Tree (DTS), where you enable or disable the required Timers.

    Please refer to the AppNote given below .

    https://www.ti.com/lit/an/sdaa194/sdaa194.pdf?ts=1764225176492&ref_url=https%253A%252F%252Fwww.google.com%252F

    Timer Information for AM64X :

    The AM64X SoC includes multiple timers:
    • In the MAIN domain, there are a total of 11 DMTimers.
    • If SysConfig does not show all 11 timers, it is because some timers are internally used for other purposes—for example:
     RTOS scheduler on different cores 

    Also, please note that DMTIMER and TIMER refer to the same module.

     [FAQ] PROCESSOR-SDK-AM64X: How to create a PWM using a timer 

    Regards,

    Anil.

  • Dear TI support team. It is clear. Thanks for your help. Regards, Philippe