This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Creating different targets of a project (uVision v.5.23.0.0)

Hello,

For my project I use uVision v.5.23.0.0; now I am willing to prepare two different targets using the same source files: one target for debug, with included the drivers for UART, and another one with UART-related stuff (and also other modules) removed, which is to be used to optimize the power consumption. I have successfully created two different targets, but I don't see a way to make them include different set of files: it turns out that all source files are common for the two targets. If I remove a file from a group, it is removed from the two targets. If I modify sdk_config.h modification reflects the two targets too - i.e. it is does not seem possible to set up different copies of the config file for each target. So my question is how to handle this situation? Is it possible to configure different set of files (and sdk_config.h, in particular) for each target?

Thanks 

  • Hi,

    To remove a file from one of the targets, you can use the "include in target build" option available in each file:

    When it comes to the "sdk_config.h" issue I would use a define from "Preprocessor symbols" to include an additional or alternate version of sdk_config.h. There are a few ways to do this. My suggestion is to create an additional file "sdk_config_debug_override.h" which is included only in the debug project and uses undef and define to override values defined in the regular "sdk_config.h". See screenshot below for an idea of what I mean.

    If you end up deep into Keil settings, you may be able to get better help from ARM themself. I am an experienced user of Keil, but ARM are the ones with the expert knowledge.

    Best regards,
    Rune Holmgren

  • Sorry, I have to reopen this topic again. Whenever I right-click the file that I want to exclude from target-build, I'm only offered to change options for the complete component-class (s. screenshot). Could you please give any hint. Thx

Related