AnsweredAssumed Answered

STM32F2xx IAP question

Question asked by strauss.bar on Apr 5, 2013
Latest reply on Apr 6, 2013 by Clive One
I have base my IAP on AN2557 application.
I change the offset for my APP to 0x08010000 because need same extra sectors for fix varibles.

I change the icf file according :
define symbol __ICFEDIT_intvec_start__ = 0x08010000;// start main APP on sector 4

define symbol __ICFEDIT_region_ROM_start__ = 0x08010000; // start main APP on sector 4
define symbol __ICFEDIT_region_ROM_end__   = 0x080FFFFF;

and in the main put this:
 NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0x10000); 

In the Boot App I set this code for jumping (copy from AN2557)

         /* Test if user code is programmed starting from address "ApplicationAddress" */
         if (((*(__IO uint32_t*)ApplicationAddress) & 0x2FFE0000 ) == 0x20000000)
          {
            SysTick_IRQControl(DISABLE); // Stop SysTick IRQ befor jump to the new application
            /* Jump to user application */
            JumpAddress = *(__IO uint32_t*) (ApplicationAddress + 4);
            Jump_To_Application = (pFunction) JumpAddress;
            /* Initialize user application's Stack Pointer */
           __set_MSP(*(__IO uint32_t*) ApplicationAddress);
           Jump_To_Application();
          }         
But when I made a bin code for the APP I get this hex on the first lines:
01 02 00 00 which not lead to get 0x2000---- on  if (((*(__IO uint32_t*)ApplicationAddress) & 0x2FFE0000 ) == 0x20000000)

When I look on the AN2557 APP code (SYSTICK) I found it start with 28 04 00 20 which I think get the 0x2000---- (Little indian format).
1. Am I right?
2. What is the porpuse of  this if:
if (((*(__IO uint32_t*)ApplicationAddress) & 0x2FFE0000 ) == 0x20000000)

3. What could be the reason I don't get the right address?
Regards
Bar.

Outcomes