Hi,
I am trying to build the PFE-DRV_S32G_M7_MCAL_1.4.0 MasterProject_RDB3. I followed the instructions described in the document S32G PFE Master Demo Building V2 by John Li.
I successfully created the MasterProject_RDB3 project in EB Tresos and copied all the generated files to the 'PFE-DRV_S32G_M7_MCAL_1.4.0/example_application' folder. However, I encountered an issue where the Mcl_Types.h file is reported as missing.
Could you help identify what I might be missing or misconfigured?
For reference, I am using:
$ make
CC src/CDD_Mcl_Cfg.c
In file included from src/CDD_Mcl_Cfg.c:39:
include/CDD_Mcl_Cfg.h:41:10: fatal error: Mcl_Types.h: No such file or directory
41 | #include "Mcl_Types.h"
| ^~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:690: output_RDB3/CDD_Mcl_Cfg.o] Error 1
Thanks,
XD
解決済! 解決策の投稿を見る。
Thanks again @GuilhermeS32G!
@XD, as mentioned in a previous comment, avoid using the Copy project into workspace option when importing the project into Tresos, this will cause missing files problems:
You should access the original folder in which the project was decompressed with cygwin and then follow the build steps, for me it is C:\NXP\PFE-DRV_S32G_M7_MCAL_1.4.0\example_application, also please use the original make file, as mentioned by Guilherme, you only need to modify the project_parameters.mk file.
It is also worth mentioning that after I changed my RTD version to the correct one, I did not need to manually import the project into tresos, I just specified the workspace path in the project_parameters and the build scripts took care of everything. As previously mentioned I ran the following commands:
make clean ; make generate ; make build
Add a screenshot of the make output after running make clean to avoid any confusion.
PFE-DRV_S32G_M7_MCAL_1.4.0/example_application
$ make
mkdir -p output_RDB3
CC src/CDD_Mcl_Cfg.c
In file included from src/CDD_Mcl_Cfg.c:39:
include/CDD_Mcl_Cfg.h:41:10: fatal error: Mcl_Types.h: No such file or directory
41 | #include "Mcl_Types.h"
| ^~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:690: output_RDB3/CDD_Mcl_Cfg.o] Error 1
Hello @XD it is good to support you again,
My first recommendation is to check if the file is present in the respective installation folder, for example, in my computer it is in C:\NXP\S32DS.3.5\S32DS\software\PlatformSDK_S32XX_4_0_0\RTD\Mcl_TS_T40D11M40I2R0\include, if you are not sure of your installation path you can run this PowerShell command in the C:\NXP\ directory and it will find the file path if exist, for example:
PS C:\NXP> gci -r -fi Mcl_Types.h
Directory: C:\NXP\S32DS.3.5\S32DS\software\PlatformSDK_S32XX_4_0_0\RTD\Mcl_TS_T40D11M40I2R0\include
Mode LastWriteTime Length Name
---- ------------- ------ ----
-a---- 11/10/2024 03:43 p. m. 14462 Mcl_Types.h
If you are able to find the file please check that you have added the corresponding module in the peripherals view:
After adding it you should update the code.
If you cannot find the file with the PowerShell command mentioned please re install your RTDs and search for the file again.
If nothing of the above solved the problem please send me a screenshot like the following, showing your include paths:
Let me know if this information was useful.
Hi @alejandro_e ,
Thank you for your quick response and support; I really appreciate it.
I can confirm that the Mcl_Types.h header file is present in both C:\NXP\S32DS.3.5\S32DS\software\PlatformSDK_S32XX_4_0_0\RTD\Mcl_TS_T40D11M40I2R0\include and C:\NXP\SW32G_RTD_4.4_4.0.2\eclipse\plugins\Mcl_TS_T40D11M40I2R0\include. However, according to the instructions and the README file, the build process requires running the make command in the 'PFE-DRV_S32G_M7_MCAL_1.4.0\example_application' directory using Cygwin.
I am unsure how to include this header file in the build process. I suspect I may have missed something in the Makefile or project_parameters.mk files. Could you please advise?
Thanks,
XD
Hello @XD,
Thanks for the information. Can you confirm that the file is present in your project folder? you can use the same method I mentioned before.
Hi @alejandro_e ,
Thank you for your response, no, I cannot find that file in the PFE project
AzureAD@SF-X /cygdrive/c/Users/XiaodongHu/Downloads/PFE-DRV_S32G_M7_MCAL_1.4.0/example_application
$ find . -name Mcl_Types.h
AzureAD@SF-X /cygdrive/c/Users/XiaodongHu/Downloads/PFE-DRV_S32G_M7_MCAL_1.4.0/example_application
Thanks,
XD
Hi @alejandro_e ,
Sure, the file is attached. The .mk file type is not supported, I change it to a txt file.
Thanks,
XD
Hello @XD,
Sorry for de delay, I am also having trouble building the application. I will reach out to the internal team an come with an update. I appreciate your patience.
Best regards,
Alejandro
Hello @XD,
Have you copied all RTD plugins from S32DS installation path to the Tresos installation path? Now that I checked again the paths in which you have the problematic. Using my paths as an example, this would mean:
all files from: C:\NXP\S32DS.3.5\S32DS\software\PlatformSDK_S32XX_4_0_0\RTD
Copied into: C:\EB\tresos\plugins
Please not that depending on the module you may also need to copy the files from directories like:
C:\NXP\S32DS.3.5\S32DS\software\PlatformSDK_S32XX_4_0_0\LLCE
C:\NXP\S32DS.3.5\S32DS\software\PlatformSDK_S32XX_4_0_0\SEC_CRYPTO
Let me know the result of the test.
Hi @alejandro_e ,
Thank you for looking into this issue.
I wasn’t aware that all plugins from RTD needed to be copied to EB, as I didn’t see that step mentioned in the instructions. However, I have now completed that step and noticed some differences, but I am still encountering a missing file issue.
This time, the compiler is reporting that "EthIf_Cbk.h" is missing. I’ve verified that this file exists in C:\NXP\SW32G_RTD_4.4_4.0.2\eclipse\plugins\EthIf_TS_T40D11M40I2R0, and I have already copied all plugins from RTD to EB.
Did you encounter the same issue? Or any others changes I need to make in Makefile or project_parameters.mk to include the missing header file?
$ make
mkdir -p output_RDB3
CC C:/EB/tresos/plugins/Eth_43_PFE_TS_T40D11M14I0R0/src/Eth_43_PFE.c
CC C:/EB/tresos/plugins/Eth_43_PFE_TS_T40D11M14I0R0/src/Eth_43_PFE_Irq.c
CC C:/EB/tresos/plugins/Eth_43_PFE_TS_T40D11M14I0R0/src/Eth_PFE_LLD.c
C:/EB/tresos/plugins/Eth_43_PFE_TS_T40D11M14I0R0/src/Eth_PFE_LLD.c:67:10: fatal error: EthIf_Cbk.h: No such file or directory
67 | #include "EthIf_Cbk.h" /* EthIf callbacks to be called from Eth driver */
| ^~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:690: output_RDB3/Eth_PFE_LLD.o] Error 1
Thanks,
XD
Have you imported the project into Tresos Studio before compiling in the terminal?
Please import it as follows:
File -> import
Select "Browse..."
Select the MasterProject_RDB3
Click finish (avoid selecting the "Copy projects into workspace" option):
Now right click in the "someId" title, and select "Load Configuration":
Now verify your project, after it finishes you should see no errors:
Now generate the project:
Now you can run make build in the project directory.
Also please define the FW_DIR variable in the project_parameters.mk which should look something like the following: FW_DIR ?= C:/NXP/PFE-FW_S32G_1.7.0
Please let me know the result after using this method. Also, if you encounter problems of missing files, check if they were correctly copied into the tresos/plugins directory by running the command we have being using.
Hi @alejandro_e ,
Apologies for the delayed response; it was due to the holiday break.
I had previously imported the project, but I decided to re-import it. After importing the project again, I encountered some errors during the "Verify Project" step, as shown in the attached screenshot. The errors primarily indicate missing parameters for the buildfile and failed generator runs for some modules. However, I double-checked and confirmed that the required modules are present in the EB plugins folder. These errors don't seem to affect the code generation process since I can generate the project without any issues.
I then copied the generated files (including the include, output, and src folders) to the pfe_example_application folder. I also updated the project_parameters.mk file as you suggested, setting the path:
FW_DIR ?= C:/Users/XD/Downloads/PFE-DRV_S32G_M7_MCAL_1.4.0/example_application/pfe_firmware.
However, I still encountered a missing file error during compilation:
$ make
mkdir -p output_RDB3
CC C:/EB/tresos/plugins/Eth_43_PFE_TS_T40D11M14I0R0/src/Eth_43_PFE.c
C:/EB/tresos/plugins/Eth_43_PFE_TS_T40D11M14I0R0/src/Eth_43_PFE.c:54:10: fatal error: pfe_cfg.h: No such file or directory
54 | #include "pfe_cfg.h"
| ^~~~~~~~~~~
compilation terminated.
make: *** [Makefile:690: output_RDB3/Eth_43_PFE.o] Error 1
The missing file, pfe_cfg.h, is located at:
C:\EB\tresos\plugins\Eth_43_PFE_TS_T40D11M14I0R0\generate\include.
It seems to be an auto-generated header file, but the compiler is not including this path. Could you advise on how to resolve this issue?
Thank you for your assistance.
XD
Hello @XD ,
Try following these steps:
path=C:/NXP/SW32G_RTD_4.4_4.0.2_HF03
#The path to the compiler instalation dir
GHS_DIR ?= c:/ghs/comp_202014
GCC_DIR ?= C:/NXP/S32DS.3.5/S32DS/build_tools/gcc_v9.2/gcc-9.2-arm32-eabi
DIAB_DIR ?= c:/WindRiver/compilers/diab-7.0.3.0
#The path to the Tresos plugins directory
TRESOS_DIR ?= C:/EB/tresos
PLUGINS_DIR ?= C:/NXP/SW32G_RTD_4.4_4.0.2_HF03/eclipse/plugins
TRESOS_WORKSPACE_DIR ?= $(TRESOS_DIR)/workspace
FW_DIR ?= pfe_firmware
LWIP_DIR ?= ../lwip
In my case, I had some issues with the Linker. Errors such as this one appeared:
c:/nxp/s32ds.3.5/s32ds/build_tools/gcc_v9.2/gcc-9.2-arm32-eabi/bin/../lib/gcc/arm-none-eabi/9.2.0/../../../../arm-none-eabi/bin/real-ld.exe: output_RDB3/startup_cm7.o: in function `_core_loop':
(.core_loop+0x0): multiple definition of `_core_loop'; output_RDB3/startup_cm7.o:(.core_loop+0x0): first defined here
If it happens from your side, delete the contents of the files
C:/NXP/SW32G_RTD_4.4_4.0.2_HF03/eclipse/plugins/Platform_TS_T40D11M40I2R0/startup/src/m7/gcc/startup_cm7.s
and
C:/NXP/SW32G_RTD_4.4_4.0.2_HF03/eclipse/plugins/Platform_TS_T40D11M40I2R0/startup/src/m7/gcc/Vector_Table.s
Then run the build the command again.
If everything goes well, the ELF file shall be generated inside the output_RDB3 folder.
Best regards,
Guilherme
Hi @GuilhermeS32G ,
Thank you for your help again.
I followed your instructions and modified the project_parameter.mk file to point PLUGINS_DIR to my RDT plugins. However, I encountered some issues again.
The first issue was a missing 'EthIf_Cbk.h' file. I printed the $(INCLUDE_DIRS) from the Makefile and noticed that the EthIf_TS_T40D11M40I2R0 folder was not included. To resolve this, I manually added it to the include paths, which fixed the 'EthIf_Cbk.h' missing issue.
INCLUDE_DIRS += $(PFE_INCLUDE_DIRS) \
$(GDIR)/include \
$(PLUGINS_DIR)/Mcl_$(AR_MCAL_PKG_NAME)/include \
$(PLUGINS_DIR)/EthTrcv_$(AR_MCAL_PKG_NAME)/include \
$(PLUGINS_DIR)/EthIf_$(AR_MCAL_PKG_NAME)/include \
$(PLUGINS_DIR)/BaseNXP_$(AR_MCAL_PKG_NAME)/header \
However, I then encountered another missing file: 'Tm.h'. This time, I couldn’t find the file anywhere—not in the RDT folder nor in the DS32 folder. Based on the source code, it appears to be related to AUTOSAR. I’m unsure if I am missing any additional packages that need to be pre-installed.
CC C:/NXP/SW32G_RTD_4.4_4.0.2/eclipse/plugins/Eth_43_PFE_TS_T40D11M14I0R0/src/oal_time_autosar.c
C:/NXP/SW32G_RTD_4.4_4.0.2/eclipse/plugins/Eth_43_PFE_TS_T40D11M14I0R0/src/oal_time_autosar.c:44:10: fatal error: Tm.h: No such file or directory
44 | #include "Tm.h" /* AUTOSAR Time Service */
| ^~~~~~
compilation terminated.
make: *** [Makefile:692: output_RDB3/oal_time_autosar.o] Error 1
Thanks,
XD
Thanks for helping again @GuilhermeS32G!
about your description @XD, are you copying the files into workspace when importing the project? if so, please avoid doing it, as mentioned by @GuilhermeS32G, you should enter the folder of your project in the terminal and then generate and build in the same folder.
It is not necessary to point to the S32DS plugins, I generally copy them to the tresos folder (as mentioned before) and it has the same effect, the important part is to correctly point them in the project_parameters.mk.
Do any of the paths used in your project, either in the tresos installation or the project location, have spaces in the name? if so, please change the project location to one without spaces, this has caused me several problems in the past.
Another suggestion I can give you is to use the latest version of the PFE MCAL driver and example, which is 1.5.0, this will require to use RTD 5.0.0, this version should cause less problems when generating and compiling. If you decide to follow this step, please consider that having more than one RTD version in S32DS is extremely problematic. You can install a new instance of S32DS in another folder, for example C:/NXP_2/, to avoid modifying your current installation.
Let me know if the information I shared proved useful.
Hi @alejandro_e ,
Thank you for your suggestions. Unfortunately, upgrading to RTD 5.0.0 is not an option for me, as it would prevent others from importing my project unless everyone upgrades to the same version.
I have reviewed the missing file, and the header content appears to be abnormal. Below is a snippet of the pfe_cfg.h file located at:
C:\NXP\SW32G_RTD_4.4_4.0.2\eclipse\plugins\Eth_43_PFE_TS_T40D11M14I0R0\generate\include.
This file is required by:
C:/EB/tresos/plugins/Eth_43_PFE_TS_T40D11M14I0R0/src/Eth_43_PFE.c.
It seems that this file cannot be compiled as-is. Could you please check on your end if you are experiencing the same issue?
A similar problem occurs with the header files in:
C:\EB\tresos\plugins\BaseNXP_TS_T40D11M40I2R0\generate_PC\include\PlatformTypes.h.
I’m unsure whether something in my file system has been corrupted. Your assistance in verifying this would be greatly appreciated.
[!NOCODE!][!//
[!INCLUDE "Eth_43_PFE_GetPfeParameters.m"!][!// Macros for hif interrupt
[!ENDNOCODE!][!//
/**
* @file pfe_cfg.h
* @brief PFE driver configuration file
* @details This file needs to be included in all PFE sources before any other.
* PFE include. It contains macros specifying: target hardware, target OS,
* enabled features, and highlevel driver configuration.
*/
#ifndef PFE_CFG_H
#define PFE_CFG_H
/*==================================================================================================
* FILE VERSION CHECK
==================================================================================================*/
#ifdef PFE_SRC_VERSION_CHECK
#if (PFE_SRC_VERSION_CHECK != 43140440)
#error "This header file was included from incompatible source file (different SW version)"
#endif
#else
#define PFE_SRC_VERSION_CHECK 43140440
#endif
#define PFE_CFG_TARGET_OS_AUTOSAR
#define PFE_CFG_TARGET_ARCH_armv7le
/* PFE_CFG_PFE_MASTER || PFE_CFG_PFE_SLAVE */
[!IF "EthGeneral/EthVendorSpecific/EthPfeMultiInstance = 'true' and EthGeneral/EthVendorSpecific/EthPfeSlaveMode = 'true'"!][!//
#define PFE_CFG_PFE_SLAVE
[!IF "node:exists(EthGeneral/EthVendorSpecific/EthSlaveHifMasterUpTimeout)"!][!//
#define PFE_CFG_SLAVE_HIF_MASTER_UP_TMOUT ((uint32)([!"num:i(EthGeneral/EthVendorSpecific/EthSlaveHifMasterUpTimeout)"!]U))
[!ELSE!][!//
#define PFE_CFG_SLAVE_HIF_MASTER_UP_TMOUT ((uint32)0U)
Thanks,
XD
Hello @XD,
Does this problem occur when executing make generate or make build?
if they occur when executing make build, the problem could be that there is a generation problem, files under .../generate/ directories are not exactly header files, as you can see in the pfe_cfg.h, they have a specific syntaxis . Those files are used to generate a proper header file, therefore if there is a problem when executing make generate you won't be able to execute make build correctly.
if the problem is present when using make generate, please share the output of the terminal so I can review the errors.
Best regards
Hi @alejandro_e ,
This issue occurred during the build process(make build). The pfe_cfg.h file is part of the MCAL 1.4.0 ZIP package and is located in the PFE-DRV_S32G_M7_MCAL_1.4.0\eclipse\plugins\Eth_43_PFE_TS_T40D11M14I0R0\generate\include folder. I’ve attached a screenshot and the folder structure of the ZIP file's plugins directory, which includes the generate and generate_swcd folders.
The source file Eth_43_PFE.c references this header file on line 54, and it appears to be the only pfe_cfg.h file available. I modified the Makefile to include the path to the generate/include folder, but unfortunately, this file doesn’t seem to behave as a typical header file. I'm uncertain whether the Eth_43_PFE.c in your source code is expecting this same header file.
This is missing head file
$ make build
mkdir -p output_RDB3
CC C:/EB/tresos/plugins/Eth_43_PFE_TS_T40D11M14I0R0/src/Eth_43_PFE.c
C:/EB/tresos/plugins/Eth_43_PFE_TS_T40D11M14I0R0/src/Eth_43_PFE.c:54:10: fatal error: pfe_cfg.h: No such file or directory
54 | #include "pfe_cfg.h"
| ^~~~~~~~~~~
compilation terminated.
make: *** [Makefile:691: output_RDB3/Eth_43_PFE.o] Error 1
this is after adding that header file
$ make
CC C:/EB/tresos/plugins/Eth_43_PFE_TS_T40D11M14I0R0/src/Eth_43_PFE.c
In file included from C:/EB/tresos/plugins/Eth_43_PFE_TS_T40D11M14I0R0/src/Eth_43_PFE.c:54:
C:/EB/tresos/plugins/Eth_43_PFE_TS_T40D11M14I0R0/generate/include/pfe_cfg.h:25:1: error: expected identifier or '(' before '[' token
25 | [!NOCODE!][!//
| ^
In file included from C:/EB/tresos/plugins/Eth_43_PFE_TS_T40D11M14I0R0/src/Eth_43_PFE.c:54:
C:/EB/tresos/plugins/Eth_43_PFE_TS_T40D11M14I0R0/generate/include/pfe_cfg.h:58: error: "PFE_CFG_SLAVE_HIF_MASTER_UP_TMOUT" redefined [-Werror]
58 | #define PFE_CFG_SLAVE_HIF_MASTER_UP_TMOUT ((uint32)0U)
|
C:/EB/tresos/plugins/Eth_43_PFE_TS_T40D11M14I0R0/generate/include/pfe_cfg.h:56: note: this is the location of the previous definition
56 | #define PFE_CFG_SLAVE_HIF_MASTER_UP_TMOUT ((uint32)([!"num:i(EthGeneral/EthVendorSpecific/EthSlaveHifMasterUpTimeout)"!]U))
|
C:/EB/tresos/plugins/Eth_43_PFE_TS_T40D11M14I0R0/generate/include/pfe_cfg.h:63: error: "PFE_CFG_SLAVE_READ_EMAC_STAT_CNT_DIRECT" redefined [-Werror]
63 | #define PFE_CFG_SLAVE_READ_EMAC_STAT_CNT_DIRECT FALSE
|
C:/EB/tresos/plugins/Eth_43_PFE_TS_T40D11M14I0R0/generate/include/pfe_cfg.h:61: note: this is the location of the previous definition
61 | #define PFE_CFG_SLAVE_READ_EMAC_STAT_CNT_DIRECT TRUE
|
C:/EB/tresos/plugins/Eth_43_PFE_TS_T40D11M14I0R0/generate/include/pfe_cfg.h:82: error: "PFE_CFG_HIF_IRQ_ENABLED" redefined [-Werror]
82 | #define PFE_CFG_HIF_IRQ_ENABLED FALSE
Thanks,
XD
hello @XD,
can you share the output of the command "make generate"? To check if there are generation errors. As I mentioned, the files inside generate/ directories are not exactly header files , they are use to generate the header files with the same name, therefore you cannot include them in your makefile.
Thanks
Hello again @XD,
After a closer look to the Release notes present on the PFE-DRV_S32G_M7_MCAL_1.4.0 directory, I notice that the RTD version I was using is incorrect. Although the Release notes indicate version 4.0.2, it needs to be an specific version:
In FlexNet this translates to version S32 Real-Time Drivers Version 4.0.2, without any patch or hotfix. You can download the SW32G_RTD_4.4_4.0.2_D2306.exe extract the files in any convenient folder (avoid using the default C:/NXP/ to avoid multiple RTDs in S32DS) once extracted you can copy the files into the C:/EB/tresos/plugins/ directory (first remove all the old drivers, they have the suffix ...TS_T40D11M40I2R0). now you should be able to run:
make clean ; make generate ; make build
without any problems.
Please let me know if this solved your problem.