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.

LP-AM243: Changing MCU clock speed

Part Number: LP-AM243

Hi,

How can I change the MCU clock speed of the AM243?

Best regards,

Jesse

  • Hi Jesse,

    Here is how to change the Clock frequency for AM243x. In C:\ti\mcu_plus_sdk_am243x_08_02_00_31\source\drivers\bootloader\soc\am64x_am243x\bootloader_soc.c, there is a structure gCoreBootInfo. You can change the .defaultClockHz for any core ("r5f0-0", "r5f0-1", "r5f1-0" or "r5f1-1" even "m4f0-0").

    After change the gCoreBootInfo, you will need to re-build the sbl_null and then flash it into the OSPI. Refer to AM243x MCU+ SDK: EVM Setup (ti.com) for details.

    Best regards,

    Ming

  • Hi Ming,

    When you say re-build the sbl_null, do we rebuild the sbl_null project in ccs with the edited bootloader_soc.c file included the project?

    Here are the steps I'm currently following:

    1. Import sbl_null_am243x-lp... project from SDK into CCS
    2. Import bootloader_soc.c into project and modify clock frequency
    3. Build project
    4. Use *.tiimage from rebuilt project to replace sbl_null.release.tiimage specified by default_sbl_null.cfg
    5. Follow steps here to flash the updated sbl_null

    Are these steps correct to preserve clock change? Does it look like I'm missing anything?

    Best regards,

    Jesse

  • Hi Jesses,

    The most steps you did are correct. The only thing you missed is the re-build of the drivers library after you change the bootloader_soc.c. You do not need to import the bootloader_soc.c into your CCS project

    cd C:\ti\mcu_plus_sdk_am243x_08_02_00_31

    gamke -s -f makefile.am243x drivers_r5f.ti-arm-clang_clean

    gamke -s -f makefile.am243x drivers_r5f.ti-arm-clang

    then re-build the sbl_null project.

    Best regards,

    Ming

  • Hi Ming,

    I followed the steps above, but when I run my application (in debug mode in CCS), I still see that the clock is initialized to 800 MHz when I check the CPU frequency using Bootloader_socCpuGetClock().

    However, I have seen that if I call Bootloader_socCpuSetClock() at the beginning of my application code to set the CPU frequency to the desired frequency (for example 200 MHz) and then read the CPU frequency using Bootloader_socCpuGetClock(), I see that the clock has been updated to 200 MHz.

    Is using Bootloader_socCpuSetClock() in my application code like this a valid way to update or change the CPU clock frequency?

    Best regards,

    Jesse

  • Hi Jesses,

    After you  re-build the sbl_null project, did you flash the newly built sbl_null into your flash (AM243x MCU+ SDK: EVM Setup (ti.com))? Otherwise, you are still using the pre-built sbl_null from the MCU+SDK.

    Of course. calling Bootloader_socCpuSetClock() from your application code is also the do the rick, but eventually you will need to do the CPU frequency change in sbl_null or sbl_ospi.

    Best regards,

    Ming