How to use the command line to generate the Debug version of the MCU on the S32 Design Studio platform.

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

How to use the command line to generate the Debug version of the MCU on the S32 Design Studio platform.

4,182 Views
279599829
Contributor II

Hello, 

   I have a task: Automatically build the MCU project through a script. I found that the Debug folder was generated after the MCU project on S32 Design Studio was built. The Debug folder contains many files. Such as makefile, objects.mk, sources.mk and  some documents corresponding the MCU project.

   I know that the MCU project is executing the "make -j8 all" command in the Debug folder to perform the build.   But I don't know what instructions the S32 Design Studio platform uses to generate this Debug folder. I found using the eclipse command line in the forum to build the project on the CDT. However, the Debug folder generated by the command line is not the same as the Debug folder generated by the S32 GUI. And the build result did not succeed.

   The command line I used is: "eclipsec.exe -noSplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild -import  D:\workspaceS32DS\MPC5746C_App_Z4 -cleanBuild MPC5746C_App_Z4/Debug". There will always be a compilation error and a prompt will pop up. You can see the relevant information from the picture. At the same time you can see the compile-time error message from the text file. 

   I want to know how to generate the contents of the correct Debug folder and can successfully build and get the correct result. 

   If there are other ways to automatically build the MCU project, please let me know.

Thank you very much.

0 Kudos
9 Replies

3,402 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

I figured out that with -import option I got the very same eclipse/java error. I used -data instead -import and it is working fine form me. 

Jiri 

0 Kudos

3,402 Views
279599829
Contributor II

Dear Jiri:

     I have changed the command as you suggested. But I found a warning that it could not find the project file. So I first executed the command: 

eclipsec.exe -noSplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild -data  D:\test  -import D:\test\MPC5746C_App_Z4

This will not be an error.

Then I executed this command again.

eclipsec.exe -noSplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild -data  D:\test  -cleanBuild MPC5746C_App_Z4/Debug

I am very sad. It still has the problems I first encountered.

I tried to run the following command and reported the same error.

eclipsec.exe -noSplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild -cleanBuild MPC5746C_App_Z4/Debug

I think the reason for this error is still the Debug folder error. 

With the command, the correct files is not generated in the same manner as using the eclipse GUI.

I would like to know how S32 Desgin Studio executes commands when compiling a project.

What method can I use to get the correct compiled files?

I hope you can help me.

I sincerely thank you.

Xiao

0 Kudos

3,402 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

I'm trying to find way how to generate Processor Expert code from command line. Meanwhile you can just generate them from GUI (the content is not erased by clean). Just click on generate processor expert code in S32DS IDE:
pastedImage_1.png

and close S32DS. Then you can be able build your project from command line - if there are no other errors. In my case I'm using for test purposes SDK example dspi_master_mpc5746c. Here is console command for my environment (PE code already generated from GUI): 

c:\NXP\S32DS_Power_v2017.R1\eclipse\eclipsec.exe -noSplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild -data .\ -cleanBuild dspi_master_mpc5746c

I'm starting this command from root of my workspace, that's why after -data is ./ . Normally there is full path to your workspace root. 

Jiri 

0 Kudos

3,402 Views
279599829
Contributor II

Dear Jiri:

      Thank you for your reply.:smileylaugh::smileylaugh::smileylaugh:

      I tried to do what you said. First click on the button on the eclipse button, then close the eclipse, and finally use the command to compile. Unfortunately, there are still problems with compilation failure. :smileycry::smileycry:

      As you said, the project will generate Processor Expert code  first, and then execute the -cleanbuild command?

      I found some information about generating Processor Expert code from command line from the S32ds help documentation.:smileyhappy:

      help.png 

help_content.png

I executed this code based on this command line.

eclipsec.exe -noSplash -data D:\test -application com.freescale.processorexpert.core.PExApplication -generate MPC5746C_App_Z4

The following results appear.

