2016-07-27 03:02 AM
I can't debug anymore, I get this message after copying the interrupt table to RAM, even if I comment the Remap() funtion I get this error. Even if I load and try to debug another project I get this error. I seems Once I Execute this once I get this faulty operating device. Wed Jul 27, 2016 12:01:19: Warning: __vector_table symbol not found. e_entry value: 0x0800514C does not match reset vector value: 0x0800513C Initial SP_main value:0x20000E08 uncertain. Wed Jul 27, 2016 12:01:19: Target reset Wed Jul 27, 2016 12:01:20: One or more breakpoints could not be set and have been disabled.
2016-07-27 04:39 AM
Ok, not much to work with here.
What STM32 part? What tools chain? When do you copy the vector table? Where exactly does it get copied? Can you show the code? What reset options have you selected for the debugger? Can the debugger control NRST?2016-07-27 09:24 AM
Hi sry for the lack of information, the micro is STM32F051, I am using
IAR C/C++ Compiler for ARM 7.30.4.8167 (7.30.4.8167). I did a chip erase using the STLink tool, I commented the Remap function. Still I cant Debug same message apears. I mean that I can debug in assembler, but that is not what I am looking for. Maybe it has to do with Flash protection since I am working on a Bootloader. The thing is that I Bricked (can't debug placing brackpoint on code ) 2 boards. First one was working bricked it, did the same to another then briked it also don't want to test another. #define FIRMWARE_START_ADDR ( (uint32_t ) 0x08000000 ) void Remap_Table(void) { // Copy interrupt vector table to the RAM. volatile uint32_t *VectorTable = (volatile uint32_t *)0x20000000; uint32_t ui32_VectorIndex = 0; for(ui32_VectorIndex = 0; ui32_VectorIndex < 48; ui32_VectorIndex++) { VectorTable[ui32_VectorIndex] = *(__IO uint32_t*)((uint32_t)FIRMWARE_START_ADDR + (ui32_VectorIndex << 2)); } I would'nt be worried about this if I could jump from Project1 to Project2. I noticed that some part of the Project1 ( starting at 0x800000 )is overwritten when I load a project Project2 with another mapping that its Rom don't overlap The boards work, I can load projects the only things I can't do is debug, and yes also the jump from App1 to App2 is not working. I am not sure is fault of the remap function. I chose to override the memory mappings stm32f051x6.icf on the linker. If I have a projects its code starts at 0x8000000 ends at 0x80017ff and another project that 0x801800 to 0x80087ff the .intvectstart should be 0x08000000 same in the 2 projects?2016-07-28 01:37 AM
well it actualy jumps, if I Do a delay using for and blink some leds I see that I am at App1, but interrupts are not working.
The remap function I call first thing I get on main() is : __no_init __IO uint32_t myVectorTable[48]; #define APPLICATION_ADDRESS 0x08001800 static void Main_RelocateVectorTable(void) { int i; for(i = 0; i < 48; i++) { myVectorTable[i] = *(__IO uint32_t*)(APPLICATION_ADDRESS + (i << 2)); } /* Enable the SYSCFG peripheral clock*/ //RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE); RCC_APB2PeriphResetCmd(RCC_APB2Periph_SYSCFG, ENABLE); SYSCFG_MemoryRemapConfig(SYSCFG_MemoryRemap_SRAM); } the mapping is /*###ICF### Section handled by ICF editor, don't touch! ****/ /*-Editor annotation file-*/ /* IcfEditorFile=''$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml'' */ /*-Specials-*/ define symbol __ICFEDIT_intvec_start__ = 0x08001800; /*-Memory Regions-*/ define symbol __ICFEDIT_region_ROM_start__ = 0x08001800; define symbol __ICFEDIT_region_ROM_end__ = 0x080087FF; define symbol __ICFEDIT_region_RAM_start__ = 0x200000c0; define symbol __ICFEDIT_region_RAM_end__ = 0x20001FFF; /*-Sizes-*/ define symbol __ICFEDIT_size_cstack__ = 0x800; define symbol __ICFEDIT_size_heap__ = 0x800; /**** End of ICF editor section. ###ICF###*/ define memory mem with size = 4G; define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; initialize by copy { readwrite }; do not initialize { section .noinit }; place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; place in ROM_region { readonly }; place in RAM_region { readwrite, block CSTACK, block HEAP }; export symbol __ICFEDIT_region_RAM_start__; export symbol __ICFEDIT_region_RAM_end__;2016-07-28 06:25 AM
You MUST enable the clock, not reset the peripheral, ST's examples are broken
/* Enable the SYSCFG peripheral clock*/ RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE); /* Remap SRAM at 0x00000000 */ SYSCFG_MemoryRemapConfig(SYSCFG_MemoryRemap_SRAM);2016-07-28 11:02 AM
ok, forgive me by being so dull, I have doubts about reserving the ram space should of Ap 0x8001800
define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; to define symbol __ICFEDIT_region_RAM_start__ = 0x200000c0; ? I set it to this value didnt work. the vector table of App1 ? define symbol __ICFEDIT_intvec_start__ = 0x08001800; I noticed that if i try to init the system tick like this I get stuck if(SysTick_Config(SystemCoreClock * 1 / 9600)) { // Capture error while(1); } maybe earlier tests worked because I placed the intvect table of app1(0x8001800) on 0x800000 and i didnt use interrupt on the bootapp(0x800 0000) ? maybe I am doing right the remapvector table but I am missing some other initialization reconfiguration to make interrrupts work. the same code when i compile and run it (without remaptable and mapping) works fine with interrupts Thanks you for your patience2016-07-29 09:44 AM
Probably because the linker can't give myVectorTable the 0x20000000 address it needs.
My preference is to advance/shrink the RAM visible to the linker, and then explicitly specify the 0x20000000 address as the destination.