We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi To All,
Currently I observe very strange situation when I have started to use remapping of exception vectors to RAM after application gets started from internal flash – the load/programmed area (used CPUs :STR710 and STR11):
Application starts running just fine, but …. When the following functions are called
GPIO_BitWrite(GPIO1, 9, 1); // setting the bit 9 of IOPORT1
GPIO_BitWrite(GPIO1, 9, 0); // resetting the same: bit 9 of IOPORT1
… Application stacks and I see exception vector area in RAM - changed
Remark :( Prior calling these both functions the pin is set to output with: GPIO_Config(GPIO1, 0x0200, GPIO_OUT_PP);)
Some more info and details I was able to find so far: 1).The situation does happen if there is a delay between the two calls (called functions without delay one after another does not cause a problem); 2) Both of them have to be called the problem to happen; 3) Not using library functions, but direct access to register instead via pointer, like that: (U16 *) pGPIO1 = (U16 *)(0xE0000000+ 0x4000+ 0x0c); ... Does not help – same result 4) I have tried two tool chains – RV MDK's and Keil's – same result; 5) I have tried two different ways of expectation vectors remapping: - The way described in ST forum with RV MDK's tools;
- Using manual way with Keil's tools, with code like this at the beginning of main():
// remap U32 index; U8* dst = (U8*)0x20000000; // beginning of RAM, 64 bytes reserved via linker setting U8* src = (U8*)0x40000000; // beginning of internal FLASH first 64 bytes are reset vectors U32* pboot = (U32*)0xA0000050; // booting register address
for(index = 0; index < 64; index++) dst[index] = src[index]; // copy vectors to RAM
index = *pboot; index = index & 0xFFFFFFFC; index = index | 0x2; *pboot = index; // set 0x00000000 to RAM
// remap
… and result is the same
Someone has the same situation? Thanks a lot in advance for any help!!
Nivelinn