Simulink top level subsystem block names cause different code generated from compiler

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

Simulink top level subsystem block names cause different code generated from compiler

Jump to solution
2,155 Views
hubeiren
Contributor II

We use MBD_toolbox MPC57xx V3.1 for our motor control (MCU). We have four top level subsystems (Application, HW interface, OS and MPC Config). The four subsystems were named automatically by simulink as subsystem 1,2,3 and 4. We built it and run in our ECU without issue. For better readability,  I changes subsystem names as Application, Interface, OS and Config. After built, it doesn't run in ECU anymore. And  the code generated are quite different. I changed them to subsystemApplication, subsystemInterface, subsystemOS and subsystemConfig. They are OK. Under the top level subsystem, we have named the sub-subsystem with all kind of names. There is no issues.

My question: Why the top level subsystem have to be started with "subsystem"?

Thanks,

Li

1 Solution
2,049 Views
hubeiren
Contributor II

After many trials, we found out that (at least at top level) model was built based on subsystem name's alphabet. It's not based from top to bottom, or from left to right. So anyone who want to make subsystem name has to be aware of this hidden rules.

Thanks for offering help! 

View solution in original post

4 Replies
2,049 Views
hubeiren
Contributor II

I did more test but couldn't figure out the causes.

- Subsystem Name Test

Summary:

Test #

Subsystem Names

Results

1

SubsystemApplication, SubsystemInterface, SubsystemOS, SubsystemConfig

pass

2

S_Application, S_Interface, S_OS, S_Config

pass

3

G_Application, G_Interface, G_OS, G_Config

Pass

4

Application, G_Interface, G_OS, G_Config

Pass

5

Application, Interface, G_OS, G_Config

Pass

6

Application, Interface, OS, G_Config

Pass

7

Application, Interface, OS, Config

Pass

8

Application, Interface, OS, MPC_Config

Fail

9

Application, Interface, OS, MPC_1Config

Fail

10

Repeat Test #7

Pass

11

Application, Interface, OS, MPC1_Config

Fail

12

Application, Interface, OS, MP_C_Config

Fail

0 Kudos
Reply
2,049 Views
constantinrazva
NXP Employee
NXP Employee

Hello hubeiren@yahoo.com‌,

Could you send us the model you are using? You can delete proprietary code and only leave parts of the model so that I can replicate your issue. Once I have it I can investigate and also contact Mathworks (if the issue is not caused by our toolbox, but by Simulink).

Kind regards,

Razvan. 

0 Kudos
Reply
2,050 Views
hubeiren
Contributor II

After many trials, we found out that (at least at top level) model was built based on subsystem name's alphabet. It's not based from top to bottom, or from left to right. So anyone who want to make subsystem name has to be aware of this hidden rules.

Thanks for offering help! 

2,049 Views
constantinrazva
NXP Employee
NXP Employee

Hello hubeiren@yahoo.com,

Thank you for taking the time to share that information with the entire community!

Kind regards,

Razvan.

0 Kudos
Reply