2015-08-31 04:09 AM
Hello Dears,
I use stm32f103ve. Flash range is 0x08000000 ->0x08080000I have 3 projects.1. Simple bootloader application which is located (start= 0x08000000, size =0x80000)2. An library project in which the settings are set (start= 0x08002000, size =0x80000)3. An application proj which will consume .lib has settings (start= 0x08002000, size =0x80000) Is this correct ? or the size of memory should be set to 0x7E000 ?And coming to the next point,I Added .lib to application project, links without any errors, flashing also ok. But unable to access the MCU for debugging, just after executing the clocks configuration.( There is nothing wrong with the code except linking, because before making the application project code into library and application projects, it works fine)I feel that the linking of .lib to application project is not being done properly. I'm very new to the .lib & linking in the Keil. Pls help.2015-08-31 05:03 AM
Yes, you should shrink the memory size passed to the linker to match the amount of space each region actually has available.
You need to double check where SystemInit() configures the Vector Table (SCB->VTOR) which needs to be the new base address for each image. Consider also if the code is aware the part isn't in reset conditions when it enters the second time around. ie It's not running off HSI, but probably HSE/PLL with flash wait states.If you've used a debugger to see it fail, what code *specifically* failed? Does it end up in a Hard Fault Handler?2015-09-01 01:17 AM
Thanks clive !
Let me present few more details about the issue.I was asked to embed the most of st peripheral library files also into the library project. (to quickly finish something for the customer). I didn't like anyway, but I had to.Yes, I'm configuring vector-table correctly for bootloader application with 0x08000000, library proj with 0x08002000, and application proj with 0x08002000#ifndef IRQ_HIGH_EFFECT //Do not use an external clock so a PD0 and PD1 of remapping AFIO->MAPR|=0X8000; #endifThe debugger unable to access mcu after the above statement. Seems like the remapping issue ?Thanks