cancel
Showing results for 
Search instead for 
Did you mean: 

OTA Reset Manager is not jumping to user application

TGats.2
Associate II

Hi

I'm trying to enable OTA Service on my device with the BlueNRG2 Chip.

I use the Lower Application Scheme. Therefore I flash the BLE_OTA_ResetManager at the flash beginn at 0x10040000. (I did a mass erase before that). I didn't modify the OTA ResetManager application, I took it from the BlueNrg-1.2 DK 3.2.1 example project.

Then I flash the user application with enabled OTA service at 0x10040800 as described in the documentation. I tried it also with the given example projects BLE_Chat or BLE_Beacon, but the Reset manager is never jumping to the application.

I can see that the reset manager reads correctly the AA5555AA tag at the correct location and get therefore the correct application to jump. But after the Jump_to_Application() call, it seems that it falls into a hard fault and makes then reset. And this will then happen in an endloos loop.

Do I missunderstand something or what is wrong with my code/approach?

Many thanks for every hint!

Code of the main function of the OTA_Reset_manager:

int main(void) 
{
  pFunction Jump_To_Application;
  uint32_t JumpAddress, appAddress;
  
  /* Identifies the valid application where to jump based on the OTA application validity tags values placed on
  reserved vector table entry: OTA_TAG_VECTOR_TABLE_ENTRY_INDEX */
  appAddress = OTA_Check_Application_Tags_Value();
  
  if (appAddress == 0) {
    /* This case indicates that no valida application is present and normally should not happen */
    while (1);
  }
  
  /* Jump to user application */
  JumpAddress = *(__IO uint32_t*) (appAddress + 4);
  Jump_To_Application = (pFunction) JumpAddress;
  /* Initialize user application's Stack Pointer */
  __set_MSP(*(__IO uint32_t*) appAddress);
  Jump_To_Application();
  
  /* Infinite loop */
  while (1)
  {
  }
}

Many thanks.

Tobias

1 REPLY 1
TGats.2
Associate II

My mapper file had an issue, it linked the application to the same address as the reset manager was.

Issue can be closed.

Many thanks for your attention.