Jumping from boot code to the application code
Hai, we want to jump from one code located at 0x8000000 to another code located at 0x8040000 . that jump condition is depending on the GPIO line .To jump we used the following code .
void APP_JumpToApplication(void)
{ pFunction Jump = (pFunction)(*(uint32_t*)(ADDR_FLASH_SECTOR_5+4)); HAL_RCC_DeInit(); HAL_DeInit(); NVIC->ICER[ 0 ] = 0xFFFFFFFF ; // clearing all the pending interrupt request NVIC->ICER[ 1 ] = 0xFFFFFFFF ; NVIC->ICER[ 2 ] = 0xFFFFFFFF ; NVIC->ICER[ 3 ] = 0xFFFFFFFF ; NVIC->ICER[ 4 ] = 0xFFFFFFFF ; NVIC->ICER[ 5 ] = 0xFFFFFFFF ; NVIC->ICER[ 6 ] = 0xFFFFFFFF ; NVIC->ICER[ 7 ] = 0xFFFFFFFF ; NVIC->ICPR[ 0 ] = 0xFFFFFFFF ; NVIC->ICPR[ 1 ] = 0xFFFFFFFF ; NVIC->ICPR[ 2 ] = 0xFFFFFFFF ; NVIC->ICPR[ 3 ] = 0xFFFFFFFF ; NVIC->ICPR[ 4 ] = 0xFFFFFFFF ; NVIC->ICPR[ 5 ] = 0xFFFFFFFF ; NVIC->ICPR[ 6 ] = 0xFFFFFFFF ; NVIC->ICPR[ 7 ] = 0xFFFFFFFF ; SysTick->CTRL = 0; // disable the system ticks SysTick->LOAD = 0; SysTick->VAL = 0; SCB->ICSR |= SCB_ICSR_PENDSTCLR_Msk ; // if( CONTROL_SPSEL_Msk & __get_CONTROL( ) ) { /* MSP is not active */ __set_CONTROL( __get_CONTROL( ) & ~CONTROL_SPSEL_Msk ) ; } SCB->SHCSR &= ~( SCB_SHCSR_USGFAULTENA_Msk | SCB_SHCSR_BUSFAULTENA_Msk | SCB_SHCSR_MEMFAULTENA_Msk ) ; &sharpif (SET_VECTOR_TABLE) SCB->VTOR = ADDR_FLASH_SECTOR_5; // setting the vector ta ble address&sharpendif __set_MSP(*(__IO uint32_t*)ADDR_FLASH_SECTOR_5); Jump(); // the loction to which the application is present.}it jumps fine when the code is located at 0x8000000 is only a small gpio initialization(code size is 4kbytes) when in the same if we initialized ethernet Jump will not takes place(code size is 40kbytes) . can you please help in this regards .
best regards
maheshwar
#jump #boot #stm32f7