cancel
Showing results for 
Search instead for 
Did you mean: 

Need EXplanation for a single line

arunl4g
Associate II
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 
1 REPLY 1
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
Up vote any posts that you find helpful, it shows what's working..