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.

AM625: How to develop on R5F

Part Number: AM625

Tool/software:

#1. Customer wants to develop AM62x R5F with EB Autosar, Would like to get farmilar with AM62x MCU SDK by themselves in advance, especially with R5F, how to start it? It is noted R5 can't be loaded, but there is R5F hello world example. 

#2. Board is init with NULL SBL already, which core is NULL SBL runing on? R5 only? 

  • Hello Tony,

    I feel that the link below is helpful to start work on the DM R5F core.

    Please let me know if you still need help from me.

    https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1510578/processor-sdk-am62x--sdk-am62x-the-r5-core-debug

    Regards,

    Anil.

  • #1. For a R5F application, just need to add a extra thread like the hello world example to call below two routine?

    /* Init LPM specific data */
    Sciclient_initDeviceManagerLPMData(&gDMLPMData);
    
    sciServer_init();

    #2. Will it start sciServer and keep running? is it just a one time call then was deleted in this example?

    #3. What does SBL NULL done? load TIFS? and start R5F sci sever? and else?

  • Hello Tony,

    Running Two Tasks (DM and Application) on R5F Core
    On the R5F core, we intend to run two separate tasks:
    1. Device Manager (DM) Task
    2. Application Task

    Device Manager (DM) Task Initialization
    The DM task is initialized through the sciServer_init() API, which:
    • Sets up the task parameters (priority, stack, etc.)
    • Creates and launches the DM task
    Once sciServer_init() is called, it does not need to be called again, as the DM task continues running in the background.

    Low Power Mode (LPM) Data Initialization
    The Sciclient_initDeviceManagerLPMData() API is required to:
    • Set up LPM data structures used by the DM task
    • Ensure proper handling of low power scenarios

    Even if the SBL_NULL does the same procedure, they do call the SCI server and Sciclient_initDeviceManagerLPMData API.

    Without these API calls call, the DM functionality does not work .

    So, we need to call them in the Application.

    Regards,

    Anil.

  • Hi Anil,

    Thank you. I know more now.

    Another question: if just want to develop and debug R5F just for development stage, after SBL_NULL boot up, can it be download from CCS+JTAG?

    Iit is not supported from user guide. but I can't understand, it is just a R5F core and unlocked, why can't overwrite DM by CCS download a .out to run? 

    Is the TIFS keeping communicate with DM? otherwise TIFS reset R5F/SOC? 

  • Hello Tony,

    After SBL_NULL boots the device, the R5F core is already running and executing the Device Manager (DM) task via sciServer_init().

    This task is critical for DM operations  .

    What Happens if You Load a .out File Directly?
    • Loading a .out file via CCS will:
    • Stop the running core
    • Reset the CPU locally
    • Overwrite code and data in RAM, including the active DM task
    • This interrupts the DM’s operation. Since Other cores expects the DM to be running and responsive, it may:
    • Fail communication
    • Cause requests from other cores (like A53) to be unserviced
    • Trigger system-level crashes or hangs

    Safe Debugging Method: Load Symbols Only
    • By using “Load Symbols”, you:
    • Attach to the already-running R5F core
    • Map your application’s debug information into CCS
    • Avoid overwriting memory or disturbing the DM
    • This allows you to:
    • Set breakpoints
    • Inspect variables
    • Debug your application task safely

    Regards,

    Anil.

  • Hello Anil,

    This interrupts the DM’s operation. Since Other cores expects the DM to be running and responsive, it may:
    • Fail communication
    • Cause requests from other cores (like A53) to be unserviced

    That is my question here, since I am not running other core(A53, M4, PRU), just booted with SBL_NULL,

    #1. Which core is running?

    #2. Which core is communicating with DM?

    #3. Why and what are they communicating?

    #4. Which core running what firmware will crash system? 

  • Hello Tony,

     On DM R5F core (AM62x), when we issue a CPU reset via CCS, the TCM address map changes — now TCMB is at 0x00000000.
     If you then load an .out file built to assume vector table at TCMA (0x0), it crashes, because 0x0 is no longer valid for that code path.

    Correct Methods to Solve This

    Method 1: Load to 0x0 (TCM), then set PC to 0x0


    • If you load the .out image from CCS , the first we need to change MMR setting default to TCMA  memory  .

    Next , point the PC to 0x0 and load an .out file .

    Method 2 (Recommended): Place vector table in DDR (like SDL examples do)
    • This avoids TCM mapping issues.
    • Vector table is placed in a fixed location in DDR (e.g., 0x80000000).
    • The R5 vector base address (VBAR) is programmed to point to that DDR location in startup.
    • You can load .out directly from CCS, even after CPU reset.


    Please follow the Method 2 
    This avoids TCM mapping issues after CPU reset, and makes your .out CCS loadable and remove unnecessary SDL .c files in the application and integrate what ever files needed to Test the application .

    Regards,

    Anil.

  • Hello Anil,

    Method 2 (Recommended): Place vector table in DDR (like SDL examples do)
    • This avoids TCM mapping issues.
    • Vector table is placed in a fixed location in DDR (e.g., 0x80000000).
    • The R5 vector base address (VBAR) is programmed to point to that DDR location in startup.
    • You can load .out directly from CCS, even after CPU reset.

    That is my question here,Debug the board according to Method 2,The program cannot start executing from the main function. The code keeps getting stuck at the "lpm_clear_all_wakeup_interrupt()" function.

    1、Which core is running?

    2、Why and how to solve this problem?

  • Hello zegeng Huang,

    Please share the your example. I can check at my side and will share the loadable application from CCS .

    Regards,

    Anil.

  • Hello Anil,

    I used is mcu_plus_sdk_am62x_11_00_00_16\examples\hello_world\am62x-sk\r5fss0-0_freertos.

  • Hello zegeng Huang,

    Instead of loading the Hello world example, please try to load the example below.

    And, please let me know if you face any issues.

    C:\ti\mcu_plus_sdk_am62x_11_00_00_16\examples\sdl\ecc\am62x-sk\r5fss0-0_nortos\ti-arm-clang

    Regards,

    Anil.

  • Hi Anil,

    C:\ti\mcu_plus_sdk_am62x_11_00_00_16\examples\sdl\ecc\am62x-sk\r5fss0-0_nortos\ti-arm-clang can run by reset cpu before download .out.

    but hello world can't run.

      

    compared the map file, the hello world example uses TDMA and TCMB, the ecc example usesTCMA only. 

     In hello world example cmd file, there are many memory allocation as below:

    load = R5F_TCMB, run = R5F_TCMA

    Why load to TCMB, run in TCMA?

    Replace the hello world project link.cmd with that of ecc_app example, rebuild and can run.

  • Hi Anil,

    #1. Why swap ATCM and BTCM, what is purpose and benefit? who will trigger the space swap at which point?

    #2. For a real use case which should work together with DM like the sbl_null, it doesn't use ATCB or BTCM memory at all.

  • Hello Tony,

    I can clear all your doubts by the end of the day.

    Regards,

    Anil.

  • Hi Anil,

    I still want to know why swap ATCM and BTCM?

  • Hi Anil,

    Do you have answer? Or tell me where to request help?

  • Finally it was locked up, but I really want to know the answer, Why swamp TCM A/B, what is the benefit, when to swap it.