This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Code jumps to cxsync1 in vectors.S?

Former Member
Former Member

I have made a project in AD Studio using the startup code from "startup_Cortex-A53x1_AC6" example. I added my own code too, and it was running via simulator Fixed Virtual Platform OK. 

However, after some code changes, I started getting failures: the code would just not go into some function(), it rather jumps to vectors.S at the cxsync1 line and at that point I loose control. 

Here is where it jumps:

//
// Current EL with SPx
//
.balign 0x80
cxsync1: B cxsync1

I also noted that function() where this happens was different yesterday before additional changes in the code. So, it's not about function(). 

When I run the same code (containg function()) on x86 PC in Eclipse, it works with no problems. 

Why is this happening, what am I doing wrong?

  • Hi Danijel

    You are seeing an "exception" occurring in your code.  The exception might be caused by a number of different reasons, including:

    • execution of an invalid instruction (e.g. executing a floating point instruction but the hardware floating point unit is not enabled),
    • a load/store to inaccessible memory (e.g. outside of regions allowed by the MMU, maybe a null pointer access, or stack/heap overflow, or data misalignment)
    • an interrupt, but the interrupt handler has not yet been set up
    • a semihosting operation

    You'll need to debug your code to find out what is causing the exception. 

    As a starting point, enable the trapping of all exceptions, and enable instruction execution "trace":

    1) Disconnect the Debugger from the FVP
    2) Run > Debug Configurations..., select your debug launch config
    3) Click on "DTSL Options..."
    4) In Trace Configuration tab, select Fast Models Trace, OK
    5) In Debug Configurations, click Debug to re-establish the connection.  Don't run your code yet.
    6) Open the Trace view with Window > Show view > Trace
    7) In the Breakpoints view, select "Manage Signals", then click "Select All" for "Stop" and "Print" headings.
    8) Now run your code.  Code execution should stop in the exception handler.  Now look in the Trace view for the last instruction captured.  That's where the exception occurred.

    You'll then need to investigate why the exception occurred there, based on the type of instruction it is, e.g. if it is a load/store instruction, check the address being accessed.

    Hope this helps

    Stephen