How do I use a custom linker file with the STM32 Support Package?
16 ビュー (過去 30 日間)
古いコメントを表示
MathWorks Support Team
2024 年 9 月 4 日
編集済み: MathWorks Support Team
2024 年 9 月 11 日 16:09
Is there a way to specify a custom linker file for the "Embedded Coder® Support Package for STMicroelectronics® STM32 Processors"?
採用された回答
MathWorks Support Team
2024 年 9 月 11 日 0:00
The STM32 support package currently does not offer a built-in way to specify a custom linker file. This is because we use the linker file generated by the STM32CubeMX tool.
As a workaround, you can overwrite the generated linker file with the desired custom linker file using the "Post Code Generation Command" after the code generation has occurred but before the build process starts.
More information on customizing the build process using the Post Code Generation Command can be found here: https://www.mathworks.com/help/rtw/ug/customizing-post-code-generation-build-processing.html
Assuming your custom linker file is located at <sourceLDFile>, and the automatically generated linker file from CubeMX is in <destinationLDFile>. The generated linker file should be inside a folder named "STM32CubeIDE" at the same level as the IOC project file.
In the parameters of the Simulink model, append the following string under:
Hardware > Hardware settings > Code Generation > Advanced Parameters > Post Code Generation Command
;copyfile('<sourceLDFile>', '<destinationLDFile>','f');
where <sourceLDFile> and <destinationLDFile> are the absolute paths to the custom linker file and the generated linker file, respectively.
See the following screenshot for reference:
0 件のコメント
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!