µVISION: modules with same name in the project
Information in this knowledgebase article applies to:
Can multiple modules with the same name added to a µVision project? And if yes, how does µVision deal with this duplicate module names?
Yes, in MDK 5.12 a mechanism was introduced to deal with modules having the same name in a project.
While modules with the same name can be compiled individually without issue, the linker will finally complain about them. To avoid this problem, µVision does index all files with "filename_N.ext" (N = 0,1,2,...), which get generated from the source modules with same name. Looking specifically at the object files, the first module keeps the original name "*.o", the second becomes "*_1.o", the third becomes "*_2.o", and so on.
For certain situations, like when excluding one of the files with same name form the build, the wrong current object file could be used for linking. To avoid that problem, also the from build excluded files are counted when doing the indexing since MDK 5.27.
MDK 5.28 expanded this mechanism also over different target output folders from projects with more than one target.
Due to this mechanism you need to pay attention when using the same scatter file for different project targets, when modules with the same name are in the project. A module select pattern for such a module will then only fit in one of the targets. The scatter file needs to be adapted for the other target(s).
Last Reviewed: Thursday, September 12, 2019
of your data.