This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

NRF51 simple vector deflection function?

I use STM32F4+nRF51822 through the SPI interface. I want to achieve nRF51822 DFU with SPI operation, now upgrade the simple LED to work properly. But can not work when using Gazlle. I know it is because the interrupt vector table is not offset, but I find a lot of there is no simple and feasible way to achieve interrupt vector offset similar to the STM32F0 routines like this example; Or you can give me a simple bootloader and APP procedures for a simple upgrade demo without SD.

  if (((*(__IO uint32_t*)ApplicationAddress) & 0x2FFF0000 ) == 0x20000000)//判断用户程序的起始地址是否为0X8002000保证内容为RAM起始64KB之内。
    { 
      JumpAddress = *(__IO uint32_t*) (ApplicationAddress + 4);           //应用程序的复位地址
      Jump_To_Application = (pFunction) JumpAddress;
      __set_MSP(*(__IO uint32_t*) ApplicationAddress);                          
      
      FLASH_Lock();
      memcpy((void*)0x20000000, (void*)ApplicationAddress, 0x100);      //拷贝应用程序的中断向量表到ROM的起始地址
      SYSCFG->CFGR1 |= 0x03;                                            //设置中断向量表为ROM的起始地址
      Jump_To_Application();                                              //调用reset的中断处理函数
    }

thanks.

Parents Reply Children
No Data
Related