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.

AM620-Q1: Failed to use mcu only mode

Part Number: AM620-Q1
Other Parts Discussed in Thread: SK-AM62-LP

Tool/software:

Hi TI Teams,

We use our own MCU engineering +EVB board test can not use MCU only mode,

modify the routine, using ipc_rpmsg_echo_linux_am62x-sk-lp_m4fss0-0_freertos_ti-arm-clang+EVB board test still can not work,

Here are the test steps and log:

1.Testing using our own MCU engineering +EVB board:

echo 100  > /sys/devices/system/cpu/cpu0/power/pm_qos_resume_latency_us

echo mem > /sys/power/state

echo 100  > /sys/devices/system/cpu/cpu0/power/pm_qos_resume_latency_us

rtcwake -m mem -s 10

When entering MCU only mode in the above two ways, it can not wake up, and it can not wake up in R5 serial port input,

and it will be reset automatically after 3 minutes.

2.Modify the routine to use the ipc_rpmsg_echo_linux_am62x-sk-lp_m4fss0-0_freertos_ti-arm-clang+EVB board test:

echo 100  > /sys/devices/system/cpu/cpu0/power/pm_qos_resume_latency_us

echo mem > /sys/power/state

 

echo 100  > /sys/devices/system/cpu/cpu0/power/pm_qos_resume_latency_us

rtcwake -m mem -s 10

When entering MCU only mode in the above two ways, it can not wake up,

and it can not wake up in R5 serial port input, and it will be reset automatically after 3 minutes.

