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

Strange PC value at reset/startup

Hello Everyone,

I am just starting with a new board, a landboard with a nxp LPC1768.

I do not understand why i go in debug mode the starting point of my PC is 0x1fff0080

I use the startup given in keil 4 lite. This address is not random. In fact when I'm also trying with different example,

written in c, the starting point is the main of the c file, but if i hit the reset button, again the starting point is that address.

this is the disassembly but i cannot find nothing on the startup that redirect to that address.

0x1FFF007A 0000      MOVS     r0,r0
0x1FFF007C 0000      MOVS     r0,r0
0x1FFF007E 0000      MOVS     r0,r0
0x1FFF0080 F8DF4018  LDR.W    r4,[pc,#24]  ; @0x1FFF009C
0x1FFF0084 F8DF5010  LDR.W    r5,[pc,#16]  ; @0x1FFF0098
0x1FFF0088 6826      LDR      r6,[r4,#0x00]
0x1FFF008A EA050606  AND      r6,r5,r6
0x1FFF008E 6026      STR      r6,[r4,#0x00]
0x1FFF0090 F8DFF000  LDR.W    pc,[pc,#0]  ; @0x1FFF0094
0x1FFF0094 0201      LSLS     r1,r0,#8
0x1FFF0096 1FFF      SUBS     r7,r7,#7
0x1FFF0098 BFFF      ITTTT    
0x1FFF009A FFFFC3C0  DCD      0xC3C0FFFF
0x1FFF009E 400F      ANDS     r7,r7,r1
0x1FFF00A0 0000      MOVS     r0,r0
0x1FFF00A2 0000      MOVS     r0,r0

When i debug in simulation mode instead, the starting point is the reset Handles...

                PRESERVE8
                THUMB


; Vector Table Mapped to Address 0 at Reset

                AREA    RESET, DATA, READONLY
                EXPORT  __Vectors

__Vectors       DCD     __initial_sp              ; Top of Stack
                DCD     Reset_Handler             ; Reset Handler
                
                .....
                


                IF      :LNOT::DEF:NO_CRP
                AREA    |.ARM.__at_0x02FC|, CODE, READONLY
CRP_Key         DCD     0xFFFFFFFF
                ENDIF


                AREA    |.text|, CODE, READONLY


; Reset Handler

Reset_Handler   PROC
              
              
                my code
              
                ENDP

                
                

Can you please help me to understand what i'm wrong?

Thank you

  • Sorry you did not see a response on this. The Reset_Handler is indeed where execution begins, and can be thought of as the low-level entry point. This will ultimately call __main, the C library init code, which eventually calls main(), the standard start of the code from a C perspective.

    The debugger allows you to skip through this code (you may not wish to consider what is happening therein), with the 'run to main()' check box in the debugger configuration.

  • Check what boot options your device has, via external strapping or whatever, 0x1FFFxxxx is suggestive of the device's ROM as opposed to user FLASH at 0x08000000

    Check what memory is mapped/shadowed at zero, and if that looks like the vector table for your code or not.