cancel
Showing results for 
Search instead for 
Did you mean: 

Consuming Kiel library file .Lib into application Keil project

harinath
Associate III
Posted on August 31, 2015 at 13:09

Hello Dears,

I use stm32f103ve. Flash range is 0x08000000 ->0x08080000

I 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.

2 REPLIES 2
Posted on August 31, 2015 at 14:03

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?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
harinath
Associate III
Posted on September 01, 2015 at 10:17

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;  

#endif

The debugger unable to access mcu after the above statement. Seems like the remapping issue ?

Thanks