Using own custom "rt_main.c" with system target file grt.tlc in Simulink Coder

Hi,
I would like to know whether it is possible to make grt.tlc target to point to my own custom "rt_main.c" in my own project path instead of the predefined "rt_main.c" in Matlab's installation path. Basically the line 181 in the generated makefile should ultimately be:
MAIN_SRC = <my own paht>/rt_main.c
Thanks!

 採用された回答

Konstantinos
Konstantinos 2024 年 9 月 19 日

1 投票

I've managed to find a solution by including makecfg.m in my custom simulink library and utilizing the functions
  1. setTargetProvidesMain() and
  2. addSourceFiles() for including my rt_main.cpp implementation.

その他の回答 (1 件)

Shanmukha Voggu
Shanmukha Voggu 2021 年 10 月 1 日

0 投票

Hi Konstantinos,
I Understood that you want to have custom rt_main.c file in your project. This option is available in the Embedded Coder but not in the Simulink Coder.
Refer this for more information.
Hope this helps!

3 件のコメント

Konstantinos
Konstantinos 2021 年 10 月 1 日
Hi Shanmukha,
Embedded coder is installed in my system. Could you provide instructions for customizing main in that case?
Thanks!
Shanmukha Voggu
Shanmukha Voggu 2021 年 10 月 2 日
Refer documentation regarding Embedded Coder.
Konstantinos
Konstantinos 2023 年 8 月 31 日
Hi Shanmukha,
I've managed to find a solution by including makecfg.m in my custom simulink library and utilizing the functions
  1. setTargetProvidesMain() and
  2. addSourceFiles() for including my rt_main.cpp implementation.
Best,
Konstantinos

サインインしてコメントする。

カテゴリ

ヘルプ センター および File Exchange で Deployment, Integration, and Supported Hardware についてさらに検索

製品

リリース

R2019a

質問済み:

2021 年 9 月 28 日

回答済み:

2024 年 9 月 19 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by