The part in the red box in the following figure is our modification in the routine

  • Hello Walter,

    Lets do this step by step:

    1. First, lets check using the default Linux SDK code with NO changes on a TI EVM (like SK-AM62-LP), does MCU only work?

    I've tested SDK 10.1 MCU only on SK-AM62-LP which does work correctly on my end using this exact image: https://www.ti.com/tool/download/PROCESSOR-SDK-LINUX-AM62X/10.01.10.04

    2. Then lets run MCU Only with your IPC echo example changes on the TI EVM. Does MCU only work?

    If this does not, then it might be an caused by the IPC echo firmware and we can debug from there.

    3. If that does works, then we can check on your custom hardware.

    modify the routine, using ipc_rpmsg_echo_linux_am62x-sk-lp_m4fss0-0_freertos_ti-arm-clang+EVB board test still can not work,

    Please share all changes you've made to the IPC example code.

    it can not wake up in R5 serial port input,

    Please explain how you are testing this wake up source. The simplest way is:

    HOST PC~$ echo a > /dev/ttyUSB2

    Best Regards,

    Anshu

  • Hello Walter,

    Can you also explain how the IPC echo firmware that you used was developed? 

    The standard IPC RPMSG echo Linux file has all the components to support low power modes: https://github.com/TexasInstruments/mcupsdk-core-k3/blob/k3_main/examples/drivers/ipc/ipc_rpmsg_echo_linux/ipc_rpmsg_echo.c

    Its recommended to use the this file as the base and build upon it.

    Best Regards,

    Anshu

  • Hi Anshu,

    In the above picture, we have already shared all the modifications made in the example.

    We need to first prove that the MCU continues to operate after entering the mcu only mode.

    Thanks

  • Hi Anshu,

    I update the latest phenomenon.

    After pulling out the U disk, AM62 can be woked up through the RTC and the wake-up source configured by us.

    The MCU still does not continue to run after sleeping, but does not restart when waking up,

    but continues to run from the place stopped when sleeping

    Thanks

  • Hi Anshu,

    According to the description in the ti sdk documentation, in the "MCU Only" mode,

    the MCU should be operating normally.

    However, our tests have shown that the MCU did not continue to run after entering the "MCU Only" mode.

    Do you have any logs to support this?

    Perhaps you could refer to my modifications and then test it again, and provide the MCU log as evidence.

    Thanks

  • Hi Walter,

    After some debugging, we determined that when a USB device is connected to the processor then entered Deep Sleep or MCU only, the SoC sometimes crashes. We believe it might be caused by the TIFS which is the reason it will reset after 3 minutes because its the timer expires.

    We're still trying to root cause the issue, but we were able to replicate the issue.

    Thanks,

    Anshu

  • Hi Walter,

    Can you confirm if USB will be one of the possible wake up sources?

    Thanks,
    Anshu

  • Hi Walter,

    Can you share the schematic for the USBx_DRVVBUS signal from the SoC?

    Are there any pull resistors on that signal?

    Best Regards,

    Anshu

  • Hi Anshu,

    Only test point,no pull resistors on USBx_DRVVBUS.

    BR

    Chason

  • Hi Anshu,

    The test phenomena and test procedures I mentioned were all tested on the EVB board with the modified program.

    It's not our own project board.

    Thanks

  • Hello Walter

    Thanks for clarifying that you are doing the experiments on the TI EVM. 

    Can you clarify which version of the EVM you have ( silkscreen should have that detail) 

    I believe on the EVM there is a 10K pull down on the USB1 DRVBUS that should be removed to test this feature reliably 

    Additionally The VBUS_5V0_TYPEA should be 5V in Deep sleep/ MCU only mode in order for wakeup to work , you can check this at the TP203 to confirm if that is the case or not for your EVM test. 

  • Hi, Mukul & Anshu

    Update debug status, beside USB wakeup

    I think we create this thread is try to discussion why MCU do not keep working in "MCU Only mode"

    Because as far as I know, MCU program should be keep running when AM62x in "MCU only mode".

    Pls check attachment, and I found some problems

    (1) Pls ref main,c, even we already set "MCU_GPIO0_14" as an wakeup source in linux device tree, but customer seems re-init this gpio in MCU code again, is it reasonable? because as far as I know, even "deep sleep mode" or "MCU only mode" gpio wakeup, we only support Linux device tree setting officially, isn't? Does it a concern?

    static Pinmux_PerCfg_t fii_PinMuxMcuDomainCfg[] =
    {
     /* MCU_GPIO0 pin config */
         /* MCU_GPIO0_14 -> MCU_MCAN0_RX (C4) MCU_CAN1_INH*/
         {
             PIN_MCU_MCAN0_RX,
             0x28054087
         },
        {PINMUX_END, 0U}
    };

    (2) Pls reference "ipc_rpmsg_echo.c" for function "lpm_mcu_wait_for_uart()"

    Once AM62 works in mcu only mode, this function (lpm_mcu_wait_for_uart) should be keep running, and print the string "MCU is running" in while loop.

    but we found this function in suspend until AM62 wakeup.

    Does uart output will disable in MCU only mode?

    Source code as attachment.

    update status first, and keep debugging.

    #if defined(ENABLE_MCU_ONLY_LPM)
    static void lpm_mcu_wait_for_uart()
    {
        UART_Transaction trans;
        uint8_t uartData;
        int32_t status;
        uint32_t cnt = 0U;
    
        UART_Transaction_init(&trans);
    
        /* Read 1 byte */
        trans.buf   = &uartData;
        trans.count = 1U;
    
        DebugP_memLogWriterPause();
    
        gNumBytesRead = 0u;
    
        while(1)
        {
            if(cnt < 0xFFFFF)
            {
                cnt++;
            }
            else
            {
                DebugP_log("MCU is running\r\n");
                cnt = 0U;
            }
    # if 0
            if (cnt == 0xFFFFFF)
            {
                //SOC_triggerMcuLpmWakeup();
                /* Wait for resuming the main domain */
                //SemaphoreP_pend(&gLpmResumeSem, SystemP_WAIT_FOREVER);
                DebugP_log("cnt = %u\r\n",(cnt / 0xFFFF));
            }
    #endif
        }
    
    
    # if 1
        /* Wait for any key to be pressed */
        status = UART_read(gUartHandle[CONFIG_UART0], &trans);
        DebugP_assert(status == SystemP_SUCCESS);
    
        while (gNumBytesRead == 0u && gbSuspended == 1u)
        {
        }
    
        if (gNumBytesRead != 0)
        {
            DebugP_log("[IPC RPMSG ECHO] Key pressed. Notifying DM to wakeup main domain\r\n");
            SOC_triggerMcuLpmWakeup();
            /* Wait for resuming the main domain */
            SemaphoreP_pend(&gLpmResumeSem, SystemP_WAIT_FOREVER);
    
            DebugP_log("[IPC RPMSG ECHO] Main domain resumed due to MCU UART \r\n");
        }
        else if (gbSuspended == 0u)
        {
            UART_readCancel(gUartHandle[CONFIG_UART0], &trans);
            DebugP_log("[IPC RPMSG ECHO] Main domain resumed from a different wakeup source \r\n");
        }
    #endif
        DebugP_memLogWriterResume();
    }
    
     

    ipc_rpmsg_echo_linux_am62x-sk-lp_m4fss0-0_freertos_ti-arm-clang.zip

    Thank You.

    Gibbs

  • Hi, Dear Expert

    Update status,

    Board : SK-AM62-LP

    SW : 10.00.00.04

    We need an example code,

    we need MCU uart (M4 uart) always "keep string output"  in normal operation mode and MCU olny mode.

    I think we can base on this project for modification.

    --> ipc_rpmsg_echo_linux_am62x-sk-lp_m4fss0-0_freertos_ti-arm-clang

    After few day testing, base on this sample project, we found MCU core (M4) is keep running, but root cause should be any I/O (like uart) which can not normal operation.

    Thank You.

    Gibbs

  • Hi Gibbs,

    Regarding the USB DRVVBUS Signal

    On the SK-AM62-LP, the observation we made was this signal goes low in Deep Sleep likely due to a 10k ohm pull down resistor. This has caused any low power mode to fail when the a USB A device is connected to the EVM. What would happen is the TIFS would timeout after 3 minutes because it loses contact with the DM Firmware, causing the whole SoC to reset.

    We de-soldered this resistor and were able to successful suspend/resume when a USB A device is connected. 

    Can we try this on your SK-AM62-LP EVM to make sure this also works for you?

    M4F IPC Firmware

    but customer seems re-init this gpio in MCU code again, is it reasonable?

    Peripherals cannot be shared across different operating systems. Once Linux claims a peripheral like a GPIO to be a wakeup source, the MCU is not expected to use the same GPIO. At that point it creates a conflict in the ownership of the peripheral and may cause unexpected behavior. 

    this function (lpm_mcu_wait_for_uart) should be keep running, and print the string "MCU is running" in while loop.

    I haven't tried your exact code, but I have tried printing numbers during MCU only mode. What I've noticed is the code is still executing, but it will not print to the UART terminal because its waiting for an incoming UART byte from a user's key press.

    I made a rough example:

    This is the MCU M4F firmware where I added code to print a count down of numbers. 

    This is the code change I made where it sets a variable to 500 then counts down every 1 second.

    #endif
        DebugP_log("<DEBUG> recieve task\r\n");
        /* create message receive tasks, these tasks always run and never exit */
        ipc_rpmsg_create_recv_tasks();
    
        /* wait for all non-Linux cores to be ready, this ensure that when we send messages below
         * they wont be lost due to rpmsg end point not created at remote core
         */
         DebugP_log("<DEBUG> Timer print stuff\r\n");
         uint32_t    loopcnt = 500, delaySec = 1;
         while(loopcnt > 0)
         {
             DebugP_log("<DEBUG> Number %d\r\n", loopcnt);
             ClockP_sleep(delaySec);
    
             loopcnt--;
         }
         DebugP_log("<DEBUG> sync all\r\n");
        IpcNotify_syncAll(SystemP_WAIT_FOREVER);

    What I observed is when the SoC suspends, the code still executes but doesn't printout. Here is the linux logs showing it suspends for 5 seconds:

     

    rtcwake -m mem -s 5
    rtcwake: wakeup from "mem" using /dev/rtc0 at Wed Jun 25 22:39:50 2025
    [ 1081.970150] PM: suspend entry (deep)
    [ 1081.974284] Filesystems sync: 0.000 seconds
    [ 1081.993505] Freezing user space processes
    [ 1081.999462] Freezing user space processes completed (elapsed 0.001 seconds)
    [ 1082.006472] OOM killer disabled.
    [ 1082.009703] Freezing remaining freezable tasks
    [ 1082.015666] Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
    [ 1082.023072] printk: Suspending console(s) (use no_console_suspend to debug)
    [ 1082.055583] ti-sci 44043000.system-controller: ti_sci_cmd_set_device_constraint: device: 10
    [ 1082.055772] ti-sci 44043000.system-controller: ti_sci_cmd_set_device_constraint: device: 10
    [ 1082.056622] am65-cpsw-nuss 8000000.ethernet eth0: Link is Down
    [ 1082.063972] ti-sci 44043000.system-controller: ti_sci_cmd_set_device_constraint: device: 10
    [ 1082.064182] ti-sci 44043000.system-controller: ti_sci_cmd_set_latency_constraint: latency:0
    [ 1082.097989] Disabling non-boot CPUs ...
    [ 1082.100553] psci: CPU1 killed (polled 0 ms)
    [ 1082.104309] psci: CPU2 killed (polled 0 ms)
    [ 1082.108638] psci: CPU3 killed (polled 0 ms)
    [ 1082.110451] Enabling non-boot CPUs ...
    [ 1082.110891] Detected VIPT I-cache on CPU1
    [ 1082.110945] GICv3: CPU1: found redistributor 1 region 0:0x00000000018a0000
    [ 1082.111011] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
    [ 1082.112365] CPU1 is up
    [ 1082.112653] Detected VIPT I-cache on CPU2
    [ 1082.112685] GICv3: CPU2: found redistributor 2 region 0:0x00000000018c0000
    [ 1082.112729] CPU2: Booted secondary processor 0x0000000002 [0x410fd034]
    [ 1082.113862] CPU2 is up
    [ 1082.114174] Detected VIPT I-cache on CPU3
    [ 1082.114211] GICv3: CPU3: found redistributor 3 region 0:0x00000000018e0000
    [ 1082.114262] CPU3: Booted secondary processor 0x0000000003 [0x410fd034]
    [ 1082.115441] CPU3 is up
    [ 1082.115972] ti-sci 44043000.system-controller: ti_sci_resume: wakeup source: 0x50
    [ 1082.133086] am65-cpsw-nuss 8000000.ethernet: set new flow-id-base 19
    [ 1082.142518] am65-cpsw-nuss 8000000.ethernet eth0: PHY [8000f00.mdio:00] driver [TI DP83867)
    [ 1082.142544] am65-cpsw-nuss 8000000.ethernet eth0: configuring for phy/rgmii-rxid link mode
    [ 1082.375129] OOM killer enabled.
    [ 1082.378275] Restarting tasks ... done.
    [ 1082.384426] random: crng reseeded on system resumption
    [ 1082.389847] k3-m4-rproc 5000000.m4fss: Core is on in resume
    [ 1082.395647] k3-m4-rproc 5000000.m4fss: received echo reply from 5000000.m4fss
    [ 1082.408784] PM: suspend exit
    

    So when I suspend for 5 seconds into MCU Only mode (375 on the MCU counter), it will start printing again after 5 seconds when it resumes.

    <DEBUG> Number 380
    <DEBUG> Number 379
    <DEBUG> Number 378
    <DEBUG> Number 377
    <DEBUG> Number 376
    <DEBUG> Number 375
    <DEBUG> SemaphoreP_pend(&gLpmSuspendSem, SystemP_WAIT_FOREVER)
    <DEBUG> Sciclient_lpmGetNextHostState
    <DEBUG> passed the if statement
    [IPC RPMSG ECHO] Next MCU mode is 1
    [IPC RPMSG ECHO] Suspend request to MCU-only mode received 
    [IPC RPMSG ECHO] Press a single key on this terminal to resume the kernel from MCU only mode 
    <DE\ufffd[IPC RPMSG ECHO] Main domain resumed from a different wakeup source 
    <DEBUG> start of while loop
    <DEBUG> Number 369
    <DEBUG> Number 368
    <DEBUG> Number 367
    <DEBUG> Number 366
    <DEBUG> Number 365
    

    Whats likely occurring is the UART buffer is not printing anything because its prioritizing a user's input to wakeup the device as indicated by:

    [IPC RPMSG ECHO] Press a single key on this terminal to resume the kernel from MCU only mode 

    We can run some deeper tests, but this has indicated to me that its still running but just not printing.

    SW : 10.00.00.04

    When did the SDK versions change? In prior threads, SDK 10.1 was being used. 

    Best Regards,

    Anshu

  • Hi, Ansu

    Thanks your replies.

    Here are some quick feedback and few question

    Q1/A1 : When did the SDK versions change? In prior threads, SDK 10.1 was being used. 

    I use SDK  SDK 10.1 for testing, customer use SDK  10.00 for testing. Both of these two version has the same problem. But basically, I think it should be coding issues.

    Q2/A2 : Do you think place customized code in thread function "lpm_mcu_wait_for_uart()" is reasonable?

    code modify as below, concept discussion.

    we disable uart wake up, but we remain mcu_gpio make up from MCU only mode.

    Because customer say they place some gpio program in this function, it also does not trigger.

    I suspect it should be have RTOS Task priority problems.

    static void lpm_mcu_wait_for_uart()
    {
        UART_Transaction trans;
        uint8_t uartData;
        int32_t status;
    
        //UART_Transaction_init(&trans);
    
        /* Read 1 byte */
        //trans.buf   = &uartData;
        //trans.count = 1U;
    
        //DebugP_memLogWriterPause();
    
        //gNumBytesRead = 0u;
    
        /* Wait for any key to be pressed */
        //status = UART_read(gUartHandle[CONFIG_UART0], &trans);
        //DebugP_assert(status == SystemP_SUCCESS);
    
        //while (gNumBytesRead == 0u && gbSuspended == 1u)
        //{
        //}
    
        while(1){
    
    	// Place customized code here
            // and do something.
    	// example another uart / gpio action
    
        }
    
    
        // Because we do not need mcu uart wakeup
        // but keep another mcu gpio wake up
        // this gpio test in Linux device tree, and it works.
        if (gNumBytesRead != 0)
        {
            //DebugP_log("[IPC RPMSG ECHO] Key pressed. Notifying DM to wakeup main domain\r\n");
            //SOC_triggerMcuLpmWakeup();
            /* Wait for resuming the main domain */
            //SemaphoreP_pend(&gLpmResumeSem, SystemP_WAIT_FOREVER);
            //DebugP_log("[IPC RPMSG ECHO] Main domain resumed due to MCU UART \r\n");
        }
        else if (gbSuspended == 0u)
        {
            //UART_readCancel(gUartHandle[CONFIG_UART0], &trans);
            DebugP_log("[IPC RPMSG ECHO] Main domain resumed from a different wakeup source \r\n");
        }
    
        //DebugP_memLogWriterResume();
    }
    

    Thanks

    Gibbs

     

  • The customer reported that the problem that mcu cannot control IO in mcu only mode has been resolved.

    The future communication about IPC crash in resume has been moved to

    https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1532839/am620-q1-ipc-crash-in-resume-from-mcu-only-mode

  • Hello Gibbs,

    How is the customer using the MCU domain GPIO module? 

    Anshu showed me a diagram where an external CAN device is connected to the MCU CAN interface, and an MCU GPIO pin.

    1) Which core is controlling the CAN device on the MCU CAN interface?

    2) Which core is controlling the MCU GPIO module?

    lpm_mcu_wait_for_uart() - should you modify it? 

    The customer can modify any part of our examples that they like. However, if they try to do something that nobody at TI has tested, then we will be limited in the support that we can offer.

    The "low power GPIO wakeup" usecase that TI has tested is Linux controlling the MCU GPIO module, and Linux setting up MCU GPIO as a wakeup source as per https://software-dl.ti.com/processor-sdk-linux/esd/AM62X/10_01_10_04/exports/docs/linux/Foundational_Components/Power_Management/pm_wakeup_sources.html .

    If Linux is also the owner of MCU GPIO in the customer design, I would suggest using the TI-tested wakeup implementation.

    Regards,

    Nick

  • Hi, Nick

    Simple answer your question, discussion is under MCU Only Mode

    Q1/A1 : Which core is controlling the CAN device on the MCU CAN interface?

    MCU M4 core control MCU MCAN

    Q2/A2 : Which core is controlling the MCU GPIO module?

    It you talk about "wake up GPIO", I think A53 core control this wakeup gpio, because we coding it in linux device tree (DTS) .

    But follow our SDK guide, we only support wakeup up gpio setting in linux DTS, isn't?

    https://software-dl.ti.com/processor-sdk-linux/esd/AM62X/10_01_10_04/exports/docs/linux/Foundational_Components/Power_Management/pm_wakeup_sources.html

    --> 3.3.6.2. MCU GPIO define

    so I recommand customer set any wakeup source in Linux DTS, and tell them pls DO NOT USE THIS wakeup source (gpio) in MCU code.

    Thanks

    Gibbs

  • Hi Gibbs,

    As per email discussion, this thread will be closed.

    Thanks,

    Anshu

  • Thanks, Anshu

    Pls close this thread.

  • Hi Walter, 

    The TIFS timeout will be discussed on this thread: e2e.ti.com/.../am620-q1-tifs-timeout
    Thanks,

    Anshu