I found the bug in uVision v5 1. add a segment of code #ifdef XYZ ... #endif
2. make sure there is no preprocessor symbol XYZ 3. save all and rebuild 4. check code size 5. edit preprocessor symbol, add XYZ 6. click BUILD (F7) -> keil figured out that you changed compile options and it's doing what looks like a rebuild and not only build of changed files (showing that it's compiling all c files in project) 7. check code size, it's same as without symbol, the whole block of txt between ifdef XYZ and endif is NOT compiled?!?! - BUG 8. click REBUILD -> the code is now built, the codesize increased
so the rebuild done from build in step6 does not properly work, it's a serious bug :(
> Nope. I don't agree with that. Just because you don't see it > working the way it you think it should, does not make it a bug. > It's more a decision made that you don't like.
You are 100% right, I have to admit :D
But I'm still wondering why it's compiling all those other files after project edit? Need to figure out what's going on there.. the "groups" mentioned before might be the key but my web search gets me nothing and quick browse trough documentation gave me nothing too :(
> I personally do a rebuild on a project change. Just to ease my paranoia, > I also do a full rebuild immediately prior to a formal release
Same thing I do :D
The whole thing here happened as a "friend who's learning C" had a problem that #ifdef with symbol from project property was not working for him. Something so simple and plain that was impossible to "not work", after not being able to explain him what to do (as it should work) I TV to his box and it was working for me (as I clicked rebuild of course) and then he figured out he was clicking "build" not "rebuild" but since on "build" Keil was compiling so many files after project was edited it was confusing... So, what Dave would of said "trap for young players".. and while it does not affect me I think it is confusing enough to warrant a bug status :)
But I'm still wondering why it's compiling all those other files after project edit?
Because it does exactly what you wanted it to, and what it should do: it noticed that you changed the settings effective for those files, so they have to be compiled next time.
My guess is that the surprise is rooted in the fact that, while you were intending to do a "project edit", i.e. a change of compiler settings for all source files, what you actually did was just a change for most files.
Let's have a look: open the project window. Expand the hierarchy. Note that below the master "Project" node, there are several sub-hierarchies ("Targets", "Source groups", "Components" and whatnot), which eventually contain (references to) the source files. Each of those nodes can have compiler settings, which then modify or override the settings inherited from the higher-up node. By default only the nearly top-most "Target" node contains settings, and all others pass them on unmodified --- the "taint" mark is there to warn you if that's no longer the case. But if you add a new switch to a node other than "Target", that will only affect the files below that node.
Thanks for sticking with me, I'm really trying to figure this one out once and for all :)
> Because it does exactly what you wanted it to, and what it should do: > it noticed that you changed the settings effective for those files, > so they have to be compiled next time.
> My guess is that the surprise is rooted in the fact that, while you > were intending to do a "project edit", i.e. a change of compiler > settings for all source files, what you actually did was just a > change for most files.
It is possible since I don't know that there are "groups of files" in Keil hence very possible I did something wrong. On the other hand, I have main.c open (only) and I'm clicking main menu - "project"/"options for target kupola" (kupola is name of the project and the only target available). The go to C/C++ tab and change preprocessor symbols/define, click OK and that's it. Not sure how can that be related to "only those files" :(
The "project structure" as made by cubemx, "Application/User" "directory" contains main.c, gpio.c, usart.c, spi.c, stm32F4xx_it.c, stm32f4cc_hal_msp.c files.. and when I click make after editing project it's compiling gpio.c, usart.c, spi.c and not main.c ? How is the gpio.c different from main.c - where to see that?
> Let's have a look: open the project window. Expand the hierarchy.
Like this (dunno how to link image to post, open url manually): pasteboard.co/GDvvq1r.png
> Note that below the master "Project" node, there are several > sub-hierarchies ("Targets", "Source groups", "Components" and whatnot), > which eventually contain (references to) the source files. > Each of those nodes can have compiler settings,
gpio.c, usart.c, spi.c and main.c are in the same group (as visible on the image)
The "kupola" node (target) is selected in the project window, I click on project/options for target kupola -> so options for the whole (and only) target.
click on build - it recompiles gpio.c usart.c and spi.c and does not recompiles main.c that is in the same group (Application/User) in the same target (kupola).
I don't get, still, what I'm doing wrong :(. It's super simple (freshly generated product skeleton), there's only one target..
thanks
btw I checked each group (right click, group properties) and it's blank, all settings are blank, only the top target have options..
I can upload project somewhere so you can check, it's empty project nothing to hide