Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7701103
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:54:16+00:00 2026-05-31T22:54:16+00:00

I am debugging a piece of software on an ARM chip via GDB. After

  • 0

I am debugging a piece of software on an ARM chip via GDB. After loading the program (and before running it), when I do info registers I get:

(gdb) info registers
r0             0x0      0
r1             0x0      0
r2             0x0      0
r3             0x0      0
r4             0x0      0
r5             0x0      0
r6             0x0      0
r7             0x0      0
r8             0x0      0
r9             0x0      0
r10            0x0      0
r11            0x0      0
r12            0x0      0
sp             0x4770   0x4770
lr             0xffffffff       4294967295
pc             0x8005dc5        0x8005dc5 <Reset_Handler+1>
fps            0x0      0
cpsr           0x20     32

The one register I find worrisome is lr set to 0xffffffff. I am thinking this may be the reason for my crash.

Is it normal to have lr initiated to 0xffffffff?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T22:54:18+00:00Added an answer on May 31, 2026 at 10:54 pm

    This looks like a situation where you have the debugger stopping execution very shortly after reset (I’m basing this on your description and the symbol name associated with the PC value). If so, don’t worry about the inital state of lr – just don’t use it until you’ve initialized it (which probably wouln’t make much sense anyway until it was explicitly set by your assembly code or by the C compiler to handle a function call).

    Since another person guessed that you were using a Cortex-M3 processor, here’s some of what the Technical Reference Manual says about the processor’s behavior at reset:

    5.9 Resets

    The NVIC is reset at the same time as the core and controls the
    release of reset into the core. As a result, the behavior of reset is
    predictable. Table 5-7 shows the reset behavior. For more information
    about resets, see Chapter 6 Clocking and Resets.

    Table 5-7 Reset actions

    Action                                Description
    =================================   ====================================================
    
    NVIC resets, holds core in reset    NVIC clears most of its registers. The processor is 
                                        in Thread mode, priority is privileged, and the stack 
                                        is set to Main.
    
    NVIC releases core from reset       NVIC releases core from reset.
    
    Core sets stack                     Core reads the start SP, SP_main, from vector-table offset 0.
    
    Core sets PC and LR                 Core reads the start PC from vector-table offset. 
                                        LR is set to 0xFFFFFFFF.
    
    Reset routine runs                  NVIC has interrupts disabled, and NMI and Hard Fault 
                                        are not disabled.
    

    So if you’re running an M3, that’s why lr is set to 0xffffffff.

    I don’t see any mention of how the other general purpose registers are initialized at reset – I wouldn’t count on them being zero. Initialize them yourself.

    If you’re not running an M3, the “What values are in ARM registers after a power-on reset?” note may apply to your device. It says:

    Registers R0 – R14 (including banked registers) and SPSR (in all modes) are undefined after reset.

    (r14 is lr).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am debugging this piece of software for an STM32 embedded system. In one
I'm debugging a piece of (embedded) software. I've set a breakpoint on a function,
I have a piece of running java software that is jammed. I would like
I have problem running and debugging this piece of code: bool readSectionHeaders(char* path, int
I'm trying to get a piece of our JavaScript run after some 3rd party
Debugging the following piece of code I get Source not found notification which probably
I get a EXC_BAD_ACCESS right after calling this piece of code in my app
Debugging a PHP program, is there any add-on/plug-in for browser which I can view
I'm developing a piece of software, which reads data sent through the COM port
I've got a piece of web software which has a private component (a computational

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.