D:\S32_Design_Studio\eclipse>eclipsec.exe -noSplash -data D:\test -application com.freescale.processorexpert.core.PExApplication -generate MPC5746C_App_Z4
Opening project MPC5746C_App_Z4 ...
java.lang.IllegalArgumentException: Wrong format: SDK_MPC574x_02, expected: (\d*\.)*-(GA|RC)?\d*(-.*)?
at com.processorexpert.core.kpsdk.preferences.descriptors.SdkManifestDescriptor$SdkVersion.<init>(SdkManifestDescriptor.java:1339)
at com.processorexpert.core.kpsdk.preferences.descriptors.SdkManifestDescriptor.setSdkVersionNumber(SdkManifestDescriptor.java:350)
at com.processorexpert.core.kpsdk.preferences.descriptors.SdkManifestDescriptor$Builder.build(SdkManifestDescriptor.java:875)
at com.processorexpert.core.kpsdk.preferences.PEProjectExtenderSDK.manifestLoad(PEProjectExtenderSDK.java:716)
at com.processorexpert.core.kpsdk.preferences.PEProjectExtenderSDK.manifestLazyLoad(PEProjectExtenderSDK.java:807)
at com.processorexpert.core.kpsdk.preferences.PEProjectExtenderSDK.manifestLazyLoad(PEProjectExtenderSDK.java:580)
at com.processorexpert.core.kpsdk.preferences.PEProjectExtenderSDK.loadProjectOption(PEProjectExtenderSDK.java:448)
at com.processorexpert.core.ProjectPE.loadProject(ProjectPE.java:1740)
at com.processorexpert.core.client.ProjectPEclient.loadProject(ProjectPEclient.java:2039)
at com.processorexpert.core.ProjectPE.loadProject(ProjectPE.java:1614)
at com.processorexpert.core.client.ProjectPEclient.loadProject(ProjectPEclient.java:2144)
at com.processorexpert.core.client.PEApplicationClient.openProject(PEApplicationClient.java:162)
at com.processorexpert.core.ProjectManager.getProject(ProjectManager.java:241)
at com.processorexpert.core.application.PExApplication.generateProject(PExApplication.java:144)
at com.processorexpert.core.application.PExApplication.run(PExApplication.java:83)
at com.processorexpert.core.application.PExApplication.start(PExApplication.java:55)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:673)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610)
at org.eclipse.equinox.launcher.Main.run(Main.java:1519)
com.freescale.processorexpert.core: Type specification is not defined "typedspi_bitsperframe_t", symbol: SlavebitsPerFrame
com.freescale.processorexpert.core: Type specification is not defined "typedspi_bitsperframe_t", symbol: MasterbitsPerFrame
com.freescale.processorexpert.core: Type specification is not defined "typedspi_bitsperframe_t", symbol: MasterPCS
com.freescale.processorexpert.core: Cannot create new item, could not load item: symbol = InhrItem item = Beans\power_manager\Items\"CompVersion"\power_manager_inhr.item
generating
java.lang.Exception: Processor Expert Assert: TMacroProcessor.getString: StartChar in CHARS_APOSTROPHES_EXTENDED
at com.processorexpert.runtime.system.DelphiSystem.Assert(DelphiSystem.java:39)
at com.processorexpert.core.macrolanguage.TMacroProcessor.getString(TMacroProcessor.java:5815)
at com.processorexpert.core.macrolanguage.TMacroProcessor.macroCmd(TMacroProcessor.java:11923)
at com.processorexpert.core.macrolanguage.TMacroProcessor.convertSrcLine(TMacroProcessor.java:15074)
at com.processorexpert.core.macrolanguage.TMacroProcessor.convertSrc(TMacroProcessor.java:14693)
at com.processorexpert.core.components.TCompPred.genCode(TCompPred.java:1248)
at com.processorexpert.core.components.TCompnt.genCode(TCompnt.java:2964)
at com.processorexpert.core.project.TProject.doGenerate(TProject.java:12839)
at com.processorexpert.core.project.TProjectWithPEAPI.doGenerate(TProjectWithPEAPI.java:1042)
at com.processorexpert.core.project.TProject.generate(TProject.java:11062)
at com.processorexpert.core.project.TProjectWithPEAPI.generate(TProjectWithPEAPI.java:349)
at com.processorexpert.core.client.ProjectPEclient.generate(ProjectPEclient.java:1516)
at com.processorexpert.core.application.PExApplication$1.run(PExApplication.java:156)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
generation finished
project closed

D:\S32_Design_Studio\eclipse>

As you can see, there have been several Exception, and I don't know the reason for the error.:smileyconfused:

After that I tried to execute the compiled command again.

eclipsec.exe -noSplash -application org.eclipse.cdt.managedbuilder.core.headlessbuild -data  D:\test -cleanBuild MPC5746C_App_Z4/Debug

Problems that have occurred before will still arise.:smileycry:

I am wondering why there is no problem in building the Debug version on Eclipse GUI. However, various errors occur when executing the command line.

This is really interesting. I think we must have missed something. 

I hope you can provide more useful information.

Thank you for your help.:smileygrin:

Looking forward to your reply.:smileygrin:

Xiao

0 Kudos

3,402 Views
ruudsiebierski
Contributor III

Hi,

I had the same regular expression warning about the SDK version. It is fixable by setting the api version in the sdk_manifest.xml to a 'correct' value.

sdk_manifest.xml is in the root of your sdk

<?xml version="1.0" encoding="UTF-8"?>
<ksdk:manifest format_version="1.2" xmlns:ksdk="http://freescale.com/ksdk/1.2/ksdk_manifest.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://freescale.com/ksdk/1.2/ksdk_manifest.xsd http://freescale.com/ksdk/1.2/ksdk_manifest.xsd">
 <!--This file is designed to identify S32 SDK release. It was generated by Doxy2Component.-->
 <ksdk id="SDK_MPC574x_06" name="SDK_MPC574x_06" version="SDK_MPC574x_06"/>
 <api version="1.0.0"/>

the version attribute of the api element was; SDK_MPC574x_06, this is 'wrong'.

Hope it helps someone.

Ruud

0 Kudos

3,072 Views
hsmith
Contributor I

How does one determine what the "correct" sdk version is.  I would assume the files in the installer are correct but some option isn't set correctly but am not having luck figuring out what is compared to the version in the manifest.xml file

0 Kudos

3,402 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

I have the same java exception - but PE code is generated successfully from command line and also project can be build without any issue. 

Did you try build the project from your regular S32DS workspace? From build output it should be D:\workspaceS32DS , but you are targeting by -data option D:\test . It looks like that you have absolute path for some files - like dspi_driver.h. Where is physically present the callbacks.h header file which caused build error? 

If it is possible - can you please share your project? 

Jiri

0 Kudos

3,402 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

it looks like that you also need to invoke processor expert code generate. Here you can find more info: 

Eclipse Command Line Code Generation with Processor Expert | MCU on Eclipse 

Hope it helps. 

Jiri

0 Kudos

3,402 Views
279599829
Contributor II

Dear Jiri:

    I found that the content of this link is not helpful to me. There is no similar available file in my eclipse folder. I also didn't find too much command line information from the help documentation of S32 Design Studio. 

   Are there other ways to tell me?

   Thank you very much.

file.png

Xiao

0 Kudos