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.

SK-AM62A-LP: AM62A-LP MCU+ PWM

Part Number: SK-AM62A-LP
Other Parts Discussed in Thread: SYSCONFIG, UNIFLASH

Tool/software:

Hey all,

If someone could idiot-proof this for me I'd be grateful. 

1. Can I output pwm on the 4 mcu+ timers? 

2. I read that there can be resource reallocation to the mcu domain, does this include epwm for this processor? I saw it as part of the sdk for other processors but not this one. 

2.1. If yes, would this mean that those epwm pins themselves can be controlled by the mcu without the A cores being active? 

2.2. Can this be added to the sysconfig and peripheral drivers in the sdk if so? 

If someone could toss together code or even pseudo code/steps for doing either an LED fade or a servo cycle to this end, I'd be super grateful. Or pointing me at the correct docs would be great too. 

  • Hi Noah, which SDK are you checking?

    I see EPWM examples on AM62Ax MCU+ SDK 10.01.00 (AM62Ax MCU+ SDK: EPWM Duty Cycle). One of the MCU+SDK examples listed there is for "r5fss0-0 freertos".

    Also, we have an FAQ on how to create PWM with Timers: [FAQ] PROCESSOR-SDK-AM64X: How to create a PWM using a timer - Processors forum - Processors - TI E2E support forums

    Please let me know if this is what you were looking for.

    thank you,

    Paula

  • Paula, thank you for this. I guess I have a lot more reading to do! The flexibility of which peripherals can be used by which core is so freaking cool.

    Would it be at all possible for the features shown here to be added to the web version of the sysconfig tool?: https://software-dl.ti.com/mcu-plus-sdk/esd/AM62AX/latest/exports/docs/api_guide_am62ax/MAIN_DOMAIN_PERIPHERAL_FROM_MCU.html

  • Hey Paula, I cannot seem to get this example to run. It compiles fine in CCS, but even with the debugging workarounds, I am not getting the expected output. The core just hangs on "running." I also cannot see any signals on pin 24.

  • Hi Noah, 

    EPWM duty cycle demo runs for 60s, you can increase that if you want to (\examples\drivers\epwm\epwm_duty_cycle\epwm_duty_cycle.c)

    /* APP run time in seconds */
    #define APP_EPWM_RUN_TIME               (60U)

    Also did you get anything printed at the end? Expected below after demo finishes

        DebugP_log("EPWM Duty Cycle Test Passed!!\r\n");
        DebugP_log("All tests have passed!!\r\n");

    If it still hangs, where it is hanging?

    thank you,

    Paula

  • Hey Paula, thank you for the reply.

    I did attempt in both cases to "wait out" the program to see if there would be output, but there is none in both the GEL and CIO windows. I also modified this timeout to see if it could be triggered faster. Unfortunately no luck.

    If I pause the core, I get the following output. It seems to be missing a file "../rm_pm_hal/rm_pm_hal_src/lpm/main.c" strangely enough though, the program has no compile errors...

  • Hi Noah, let me a couple of days to get a setup ready with a scope. By the way, which CCS version are you using?

    thank you,

    Paula

  • Hey Paula,

    I'm using 20.0.2, I'm interested in your results for another project, I might move away from ePWM for my original application though, I need to be able to both generate and capture PWM with this pin, and it seems that ePWM doesn't have this capability. eCAP seems to, but there aren't enough of them on this chip for my application (need at least 4 channels). I'll probably use timers for my original use-case.

  • Hi Noah, then let's close this E2E thread and open a new one if need it later

    thank you.

    Paula

  • Hey Paula, I shouldn't have mentioned my other project. In either case I do still need ePWM and would be grateful for your help.

  • ah ok, then give me a day or two to have a setup ready

    thank you,

    Paula

  • Noah, one more thing, could you please let me know how are you loading and running the demo?

    What I usually do after compilation when running/debugging and application

    1) Flash SoC init application: AM62Ax MCU+ SDK: EVM Setup

    2) Load/Run with CCS AM62Ax MCU+ SDK: CCS Launch, Load and Run

    Alternatively, instead of flashing the SoC init, you can get the board to init using a script, but I found flashing "default_sbl_null_hs_fs.cfg" once is a more effective and less prone to errors way to go.

    thank you,

    Paula 

  • Presently the "launch load run" documentation is not applicable to the latest version of CCS, and on the latest version of CCS, this "debug/flash" functionality is partially broken (see this thread: https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1465529/sk-am62p-lp-no-compatible-debug-core-found-error). Using the workaround from this thread, I am able to load and debug binaries for other examples to this core such as the hello world and LED blink examples, but not this ePWM one.

  • Hi Noah, sorry for the issues you have been facing. In my setup I have CCS 12.5 and MCU+SDK demos works OK. It probably was a timing issue. AM62A MCU+SDK 10.1 was released at the end of December last year and CCS 20 as well. Most (if not all) all the development of 10.1 was done with CCS12.x as well as its documentation. 

    Thank you,

    Paula 

  • Hi Noah, sorry for my late reply, finally got a chance to test "epwm_duty_cycle_am62ax-sk_r5fss0-0_freertos_ti-arm-clang"

    I am using CCS 12.5 and mcu_plus_sdk_am62ax_10_01_00_33

    1) I flashed Init null sbl by following AM62Ax MCU+ SDK: EVM Setup. Please keep in mind that for AM62Ax "default_sbl_null_hs_fs.cfg" uses "

    sbl_uart_uniflash_stage2" which is not in "sbl_prebuilt" folder, so you need to build it (using CCS or makefiles) and update the path if needed. I didn't build a "DM image" so I commented last line from "default_sbl_null_hs_fs.cfg" 
    # DM image is flashed at 0xC0000 or to whatever offset your bootloader is configured for
    #--file=../../examples/hello_world/am62ax-sk/r5fss0-0_freertos/ti-arm-clang/hello_world.release.appimage.hs_fs --operation=flash --flash-offset=0xC0000
    2) Change Boot mode to "OSPI NAND BOOT MODE" 
    Starting NULL Bootloader ...

    SYSFW Firmware Version 10.1.8--v10.01.08 (Fiery Fox)
    SYSFW Firmware revision 0xa
    SYSFW ABI revision 4.0

    INFO: Bootloader_runCpu:176: CPU mcu-r5f is initialized to 800000000 Hz !!!
    INFO: Bootloader_runCpu:176: CPU a530-0 is initialized to 1400000000 Hz !!!
    INFO: Bootloader_runCpu:176: CPU a530-1 is initialized to 1400000000 Hz !!!
    INFO: Bootloader_runCpu:176: CPU a531-0 is initialized to 1400000000 Hz !!!
    INFO: Bootloader_runCpu:176: CPU a531-1 is initialized to 1400000000 Hz !!!
    INFO: Bootloader_runCpu:176: CPU c7x0-0 is initialized to 850000000 Hz !!!
    WARNING: Bootloader_rprcImageLoad:340: Software version mismatch, Installer version 0xa010021, AppImage version 0x1
    Some tests have failed!!
    INFO: Bootloader_JumpSelfCpu:248: All done, jumping self ...
    Need to check why I am getting a Warning.. maybe hello world is used for some DM firmware IPC verification.. nevertheless, we can keep going
    3) Connect scope to J3 (User Expansion Connector), pin 24 to scope
    4) In CCS, import/build "epwm_duty_cycle_am62ax-sk_r5fss0-0_freertos_ti-arm-clang", connect target (Target configurations, AM62A.ccxml -> Launch selected target)
    5) connect WKUP_R5FSS0_0 and load/run *.out program
    6) 1KHz signal should be observed in the scope
    Just FYI, If you are planning to use "MCU_R5FSS0_0" there is another thread in which I explored how to port it there:
     
    Thank you,
    Paula
  • Noah, one more thing. Please keep in mind we specify the CCS version used for development and testing in MCU+SDK User Guide

    AM62Ax MCU+ SDK: Download, Install and Setup CCS

    For AM62Ax 10.1 it is CCS 12.8.1

    Thank you,

    Paula

  • Hey Paula, I'm getting the same behavior in CCS 12.8.1. It seems to "run" fine, the core starts right away with no output when I click "debug" and there is no output on pin 24. I do seem to be running the correct bootloader/shim code, and as before, hello world has no issues.

    tio /dev/ttyUSB0
    [20:26:46.868] tio 3.8
    [20:26:46.868] Press ctrl-t q to quit
    [20:26:46.868] Warning: Could not open /dev/ttyUSB0 (No such file or directory)
    [20:26:46.868] Waiting for tty device..
    [20:27:01.885] Connected to /dev/ttyUSB0
    
    Starting NULL Bootloader ... 
    
    SYSFW Firmware Version 10.1.8--v10.01.08 (Fiery Fox)
    SYSFW Firmware revision 0xa
    SYSFW ABI revision 4.0
    
    INFO: Bootloader_runCpu:176: CPU mcu-r5f is initialized to 800000000 Hz !!!
    INFO: Bootloader_runCpu:176: CPU a530-0 is initialized to 1400000000 Hz !!!
    INFO: Bootloader_runCpu:176: CPU a530-1 is initialized to 1400000000 Hz !!!
    INFO: Bootloader_runCpu:176: CPU a531-0 is initialized to 1400000000 Hz !!!
    INFO: Bootloader_runCpu:176: CPU a531-1 is initialized to 1400000000 Hz !!!
    INFO: Bootloader_runCpu:176: CPU c7x0-0 is initialized to 850000000 Hz !!!
    INFO: Bootloader_loadSelfCpu:229: CPU r5f0-0 is initialized to 800000000 Hz !!!
    INFO: Bootloader_JumpSelfCpu:248: All done, jumping self ...
    

  • Noah, no sure, but let's check few things.

    - In debug mode if you "suspend" where is the code stopping?

    - Can you check if debug logs are enabled (they should be)? if not, enabling them (snapshot below), and maybe add some prints with DebugP_log()? To get a better feeling what is getting executed and it there is any hang. You can achieve the same, if you prefer, by putting some breakpoints and steeping into the code  

    - Also, maybe also worthy to double check you have correct "ground" pin connected in J3 (User Expansion Connector) along with pin 24

    thank you,

    Paula

  • Paula, truly sorry for the delay on this. I did confirm the sysconfig settings (debug and epwm assignments). This is what I get when "pausing" execution.