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

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

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

跳至解决方案
1,238 次查看
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 项奖励
回复
1 解答
1,229 次查看
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

 

在原帖中查看解决方案

1 回复
1,230 次查看
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