none
How to always link with debug version of e.g. FAL.lib even when building a release image RRS feed

  • Question

  • Hi.

    I am working on a NandFlash driver that uses the FAL/FMD model under Windows CE 6.0 R3. Is it possible to configure the build system so that my NandFlash driver dll always link with the debug version of the FAL.lib even when building a release image? I would like the release image to have debug zones defined for the NandFlash driver and they are defined in the FAL lib but only when building a debug version. Should I make changes to the TARGETLIBS? it currently looks like this:

    TARGETLIBS= $(_TARGETPLATROOT)\lib\$(_CPUINDPATH)\xxxxxNandFlash.LIB \

                $(_COMMONOAKROOT)\lib\$(_CPUINDPATH)\fal.lib \

                $(_COMMONOAKROOT)\lib\$(_CPUINDPATH)\flsnandlib.lib \

                $(_COMMONSDKROOT)\lib\$(_CPUINDPATH)\coredll.lib \

                $(_COMMONOAKROOT)\lib\$(_CPUINDPATH)\ceddk.lib   \

    Thanks for any comment.

    Best regards

    Frank.

    Monday, August 3, 2015 1:30 PM

Answers

  • Hi Frank,

    I would not recommend this, only perhaps for development purposes. The difference between debug and release is more than just debugzones. Unfortunately MS decided to use debugzones only in debug builds.

    There are a few approaches for this and to answer your question directly you can modify TARGETLIBS are follow:

    TARGETLIBS= $(_TARGETPLATROOT)\lib\$(_CPUINDPATH)\xxxxxNandFlash.LIB \
                $(_COMMONOAKROOT)\lib\$(_TGTCPU)\debug\fal.lib \
                $(_COMMONOAKROOT)\lib\$(_CPUINDPATH)\flsnandlib.lib \
                $(_COMMONSDKROOT)\lib\$(_CPUINDPATH)\coredll.lib \
                $(_COMMONOAKROOT)\lib\$(_CPUINDPATH)\ceddk.lib   \

    However this is not very pretty (but will work).

    Second option is to define debugzones and dpCurSettings in your source code and surround them with #ifndef DEBUG/#endif enabling debugzones in retail build as wel.

    Ofcourse this needs to match the one defined in the FAL library...

    Or you can clone the FAL library and implement the driver nicely with correct debug zones. Check the following blog post of how to use a template for debuging messages here

    This is a standard implementation (build around DEBUG and RETAILMSG) which you can use for applications and drivers.. 


    Good Luck,

    Erwin Zwart, eMVP
    Check out my blog: http://guruce.com/blog
    GuruCE
    Microsoft Embedded Partner
    http://guruce.com
    Consultancy, training and development services.

    Monday, August 3, 2015 2:58 PM

All replies

  • Hi Frank,

    I would not recommend this, only perhaps for development purposes. The difference between debug and release is more than just debugzones. Unfortunately MS decided to use debugzones only in debug builds.

    There are a few approaches for this and to answer your question directly you can modify TARGETLIBS are follow:

    TARGETLIBS= $(_TARGETPLATROOT)\lib\$(_CPUINDPATH)\xxxxxNandFlash.LIB \
                $(_COMMONOAKROOT)\lib\$(_TGTCPU)\debug\fal.lib \
                $(_COMMONOAKROOT)\lib\$(_CPUINDPATH)\flsnandlib.lib \
                $(_COMMONSDKROOT)\lib\$(_CPUINDPATH)\coredll.lib \
                $(_COMMONOAKROOT)\lib\$(_CPUINDPATH)\ceddk.lib   \

    However this is not very pretty (but will work).

    Second option is to define debugzones and dpCurSettings in your source code and surround them with #ifndef DEBUG/#endif enabling debugzones in retail build as wel.

    Ofcourse this needs to match the one defined in the FAL library...

    Or you can clone the FAL library and implement the driver nicely with correct debug zones. Check the following blog post of how to use a template for debuging messages here

    This is a standard implementation (build around DEBUG and RETAILMSG) which you can use for applications and drivers.. 


    Good Luck,

    Erwin Zwart, eMVP
    Check out my blog: http://guruce.com/blog
    GuruCE
    Microsoft Embedded Partner
    http://guruce.com
    Consultancy, training and development services.

    Monday, August 3, 2015 2:58 PM
  • Hi Erwin.

    Thanks for the quick response, I have tried the TARGETLIBS change and it works fine but as you say it is not a nice way to do it so I will only use it for development/testing purposes.

    Best regards

    Frank.


    StrongIt - Frank Knudsen

    Tuesday, August 4, 2015 8:54 AM
  • Your welcome!

    If you need more help regarding template for debug message don't hesitate to ask. its actually quite elegant,




    Good Luck,

    Erwin Zwart, eMVP
    Check out my blog: http://guruce.com/blog
    GuruCE
    Microsoft Embedded Partner
    http://guruce.com
    Consultancy, training and development services.

    Tuesday, August 4, 2015 9:00 AM