In case you need to export the generated code to S32 Design Studio for PA IDE, now there is an easy way. No more painful job of reconstruction the project manually and setting all sort of compiler flags. Here is what you need to do in just a few steps.
Toolbox for MPC5744P rev2.0: Model Based Design Toolbox For Panther (MPC574xP) Family of Processors 2.0 IS NOW AVAILABLE!
HotFix_4 for MPC5744P rev2.0: https://community.nxp.com/thread/451804#comment-925214
S32DS IDE v1.2 or newer: S32 Design Studio for Power v1.2.
#1: make sure the HotFix_4 is installed successfully and the "Generated S32 Design Studio ProjectInfo.xml file" option is visible and selected
#2: build the Simulink model as normal (e.g. Motor Control System example from Motor Control Class: Lecture 12 - Motor Control System since it is the most complex application we built so far on this community) and wait until is completed successfully.
#3: Open S32DS for PA and select Import/S32 Design Studio/ProjectInfo.xml Importer
#4: Press Next and select the ProjectInfo.xml from the location used to generated the C-code for the Simulink model. Also, select the E200 Executable option
#5: Click on Finish button to have the project imported into the S32 Design Studio workspace.
#6: Applicable for S32DS v1.2 (due to a bug in IDE): Open the Project Properties and go to Settings/Target Processor and select "generate code for E200Z4" as Target Processor and re=select the option shown near the Libraries Support. These will force the IDE to update the toolchain properties correctly. These limitations will be addressed in the newer versions of S32DS for PA.
#7: Build the project
Expected result: The executable file should be produced without any errors. In case of errors - please recheck #6.
My S32 is not able to build after importing xml project file generated by Simulink.
Below are details what i did,
i checked the installation path of NXP MBD, whether it has "space" in the directory of not :
C:\Users\vietmq\AppData\Roaming\MathWorks\MATLAB Add-Ons\Toolboxes\NXP_MBDToolbox_S32K1xx ==> Should be OK, no space.
Open MBD GPIO example for S32K144, and configure for exporting xml project file:
Generate the code, no error, see log file : gpio_s32k144_build_20210219_103350.txt (attached in the post)
Open S32SD and import xml file :
i ticked on the first option, can not build, then i tried second option but can not build too.
Please help !!!
S32Design Studio has some hick-ups when it comes to paths with spaces -- and when you are trying to import the project generated by our toolbox, you'll be generating ProjectInfo.xml file which is then used as input for S32Design Studio importer. This XML file will contain a path to your toolbox, so it will contain spaces, and S32DS crashes somewhere.
To fix this, you should install your toolbox in a path with no spaces - this is a general recommendation for everything (I guess).
Please let us know if you have any issues with it after installing it into a new path with no spaces.
Thank you, reinstall the toolbox in the path without spaces according to your prompt，the problem is solved,. It turns out that there is a matlab add-on in the default path with spaces. However, the 3.0 version I installed before, there is no problem to install in that path.
Also I would like to ask, after installing version 3.2, compiling programs in matlab becomes very slow, the same program is significantly faster in version 3.0, can I change the settings to speed up compilation?
There is another problem. When I use the motor program in the toolbox, I need to add two paths each time I import it into S32. Is there any setting that can permanently solve this problem?
use this> need to add paths>>build successful
I'm glad everything worked out with the importer -- as for the default toolbox path, it depends on what MATLAB/Simulink version you are running - they will be slightly different (+ some will generate an extra folder named code, others will not).
Now for the compile time -- did you test the 2 versions of the toolbox on the same Simulink version? If you did, could you send us the model that you are running? It goes without saying that the build depends on the complexity of the model itself -- so it would be best if we could run some tests on the model you have here (the one which takes you 3m+ to build).
I try to build the project, but there is three errors like following,
I used the latest version of MBD and S32.
I also try to delete the following including paths
but still have errors
the defualt optio" for E20072"of target processor is the same errors.
May I have your help.
Unfortunately that is an issue with S32 Design Studio (latest version). It will be fixed in the next update I think.
You can try a workaround for the moment, or with the S32 Design Studio version 2017.R1 (older version).
For the workaround, you should rename all .S files to .s files (so they don't use capital letter S)
core0_intc_sw_handlers.S - to core0_intc_sw_handlers.s
interrupt_vectors.S - to interrupt_vectors.s
startup_MPC5744P.S - to startup_MPC5744P.s
If this alone does not work, you should also rename the files in ProjectInfo.xml (generated by our toolbox).
If you try the workaround please let us know if you are facing issues.
If you just try the older version (2017.R1), it should work without any errors.
For the S32K14x - we have the same procedure for exporting the project to S32 Design Studion as the one described in the beginning of this article.
Hope this helps!
In the Configuration parameter of S32K, there is no option to choice "generate S32 Design Project" as you decribe. But in the 'Block Parameters : MDB_S32K14x_Config_Infomation' / 'Buid Toolchain' allows users to create file.xml but only with GCC Compiler.
I did this, but when i import project XML from S32DS, it buid errors. May be I configured it incorrectly. Can you describe more detail with S32K14x?
Sorry for the delayed answer - your problem is due to the fact that you have used other version of gcc between MATLAB and S32Design Studio (when you imported the project). When you select to import using ProjectInfo.xml, you have a selection to make:
Depending on what version of gcc you have used (4.9.x vs 6.3.x), you have to select the first one, or the 3rd one (both ARM32 Executable, the difference being the toolchain - ARM bare-metal vs standard S32DS). So please try to import it again, selecting the other one of the 2 shown in the picture above.
Please let us know if you're still having issues with this problem.
That great, I 've builded sucessful. It is due to different version of gcc between MATLAB and S32Design Studio and I chose the 3rd type (Standard S32DS toolchain for ARM). That is OK
Thanks you so much!
Hi Jason Liu,
I see you are using the latest MBDT for MPC57xx 3.0 which is good. The toolbox can export the generated C code so that it can be later on imported into S32 Design Studio.
Can you please try to import & build the project attached here? I would like to exclude a S32DS configuration issue.