Skip to main content
arunl4g
Associate III
July 29, 2015
Question

Need EXplanation for a single line

  • July 29, 2015
  • 1 reply
  • 486 views
Posted on July 29, 2015 at 15:07

i have done bootloader and its jumps.

 

but i like to know what the below line exactly does, Can anyone explain exactly why we give  0x2FFE0000 and do ''and '' mask and how it works?

 

 

if (((*(__IO uint32_t*)APPLICATION_ADDRESS) & 0x2FFE0000 ) == 0x20000000)

 

 

thank you 
    This topic has been closed for replies.

    1 reply

    Tesla DeLorean
    Guru
    July 29, 2015
    Posted on July 29, 2015 at 16:35

    It's attempting to confirm if the initial stack pointer holds some valid value pointing to SRAM and not some random junk.

    It's a rough test approximating the SP in the 0x20000000..0x2001FFFF (128KB) range.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..