2018-06-22 11:53 PM
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 #stm32f72018-06-23 01:24 AM
And you are calling this function from a thread, and not from an interrupt context, right?
2018-06-23 03:29 AM
Yaaaa it's not interrupt.....By polling methods we are doing...
2018-06-23 08:50 AM
>>can you please help in this regards
Use a debugger. Step the code and follow where it goes. These tools are provided so you can understand what is happening rather than that it 'doesn't work'.
Make sure you have an application image loaded at 0x08040000, and that the vector table content matches what you've created with the linker. Check the .MAP, check the Reset_Handler entry point, and walk through the transition until it gets to your main() function.
If it doesn't get there, provide some analysis about what does actually occur, how far it gets, and where it stops functioning or gets stuck.
Have proper Hard Fault Handlers in both Loader and App so they can report fault information should you end up there.
2018-06-24 01:29 AM
Thank you for the reply . The vector table is relocated .and the application is placed at the 0x08040000, but the code is not jumping when we initialized the ethernet (when i call this function netif_add(&gnetif, &ipaddr, &netmask, &gw, NULL, ðernetif_init, ðernet_input); in side the MX_LWIP_Init(); function ) .
2018-06-24 08:47 AM
Do you have Error_Handler and HardFault_Handler instrumented, does it end up in those?
2018-06-24 11:38 PM
I am unable to find where the code is is ending.till to this function (
Jump(); // the location to which the application is present.
) this function code is running and after that i am not having the control. But in place of the 0x8000000 if i place a code with out ethernet initialization (LWIP) then it is jumping properly. if i initialize the ethernet (LWIP) then it is the problem . Code size is not the problem . i tried by increasing the code with out ethernet initialization.When i initialize the ethernet then it is giving the problem.Best regards
Maheshwar