S32K14x:import simulink code to S32DS

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32K14x:import simulink code to S32DS

Jump to solution
1,253 Views
Lilac
Contributor I

I just started learning to use Simulink in combination with MCU..

How to import simulink-generated code into S32DS so that it can be executed in conjunction with projects in S32DS. So that part of our project was designed by Simulink, the hardware driver code and main functions were handmade in the S32DS.

For example,there are three variables defined by Simulink modeling, i have generated the c code of the Simulink modeling,i want to import it into S32DS, and then the SDK package is used to configure the values of the variables to the values of ADC voltage sampling.

0 Kudos
1 Solution
1,226 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@Lilac

1.For example:

simulink_example.h(generated by matlab)

/* Imported (extern) block signals */
extern uint8_T Input_1;/* '<Root>/In1' */

 

 main.c

#Include "simulnk.h"

/*Define Simulink Stateflow Chart Input parameters*
uint8_T	 	Input_1 = 0;

 

2.How to include external files,and add the files path

for example.

Senlent_0-1638770995585.png

 

Senlent_1-1638771017185.png

BR!

     Jim,

 

 

View solution in original post

0 Kudos
3 Replies
1,227 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@Lilac

1.For example:

simulink_example.h(generated by matlab)

/* Imported (extern) block signals */
extern uint8_T Input_1;/* '<Root>/In1' */

 

 main.c

#Include "simulnk.h"

/*Define Simulink Stateflow Chart Input parameters*
uint8_T	 	Input_1 = 0;

 

2.How to include external files,and add the files path

for example.

Senlent_0-1638770995585.png

 

Senlent_1-1638771017185.png

BR!

     Jim,

 

 

0 Kudos
1,221 Views
Lilac
Contributor I

Thanks for your reply!

But the last picture is really unclear, I can't see what you chose. And this is my screenshot, can you tell me which one is the right one?

Lilac_0-1638774639286.png

 

0 Kudos
1,216 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@Lilac

It doesn't matter,for the last picture, I just want to tell you where to add or delete the files path. 

Senlent_0-1638777547427.png

BR!

     Jim,

 

0 Kudos