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.

MCU-PLUS-SDK-AM263X: Problem in loading Program into EVM more than once

Part Number: MCU-PLUS-SDK-AM263X

Hi,

  1. I put the EVM board (AM263X Control Card) in NO_BOOT mode
  2. I connect USB Cable 
  3. I compile/load/run one of the examples in SDK
  4. first time Everything is fine
  5. the next time when I compile/load/run, it seems that compile and load are done successfully but the MCU does not run
  6. I will not run until I turn the board off/on to make it run again

I shall highly appreciate if you tell me if I am doing something wrong

Thanks

Saman

  • Hi Saman,

    Thanks for your query. Regarding the issue you are facing, can you please elaborate on the error you get when you load binary second time? Also which application you are loading?

    If the issue you face is core goes into running state without halting at main -  can you please reset the CPU before second time loading?

    Regards,

    Prasad

  • Hi Prasad, 

    There is no error, as I mentioned compile and load are done successfully but the program does not run.

    I use Code Composer Studio Version 11.2

    It seems that the core does not go to running state or it does not start from main. I cannot Reset the CPU since I am not in debug mode

    If you mean that hardware reset the CPU. It might work since I turn off/on the board and it works for the second time

  • Hi Saman,

    I am not able to understand what you meant by program does not run. Do you mean it doesn't correct output?

    As you are using CCS to load and run the program, CPU reset can be done from CCS GUI itself. Refer to below snapshot for CPU reset icon in CCS.

    Note, CPU reset is needed when you do multiple runs as previous run state (registers like stack, interrupt etc.) needs to be cleared before loading new binary.

    Regards,

    Prasad

  • Hi Prasad,

    Yes, exactly I mean it doesn't have correct output. I mean no Serial output, no LED change and so on ...

    The CPU reset you have shown is only available in debug mode. isn't it? When I just only load the project using the button highlighted in the snapshot below there is no CPU reset button available.

    Thanks

  • Hi Saman,

    Got it now! Let me check internally and get back to you.

    Regards,

    Prasad

  • Hi Saman,

    I have tried to reproduce this issue with gpio_led_blink example, but the Code runs everytime I press the Load button.

    Could you try "Terminate and remove" before you load it again.

    Regards

    Sri Vidya

  • Hi Saman

    Please let me know if you need anything from us. But for now closing this thread.

    Regards

    Sri Vidya

  • "Terminate and Remove" does not solve the problem for me

  • Hi Saman,

    I am still not able to reproduce the issue at my end.

    I have few questions to help me reproduce the issue:

    • Are you making another changes in your example code? Could you share me your project so I could reproduce it.
    • Is it happening only for adc_soc_software example?
    • If the powering off/on the Control Card is solving your issue, then is it sufficient for your requirement? If not could you try the debug mode, you have CPU reset option when you choose the Debug Option.

    Regards

    Sri Vidya

  • Also,

    If your code is getting stuck in debug mode also, Could you pause your code and check where it is getting stuck when you load your code the second time?

    Do you have E1 or E2 Control Card?

    Regards

    Sri Vidya

  • Are you making another changes in your example code? Could you share me your project so I could reproduce it.

    • No, Even original example code behaves same.
    Is it happening only for adc_soc_software example?
    • No
    If the powering off/on the Control Card is solving your issue, then is it sufficient for your requirement? If not could you try the debug mode, you have CPU reset option when you choose the Debug Option.
    • Yes powering off/on solves the issue but it is not good to power off/on whenever I make any change in the code and want to check the code to power off/on. Moreover, I am not sure but I guess that in early days that I was working with EVM, this issue was not happening. 
    • By the way this happens even in debug mode. and Reset option does not solve the issue as well
  •  /

    This is debug screen for the first time before starting.

    This is the debug screen after first launch and termination. and debug second launch.

    Do you have E1 or E2 Control Card?

    E2

  • In debug mode,

    The second time you run the code,

    you need to click on CPU reset, then click on the Restart Option (for the code to start from main).

    Then you can click on Resume to run the code.

    Does this work?

  • Yes In debug mode it works.

    How about non-debug mode?

  • We dont have a CPU reset option in load option currently. The Control Card needs to under go a Power On reset/ CPU reset, for the ADC and other modules to reset and load the Am263 properly. 

  • Yes The code can be loaded/run after pressing POR on the CC. but you said that you do not have this problem at your side and you can load the code multiple times without any POR or Turn off/on? 

    I am more happy if I can solve the problem to get rid of POR completely if it is possible.

    Thanks

  • Hi Saman,

    In most cases, we dont have to power cycle the CC board, but in some cases the SOC might be going into hung or exception state. You can try re-setting your EVM setup. Please refer the following document:

    you can refer to "Re-load and run example binaries" and "Prerequisites":

    software-dl.ti.com/.../CCS_LAUNCH_PAGE.html

    SOC Initialization:

    software-dl.ti.com/.../ADDITIONAL_DETAILS_PAGE.html

  • Hi Saman,

    I think the problem is caused by HSM and the system firmware running on it.

    When you load the application program first time, the GEL file resets the HSM and loads and runs the system firmware on it. Then the system resource allocation services are started on HSM. The application code will start using the system resource allocated by the HSM. Everything works fine so far.

    When you load the run the application program 2nd time without POR or power off/on, the application program will be started with expectation that the HSM is started from fresh, so it will ask the HSM and system firmware for the same system resource again while HSM still in the old state. It causes the application program stuck at request for system resource.

    The solution is to either to the power cycle the board, POR or do the "System Reset" in CCS which will trigger the HSM reset and system firmware reloading.

    In conclusion, the right way to do reload application program is through POR/System reset, which triggers either SBL_NULL execution or the CCS GEL script execution to reset and load the HSM properly.

    Best regards,

    Ming

  • Hi Ming and ,

    Thanks for the reply,

    I will check it on Monday and let you know the result.

    BR

    Saman

  • Hi Ming,

    That is right but I need to know why this happens and solve the problem so that I need not to do POR or Off/On.

    Is it for all users or only for me and my CCS or firmware? (Although as I mentioned it happens for all original example firmware as well)

    Maybe there is something wrong with my CCS setting or EVM settings? (EVM is in NO_BOOT mode)

    By the way, I have this report on console for GEL file execution for second time. it seems that it has no error.

    Cortex_R5_0: GEL Output: Loading Gel Files on R5F0
    Cortex_R5_0: GEL Output: Gel files loading on R5F0 Complete
    Cortex_R5_0: GEL Output: ***OnTargetConnect() Launched***

    Cortex_R5_0: GEL Output: AM263x Initialization Scripts Launched.
    Please Wait...


    Cortex_R5_0: GEL Output: AM263x_Cryst_Clock_Loss_Status() Launched
    Cortex_R5_0: GEL Output: Crystal Clock present
    Cortex_R5_0: GEL Output: AM263x_SOP_Mode() Launched
    Cortex_R5_0: GEL Output: SOP MODE = 0x0000000B
    Cortex_R5_0: GEL Output:
    Dev boot mode
    Cortex_R5_0: GEL Output: AM263x_Read_Device_Type() Launched
    Cortex_R5_0: GEL Output: EFuse Device Type Value = 0x000000AA
    Cortex_R5_0: GEL Output: AM263x_Check_supported_mode() Launched
    Cortex_R5_0: GEL Output:
    mode = 1
    Cortex_R5_0: GEL Output: MSS_CTRL Control Registers Unlocked
    Cortex_R5_0: GEL Output: MSS_TOP_RCM Control Registers Unlocked
    Cortex_R5_0: GEL Output: MSS_RCM Control Registers Unlocked
    Cortex_R5_0: GEL Output: MSS_IOMUX Control Registers Unlocked
    Cortex_R5_0: GEL Output: TOP_CTRL Control Registers Unlocked
    Cortex_R5_0: GEL Output:

    *** R5FSS0 Reset DualCore ***
    Cortex_R5_0: GEL Output:

    ***R5FSS1 Reset DualCore ***
    Cortex_R5_0: GEL Output: R5F ROM Eclipse
    Cortex_R5_0: GEL Output: R5FSS0_0 Released
    Cortex_R5_0: GEL Output: R5FSS0_1 Released
    Cortex_R5_0: GEL Output: R5FSS1_0 Released
    Cortex_R5_0: GEL Output: R5FSS1_1 Released
    Cortex_R5_0: GEL Output:

    All R5F Cores Released for program load
    Cortex_R5_0: GEL Output: L2 Mem Init Complete
    Cortex_R5_0: GEL Output: MailBox Mem Init Complete
    Cortex_R5_0: GEL Output: *********** R5FSS0/1 Dual Core mode Configured********
    Cortex_R5_0: GEL Output: CORE PLL Configuration Complete
    Cortex_R5_0: GEL Output: PER PLL Configuration Complete
    Cortex_R5_0: GEL Output: SYS_CLK DIVBY2
    Cortex_R5_0: GEL Output: DPLL_CORE_HSDIV0_CLKOUT0 selected as CLK source for R5FSS & SYS CLKs
    Cortex_R5_0: GEL Output:
    CLK Programmed R5F=400MHz and SYS_CLK=200MHz
    Cortex_R5_0: GEL Output:

    *** Enabling Peripheral Clocks ***
    Cortex_R5_0: GEL Output: Enabling RTI[0:3] Clocks
    Cortex_R5_0: GEL Output: Enabling RTI_WDT[0:3] Clocks
    Cortex_R5_0: GEL Output: Enabling UART[0:5]/LIN[0:5] Clocks
    Cortex_R5_0: GEL Output: Enabling QSPI Clocks
    Cortex_R5_0: GEL Output: Enabling I2C Clocks
    Cortex_R5_0: GEL Output: Enabling TRACE Clocks
    Cortex_R5_0: GEL Output: Enabling MCAN[0:3] Clocks
    Cortex_R5_0: GEL Output: Enabling GPMC Clocks
    Cortex_R5_0: GEL Output: Enabling ELM Clocks
    Cortex_R5_0: GEL Output: Enabling MMCSD Clocks
    Cortex_R5_0: GEL Output: Enabling MCSPI[0:4] Clocks
    Cortex_R5_0: GEL Output: Enabling CONTROLSS Clocks
    Cortex_R5_0: GEL Output: Enabling CPTS Clocks
    Cortex_R5_0: GEL Output: Enabling RGMI[5,50,250] Clocks
    Cortex_R5_0: GEL Output: Enabling XTAL_TEMPSENSE_32K Clocks
    Cortex_R5_0: GEL Output: Enabling XTAL_MMC_32K Clocks
    Cortex_R5_0: GEL Output:

    ***All IP Clocks are Enabled***

  • Hi Saman

    It is advised to POR/CPU Reset.

    Will try to get more information on this.

    Did you try to re-initialize your SOC and check as said in the last reply?

    Regards

    Sri Vidya

  • Hi Saman,

    Let's have live debug session to look into your issue. Let us know your timezone and convenient time (via private message) and we can share the invite accordingly.

    Regards,

    Prasad

  • Hi Sri Vidya,

    Yes I did

  • Hi Prasad,

    My time zone is GMT+1, and I am able to have session today,

    Please let me know your preferred time and I will set a meeting on Teams.

    Regards,

    Saman

  • Hi Saman,

    We have sent you the meeting request to your mail with details. Hope you were able to receive our mail.

    Regards

    Sri Vidya

  • As Discussed in the call, The below are the steps to reproduce the issue:

    1. Import any SDK example (say ADC - examples\drivers\adc\adc_soc_software\am263x-cc)

    2. Build, and Load using the load button. 

    3. Make any simple change in the code (say change while(loopcnt--) to while(1))

    4. Build the code, and Flash the code using the same load button.

    5. The code does not run the second time.

    We will work with the internal CCS teams to find the root cause and resolve the issue.

    As discussed in the call, the workaround for this is:

    1. After modifying your code, build it. Go to View - Target Configurations.

    2. Configure your device: refer: https://software-dl.ti.com/mcu-plus-sdk/esd/AM263X/latest/exports/docs/api_guide_am263x/CCS_SETUP_PAGE.html#CCS_NEW_TARGET_CONFIG

    Section (Create Target Configuration)

    3. If the device is already configured, right-click on the .ccxml file and choose "Launch selected configuration". 

    4. Now connect to the required core, load your .out file and Resume the program. For clear steps refer: https://software-dl.ti.com/mcu-plus-sdk/esd/AM263X/latest/exports/docs/api_guide_am263x/CCS_LAUNCH_PAGE.html#CCS_LOAD_RUN

    CPU Reset Option is also accessible from this Window. You can Perform CPU Reset before you load your program.

    Regards

    Sri Vidya

  • Hi Saman

    Status on the issue:

    We have reached out to the internal CCS teams about the issue.

    Regards

    Sri Vidya

  • Hi Saman

    In your AM263 gel file add the CPU reset command to enable CPU reset everytime the gel files are loaded.

    location: C:\ti\ccs1120\ccs\ccs_base\emulation\gel\AM263x\AM263x.gel

    You can add these two lines after GEL_TextOut("***OnTargetConnect() Launched***\n\n"); in OnTargetConnect()

    GEL_Reset();
    GEL_TextOut("CPU reset (soft reset) has been issued through GEL.\n");

    Try this and Please let us know if this works or causes any issue.

    Regards

    Sri Vidya

  • Hi Sri Vidya,

    This resolved my issue, thank you so much

  • Hi Saman

    Thank you for helping to reproduce the issue. This reset feature will be added in the future releases. A jira ticket is raised to take action and track the issue. Tracking ID is  SITARAAPPS-2532 for your reference.

    Regards

    Sri Vidya