Clear Filters
Clear Filters

generating a code from simulink for dsPIC

16 views (last 30 days)
osama aldweik
osama aldweik on 19 Dec 2022
Edited: Lubin Kerhuel on 13 Sep 2024 at 11:49
I am trying to generate a code from Simulink embadded coder to add it to my Source code for dsPIC33 ( I already used the MBLAB library and set a configuration and a master block and connected the compiler xc16)
but im facing the following problems:
  • the code is generated with variable redifintion to names like real32_T and so on and are they are decleared in a file called rtwtypes which im trying to avoid.
  • the compiler im useing is MikroC pro and im facing an error called "argument out of range" I tried to initiate some of the variables with the value zero and it solved some of the errors but there are other values that i couldn't change because the complicated structure of the generated code and im trying to avoid to change the machine generated code as well.
any tips are highly appreciated. thank you

Answers (1)

Adit Kirtani
Adit Kirtani on 21 Feb 2023
Hi Osama,
I would recommend the following documentation page for you to go through so you can manage your variable types:
This should help you control variable definition, as avoiding the generation of rtwtypes.h is not possible; it defines platform-independent types. As for your issue with variable definition, these documentation links may help you out:
I hope this helps,
Adit Kirtani.
  1 Comment
Lubin Kerhuel
Lubin Kerhuel on 13 Sep 2024 at 11:49
Edited: Lubin Kerhuel on 13 Sep 2024 at 11:49
Hi Osama,
The remark from Adit to change the Control Data Type was not working until recently. the MPLAB Device Blocks was not following this simulink setting.
Since the V3.57, we fully support custom datatype or C99 datatype naming set in simulink.
See release note on the Add-on page.
Works all ok with XC-DSC compiler.
Lubin

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!