cancel
Showing results for 
Search instead for 
Did you mean: 

Debug a library(.lib) using ST Visual Develop

David  Beltran Lacasa
Associate II
Posted on June 21, 2018 at 12:17

We are trying to migrate a .lib library which we use with STM32F1 microcontrollers to an STM8S microcontroller.

We would like to use a similar toolchain for the STM8S:

ToolChain for the STM32F1:

Eclipse base IDE + Keil to code, compile and link

uVision to debug.

ToolChain for the STM32F1:

Eclipse base IDE + Cosmic to code compile and link

ST Visual Develop to debug.

To validate the viability of this toolchain I'm trying to debug a .lib library compiled with cosmic and a main.c which calls some functions from the lib in a STM8S Discovery Board. I've created the workspace wrapping an executable and I configured it so I can debug the main.c file step by step.

1.- Is there a way import the files used to compile the .lib and debug them step by step? We do this with the STM32F1 toolchain and we will like to do the same with STM8S

2.- If so, how is this done?

Regards,

David Beltran

#st-visual-develop #static-library #debug
4 REPLIES 4
henry.dick
Senior II
Posted on June 21, 2018 at 14:38

'

1.- Is there a way import the files used to compile the .lib and debug them step by step?'

if you have the library source files, you can put them in your project and compile/debug as usual - in that case, you aren't really using the .lib file. I have done that with stvd + cosmic and IAR.

Posted on June 22, 2018 at 09:06

Well, as the .lib will be used in multiple projects we would like to avoid multiple toolchain

maintenance

as much as possible.

Some solution like this one :

http://www.keil.com/support/docs/2820.htm

 but for cosmic and Visual Develop

Posted on June 22, 2018 at 12:54

'

as the .lib will be used in multiple projects we would like to avoid multiple toolchain maintenance as much as possible.'

are you really talking about 'multiple toolchains' or 'multiple projects'? if multiple toolchains are involved, i'm not sure if you can debug one library produced by a different toolchain.

for multiple projects, all that's involved is to place the library sources into the projects and debug you go - the keil instruction is just one way of implementing binary-level debug - it wouldn't work if the library was produced by a different toolchain, or different compiler settings under the same toolchain.

if you really meant what your words said, there is no solution.

David  Beltran Lacasa
Associate II
Posted on June 25, 2018 at 09:16

Well, I was including the IDE as part of the toolchain. You said in the first response that I can put the files in the Visual Develop project and Compile/Debug but in that case i would not be using the .lib file. If I have to compile my source code in different projects It means, in my humble opinion, that I have to maintain two toolchains or at least keep them mirrored which is the think I would like to avoid.