Why do I get build errors about missing headers (arm_math.h) when using CMSIS Code Replacement Library for ARM Cortex?
10 ビュー (過去 30 日間)
古いコメントを表示
MathWorks Support Team
2019 年 7 月 26 日
編集済み: MathWorks Support Team
2024 年 4 月 17 日
I am trying to use CMSIS Code Replacement Library (CRL) while targetting ARM Cortex-M with MATLAB/Simulink.
My model contains cosine and sine blocks. After code generation, the Code Replacement Report confirms that crl_table_cmsis.mat library was used:
arm_cos_f32................<Root>/Sin1
arm_sin_f32................<Root>/Sin2
The corresponding implementation header is mw_cmsis.h, which again includes arm_math.h from CMSIS library.
During the build, I see below below error using Visual Studio 2017:
....\<modelname>_ert_rtw\mw_cmsis.h(12): fatal error C1083: Cannot open include file: 'arm_math.h': No such file or directory
採用された回答
MathWorks Support Team
2024 年 4 月 17 日
編集済み: MathWorks Support Team
2024 年 4 月 17 日
There are two things to note about builds using the CMSIS code replacement libraries (CRL):
1) CMSIS libraries only work with GNU toolchains, not with Visual Studio compilers. Ensure that the selected toolchain is "GNU Tools for ARM Embedded Processors" in the "Code Generation" area of your model's Configuration Parameters.
2) The CMSIS CRL works only out-of-the-box with the ARM Cortex-M Support Package:
The CMSIS CRL will work when you select any of the Hardware boards that we ship as part of ARM Cortex Support Packages. Therefore, make sure that you have selected the appropriate board in the model settings under Hardware Implementation > Hardware Board.
CMSIS needs this information, for example which ARM architecture (M0, M3, ...M7) is used. The correct CMSIS library will be selected based on the selected architecture. This information is coming from the Hardware Board parameter. Set this parameter accordingly in the "Hardware Implementation" area of your model's Configuration Parameters.
If you are not using any of the hardware boards that we support as part of our support packages, or a third-party target, you can follow the Target Creation workflow to create a target for your hardware as explained here:
In this way, you can create a target and add the necessary information such as architecture, library name etc.
0 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!