Simulink - Model-based-design-Toolbox - build and flash questions

cancel
Showing results for 
Search instead for 
Did you mean: 

Simulink - Model-based-design-Toolbox - build and flash questions

Jump to solution
225 Views
Raphael2
Contributor III

Hello,

I have a general question about flashing a microcontroller with simulink - matlab.

Until now I only tried example projects and to do so I always used the Build button of the Embedded Coder. (I work with the s32k144 EVB)

Praemas_0-1626343224046.png

This generates the code and creates a file.

Praemas_1-1626343336867.png

If I wanna flash the Board again with this example I always pressed the Build button again.

1. Do I always overwrite the file above by this step? And could this lead to any problems?

2. Can I reuse the generated code in the file and flash it directly to the board with Matlab without opening the project in Simulink again? If yes how do I do it?

3. Can I flash the board with the generated file but with S32 Design Studio for ARM

Best Regards

0 Kudos
1 Solution
216 Views
mariuslucianand
NXP Employee
NXP Employee

Hello @Raphael2 ,

Let's answer your questions one by one.

1. Do I always overwrite the file above by this step? And could this lead to any problems?

The code should be generated and build every time when you press the build button. The code regeneration cannot lead to any problems.

2. Can I reuse the generated code in the file and flash it directly to the board with Matlab without opening the project in Simulink again? If yes how do I do it?

The short answer here is yes. You have to copy-paste the .mot file from inside the generated folder to the S32K144 mounded drive. In my case is EVB-S32K144 (D)

mariuslucianand_0-1626346568929.png

3. Can I flash the board with the generated file but with S32 Design Studio for ARM

Absolutely. If you only have to flash the generated code, then inside the folder you will find a .elf file. In S32DS for ARM you have to go to the Flash window, Select a project for S32K144, then Browse for the .elf file and press Flash.

mariuslucianand_1-1626346772092.png

Hope this helps,

Marius

 

View solution in original post

1 Reply
217 Views
mariuslucianand
NXP Employee
NXP Employee

Hello @Raphael2 ,

Let's answer your questions one by one.

1. Do I always overwrite the file above by this step? And could this lead to any problems?

The code should be generated and build every time when you press the build button. The code regeneration cannot lead to any problems.

2. Can I reuse the generated code in the file and flash it directly to the board with Matlab without opening the project in Simulink again? If yes how do I do it?

The short answer here is yes. You have to copy-paste the .mot file from inside the generated folder to the S32K144 mounded drive. In my case is EVB-S32K144 (D)

mariuslucianand_0-1626346568929.png

3. Can I flash the board with the generated file but with S32 Design Studio for ARM

Absolutely. If you only have to flash the generated code, then inside the folder you will find a .elf file. In S32DS for ARM you have to go to the Flash window, Select a project for S32K144, then Browse for the .elf file and press Flash.

mariuslucianand_1-1626346772092.png

Hope this helps,

Marius

 

View solution in original post