2015-07-17 03:08 AM
Hi,
I started for IAP with stm32 using iDE KEIL which works fine.But now when i switch to iDE IAR using STM32F101VCT6 the IAP not working,for switching from one code to another code written in the flash memory space.Following is the part of my code whichc i used for switching from one code space to another as follows:&sharpdefine ApplicationAddress 0x08020000typedef void(*pFunction)(void);pFunction Jump_To_Application;uint32_t uliJumpAddress;void jump_to_app(void);...../* Set system control register SCR->VTOR */NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0x00020000); uliJumpAddress = *( uint32_t*) (ApplicationAddress + 0x04);Jump_To_Application = (pFunction) uliJumpAddress;__set_MSP(*( uint32_t*) ApplicationAddress);Jump_To_Application(); #stm32 #usb #- #iap #iar-workbenc #stm32l1xx2015-07-17 04:46 AM
I don't understand what ''not working'' means. What exactly is happening, use a debugger and step in and understand what's happening, and why, and what you think should be going on.
I would let SCB->VTOR be set in SystemInit() in the application code.Don't hand over control with random Interrupts firing/functional. The app isn't going to be ready to deal with any of that. Watch for things like SysTick. And if using an RTOS understand system/user context.2015-07-20 03:02 AM
2015-07-20 07:02 AM
do any one have any clues about it????
Interrupts?2015-07-20 07:17 AM
2015-07-20 08:34 AM
I'm not an IAR user/expert
You'll have to refine ''random'' a bit, perhaps you can illustrate in dissembly form (address/instruction/registers) exactly what gets stepped through, and when it vectors to the unknown/random instructions.You've provided a dozen lines of C code, I can't solve this problem with that.Are you disabling interrupts globally, or are you tearing down and turning off all the individual sources you created in the boot loader? Things like SysTick, Watchdogs, and other timer or usb interrupts? Again my perspective on your problem is very narrow.2015-07-24 02:50 AM
Hi,
After debugging for 2 days we found the solution for this.For IAP in IAR whatever the second code at which you want to jump from your main code have to follow following things:1. for second code change the following line in generic_cortex.icf for IARdefine symbol __ICFEDIT_intvec_start__ = 0x00000000;
/*starting location of main code*/ todefine symbol __ICFEDIT_intvec_start__ = 0x000
20000;/*starting location of
your second code*/
2.also go to options->Linker->Config in Linker configuration file box select override default and you can make new .icf file to store your new code address.note: save this file with new name and use it only for second codeHope this will help someone.....