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-AM263PX: AM263Px - Debugging XIP applications

Part Number: MCU-PLUS-SDK-AM263PX
Other Parts Discussed in Thread: UNIFLASH

Tool/software:

Hi,

I am able to run the application from OSPI flash (AM263Px - control card) and found few limitations while debugging the XIP application.

 Can you please suggest a workaround for the below ?

  1. Is there a way to perform step in, step over and step out operation while executing the application from OSPI flash ?  If I perform any of this operation the program crashes and the only way to recover the board is re-flashing the software.
  2. Is there a way to perform CPU reset or SYSTEM reset while debugging XIP applications ? If I perform any of this operation the program enters exception (assume that OSPI isn’t initialized after cpu reset or system reset) and the only way to recover the board is re-flashing the software.
  3. How to default hardware breakpoints in CCS as the software breakpoint doesnt work for XIP applications.

                                                                                                                                                                                                                                   

I understand that if I execute a specific function or the whole application in RAM, all the debug operations can be performed. But I am more interested in a situation where the application size is too big and we don’t have enough resource in RAM, in that case I can’t execute the whole application / a specific function in RAM for debugging.

 A general question - I would link to understand if there is any limitation on executing production software in OSPI flash ?

Best Regards,
Mahendran L

  • Hi Mahendran,

    Apologies!! This expert was out of office due to the holiday. Please expect a response before EOD

    Thanks & Regards,
    Rijohn

  • Hi Mahendran,

    Please see the below e2e to setup XIP debugging in CCS. Once the steps are followed XIP debugging should be working.

     [FAQ] AM263P4: How to debug XiP application in AM263PX 

    1. 

    Is there a way to perform step in, step over and step out operation while executing the application from OSPI flash ?  If I perform any of this operation the program crashes and the only way to recover the board is re-flashing the software.

    Once the target cofiguration is aligned with that in the FAQ, this would be possible

    2.

    Is there a way to perform CPU reset or SYSTEM reset while debugging XIP applications ? If I perform any of this operation the program enters exception (assume that OSPI isn’t initialized after cpu reset or system reset) and the only way to recover the board is re-flashing the software.

    How are you performing this reset. Is this via code. Is Flash being reset during this time ?

    Can you explain how this is being done?

    For the application to load again via the SBL, should not OSPI and Flash be initialized again ?

    3. 

    How to default hardware breakpoints in CCS as the software breakpoint doesnt work for XIP applications.

    Let me check if this functionality is there in CCS, I am not sure if this feature is there. You can assign hardware breakpoints by right clicking and selecting them.

    I would link to understand if there is any limitation on executing production software in OSPI flash ?

    Can you elaborate on the kind of limitations that you are thinking about ? If it is about performance, then with XIP and OpTIFlash, the performance will be almost same as that of executing from RAM.

    Regards,

    Aswin

  • Hi Aswin,

    Thanks for your response.

    I disabled allow software breakpoints in my project properties instead of the target configuration properties, after updating the target configuration properties I am able to perform step in and step out operations. This also resolves the breakpoint issue now i can double click on any line to insert a hardware breakpoint.


    However I am still facing issue with CCS reset and restart. Can you please let me know if i can use CCS reset/restart ?



    Can you elaborate on the kind of limitations that you are thinking about ? If it is about performance, then with XIP and OpTIFlash, the performance will be almost same as that of executing from RAM. - Yes my concern is mostly about the performance of XIP applications. I will have a look at the performance matrix in the datasheet later. Thanks.

    Regards,
    Mahendran L

  • Hi Mahendran,

    However I am still facing issue with CCS reset and restart. Can you please let me know if i can use CCS reset/restart ?

    To restart, can you disconnect the debugger using the disconnect target option in CCS.

    Once disconnected click on system reset. You should be able to restart the code in this manner. On system reset, the SBL will start (can be verfied by the SBL logs in UART) and the control will be stuck at loop forever at the start of application execution.

    Regards,

    Aswin

  • Hi Mahendran,

     Yes my concern is mostly about the performance of XIP applications. I will have a look at the performance matrix in the datasheet later

    Please do checkout the benchmarks section in MCU PLUS SDK

    https://software-dl.ti.com/mcu-plus-sdk/esd/AM263PX/10_02_00_15/exports/docs/api_guide_am263px/EXAMPLES_BENCHMARKS.html

    This section has some examples that can be used to grade XIP performance.

    Regards,
    Aswin

  • Hi Aswin,

    Tried the steps you suggested and the application didn't boot as expected(please check the below image). Just to let you know that I don't have infinite loop before the main but that is just required to force the program to stay there until the debugger is connected.



    Is Power on reset the only option ?

  • Hi Mahendran,

    I suppose you are debugging in dev boot mode. I thought the question was regarding XIP debugging. If it is regarding general debugging then let me check.

    Regards,

    Aswin

  • Hi Aswin,

    I am debugging XIP in OSPI boot mode. Apologies I didn't explain my environment properly.

    I am using prebuilt OSPI SBL. I flash sbl + application image + application xip in dev mode using UNIFLASH and then switch to OSPI mode + POR before launching the target.

    Regards,
    Mahendran L

  • Hi Mahendran,

    Thank you for the information. 

    Asking out of curiosity, If the infinite while loop is not there in the application, then how is the target connection being done? 

    If the inifinite loop is not there, then the application will start executing on switching to OSPI boot mode and resetting it. Connecting the target while the app is executing might not result in a deterministic start position for debug.

    I am using an AM263P LP, are you using a custom board or TI EVM? In my case, on system reset, the entire application started executing from SBL because flash also got reset. it is important to reset flash so that, it will be in a known state for ROM to read the SBL and start execution.

    Regards,

    Aswin

  • Hi Aswin,


    My example application has  a different while loop after the main and whenever i connect the debugger the program is always at that while loop.
    I am using TI EVM (AM263Px control card) but how to reset the flash ?




    The above image is from EVM User's Guide, the PORz push button is connected to the RESET pin of Flash.  I assume that it is not possible to do CCS system reset as the flash can only be reset via POR.

    But why do we have to disconnect the target and then connect the target after doing CCS system reset ?

  • Hi Mahendran

    Apologies for the delayed reply

    CCS provides a warm reset as per my understanding. Depending upon board design this warm reset can provide a flash reset. In this case it is clear that we need to use PORz button instead of warm reset.

    Can you disconnect the target, provide PORz and then reconnect again?

    If PORz is done while target is connected, then it can corrupt the connection to the device and SoC. You would be able to see some 'Unable to connect' messages in the console. That is why I mentioned to disconnect the target

    Regards,

    Aswin

  • Hi Aswin,

    Thanks for you response. 
    Yes, in the current hardware setup PORz is the only way to reset the flash and after POR I can reconnect to the target without any issue.

    If the reset of flash is connected to the warm reset of the AM263Px then CCS reset will reset both the micro and OSPI flash.

    Regards,
    Mahendran L

  • Hi Mahendran,

    Yes your observation is correct. It depends on the hardware design. The CCS system reset issues a SoC level warm reset, and in LP design the warm reset is conected to flash. In CC, this is not the case.

    Regards,

    Aswin

  • Thanks for the clarification Aswin.