目录
关键词
嵌入式、C语言、autosar
平台说明
项目 | Value |
---|---|
OS | autosar OS |
芯片厂商 | TI |
编程语言 | C,C++ |
编译器 | LLVM |
一、BUG背景
1.场景
1.添加或者删除task。
2.添加module。
3.section相关改动。
2.现象
编译错误:this include generates a translation unit too large for clang to process
二、问题分析
1.MemMap_compatibility.h
除了指定的内存映射头文件之外,MICROSAR MemMap还提供了生成一个名为MemMap_Compatibility.h的文件,用于兼容内存映射的头文件,可以理解为一个额外的扩展文件。根据vector和TI的回复综合考虑,初步判定为改文件中的section map 越界。后期核实确定问题点后更新。
2.Activation
To activate the generation of the compatibility memory mapping header file, the following
parameter must be set to a value other than NON:
/MICROSAR/MemMap/MemMapGeneral/MemMapCompatibilityGeneration
3.Empty File Generation
For testing purposes, the MICROSAR MemMap supports the generation of either empty
memory mapping header files or memory allocation keywords without pragma statements.
This can be useful to reduce build times during development of a project or to build the
project for tests on a host, where memory mapping is not applicable (e.g. VTT).
3.1Activation
To activate the empty memory mapping header file generation, the following parameter
must be set to EMPTY:
/MICROSAR/MemMap/MemMapGeneral/MemMapGeneration
To activate the generation of memory allocation keywords without pragma statements,
the following parameter must be set to FALSE:
/MICROSAR/MemMap/MemMapGeneral/MemMapGeneratePragmas
三、解决方案
1.临时解决方案
1.把MemMapCompatibilityGeneration 设置为NON,MemMapGeneration设置为EMPTY。
2.裁剪demo中的MemMap.h,适配于实际工程。该文件为vector给的一个demo文件,可以适当根据实际项目修改。
3.生成后效果如图,会清空XX_MemMap.h文件
四、结果
编译通过且功能正常,对比生成的文件差异在可控范围内。
小结
该方案为临时方案,可能会导致后续的MPU功能以及功能安全设计。欢迎各位大佬探讨另外的解决方案。