Help with AUTOSAR OS running on MPC5748G

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

Help with AUTOSAR OS running on MPC5748G

Jump to solution
4,284 Views
DannyAtFTECU
Contributor II

Does anyone have a working example of AUTOSAR OS version with MCAL 4.0.3 running on MPC5748G successfully?

Our understanding was that by buying the MPC5748G eval board (LCEVB) and appropriate compiler/debugger suite (we chose GHS MULTI compiler/debugger probe), we can build, configure and run AUTOSAR OS with the files provided by NXP.

We're able to get non-OS version of AUTOSAR MCAL (MPC574XG_CALYPSO_MCAL4_0_RTM_HF3_1_0_5 ) example running on MPC5748G-LCEVB but are having hard time getting the OS version to run on it.  We have been struggling for the past month but the example project fails to build using the provided Makefile, and the only working project available publicly that we could find is https://gitlab.com/alberand/PIL-AutosarOS which uses EB Studio 21.0.0 -- not the EB Studio 14.2.1 provided by NXP.  And trying to configure for multi-core brings up errors which I am not sure how to fix.  At least I couldn’t find any how to guide (like https://www.nxp.com/docs/en/supporting-information/ftf-acc-F1243.pdf) to setup multi-core correctly.

We are looking for examples to fully utilize MPC5748G via AUTOSAR:

  1. AUTOSAR OS + MCAL working example on a single core using EB Studio 14.2.1. 
  2. Same combo but working on the 2 (e200z4) cores including an example usage of IOC.
  3. Bonus would be an example of 3rd core (e200z2) running non-AUTOSAR software.

Since we originally (and successfully) started learning to program MCP5748G with https://www.nxp.com/webapp/Download?colCode=MPC5748G-LCEVB_QSP , similar working examples for AUTOSAR (like the SPI’s are configured DSPI_0 as master and SPI_4 as slave) is not an unreasonable expectation, and would make transitioning from bare metal to AUTOSAR less frustrating.

Thanks in advance.

0 Kudos
Reply
1 Solution
4,259 Views
frantisekdobes
NXP Employee
NXP Employee

Hello,

the NXP Autosar OS release MPC574xG_AUTOSAR_OS_4_0_92_RTM_1_0_3 contains examples in the following folder:
c:\NXP\AUTOSAR\MPC574xG_AUTOSAR_OS_4_0_92_RTM_1_0_3\sample\standard
There are examples for different scalability classes, including single core, multicore and also showing usage of IOC. The detailed information about the examples plus step by step procedures how to build them is available as part of the release in this file:
c:\NXP\AUTOSAR\MPC574xG_AUTOSAR_OS_4_0_92_RTM_1_0_3\sample\standard\readme.txt

For multicore you can use core parameter (here Calypso6M refers to MPC5748G while Calypso3M is MPC5746C):
core - select MCU core(s) to be controlled by the OS
    master or master_0 - the single-core OS is configured to be started on core Z4A (on Calypso 6M)
    master_1 - the single-core OS is configured to be started on core Z2 (on Calypso 3M)
    master_2 - the single-core OS is configured to be started on core Z2 (on Calypso 6M)
    both or both_0_2 - the multi-core OS is configured to be started on cores Z4A and Z2 (on Calypso  6M)
    both or both_0_1 - the multi-core OS is configured to be started on cores Z4A and Z2 (on Calypso 3M)
    both_0_1 - the multi-core OS is configured to be started on cores Z4A and Z4B (on Calypso 6M)

For example to build multicore example (using z4a and z4b) you can use the following command:
make compiler=ghsppc debug=yes core=both_0_1

I tested it right now on DEVKIT board (on LCEVB board it should run as well as it also contains MPC5748G, but let me know if it would not work).

 

Regarding the Autosar OS + MCAL example, there is an example available in MPC574XG_MCAL4_0_RTM_1_0_5 release in this folder:
c:\NXP\AUTOSAR\MPC574XG_MCAL4_0_RTM_1_0_5\MPC574XG_MCAL4_0_RTM_1_0_5_Sample_Application
This example is for MPC5746C so there are some steps needed to update it for MPC5748G. Here are the steps:

  • Update preferences.xdm (c:\NXP\AUTOSAR\MPC574XG_MCAL4_0_RTM_1_0_5\MPC574XG_MCAL4_0_RTM_1_0_5_Sample_Application\Tresos\workspace\MCAL_SampleApplication\.prefs\preferences.xdm) as follows:
    replace all _TS_T2D35M10I3R0 to TS_T2D35M10I5R0
    o replace all 1.0.3 RTM to 1.0.5 RTM
    o replace Os_TS_T2D35M4I0R88 to Os_TS_T2D35M4I0R92
    o replace 4.0.88 to 4.0.92
    (this step is also described in this community thread https://community.nxp.com/t5/MPC5xxx/MPC574XG-MCAL4-0-issue/td-p/918227)
  • copy autosar_flash.ld (c:\NXP\AUTOSAR\MPC574XG_MCAL4_0_RTM_1_0_5\MPC574XG_MCAL4_0_RTM_1_0_5_Sample_Application\toolchains\autosar_flash.ld) file to c:\NXP\AUTOSAR\MPC574XG_MCAL4_0_RTM_1_0_5\MPC574XG_MCAL4_0_RTM_1_0_5_Sample_Application\Tresos folder and rename it to sample3_flash.ld
  • open the Tresos project and reconfigure the project from mpc5746c to mpc5748g (in resource module change mpc5746c_lqfp176 to mpc5748g_lqfp176)
  • Update the Mcu driver configuration, container McuPeripheral adding the peripherals available on MPC5748G
  • Update the MCU driver configuration, container McuCoreConfiguration to disable z4b and z2 cores in DRUN mode
  • Update OS configuration os1->OsTargetMCU to be MPC5748G (instead of MPC5746C), update system timer configuration
  • Generate in Tresos
  • Copy the generated files to cfg folder
  • update paths in launch.bat to reflect your environment
  • open command prompt in the sample app (c:\NXP\AUTOSAR\MPC574XG_MCAL4_0_RTM_1_0_5\MPC574XG_MCAL4_0_RTM_1_0_5_Sample_Application) and run this command to build:
    launch OS TOOLCHAIN=ghs
  • after building the executable elf file is created in bin folder and it can be executed on EVB (I tested with DEVKIT board but it should work also on LCEVB)

You can find attached the modified Mcu, Os and Resource configurations.

The MPC574XG_MCAL4_0_RTM_1_0_5_Sample_Application also contains example for DSPI_0 in master mode.

Best Regards,

Frantisek

View solution in original post

0 Kudos
Reply
4 Replies
4,260 Views
frantisekdobes
NXP Employee
NXP Employee

Hello,

the NXP Autosar OS release MPC574xG_AUTOSAR_OS_4_0_92_RTM_1_0_3 contains examples in the following folder:
c:\NXP\AUTOSAR\MPC574xG_AUTOSAR_OS_4_0_92_RTM_1_0_3\sample\standard
There are examples for different scalability classes, including single core, multicore and also showing usage of IOC. The detailed information about the examples plus step by step procedures how to build them is available as part of the release in this file:
c:\NXP\AUTOSAR\MPC574xG_AUTOSAR_OS_4_0_92_RTM_1_0_3\sample\standard\readme.txt

For multicore you can use core parameter (here Calypso6M refers to MPC5748G while Calypso3M is MPC5746C):
core - select MCU core(s) to be controlled by the OS
    master or master_0 - the single-core OS is configured to be started on core Z4A (on Calypso 6M)
    master_1 - the single-core OS is configured to be started on core Z2 (on Calypso 3M)
    master_2 - the single-core OS is configured to be started on core Z2 (on Calypso 6M)
    both or both_0_2 - the multi-core OS is configured to be started on cores Z4A and Z2 (on Calypso  6M)
    both or both_0_1 - the multi-core OS is configured to be started on cores Z4A and Z2 (on Calypso 3M)
    both_0_1 - the multi-core OS is configured to be started on cores Z4A and Z4B (on Calypso 6M)

For example to build multicore example (using z4a and z4b) you can use the following command:
make compiler=ghsppc debug=yes core=both_0_1

I tested it right now on DEVKIT board (on LCEVB board it should run as well as it also contains MPC5748G, but let me know if it would not work).

 

Regarding the Autosar OS + MCAL example, there is an example available in MPC574XG_MCAL4_0_RTM_1_0_5 release in this folder:
c:\NXP\AUTOSAR\MPC574XG_MCAL4_0_RTM_1_0_5\MPC574XG_MCAL4_0_RTM_1_0_5_Sample_Application
This example is for MPC5746C so there are some steps needed to update it for MPC5748G. Here are the steps:

  • Update preferences.xdm (c:\NXP\AUTOSAR\MPC574XG_MCAL4_0_RTM_1_0_5\MPC574XG_MCAL4_0_RTM_1_0_5_Sample_Application\Tresos\workspace\MCAL_SampleApplication\.prefs\preferences.xdm) as follows:
    replace all _TS_T2D35M10I3R0 to TS_T2D35M10I5R0
    o replace all 1.0.3 RTM to 1.0.5 RTM
    o replace Os_TS_T2D35M4I0R88 to Os_TS_T2D35M4I0R92
    o replace 4.0.88 to 4.0.92
    (this step is also described in this community thread https://community.nxp.com/t5/MPC5xxx/MPC574XG-MCAL4-0-issue/td-p/918227)
  • copy autosar_flash.ld (c:\NXP\AUTOSAR\MPC574XG_MCAL4_0_RTM_1_0_5\MPC574XG_MCAL4_0_RTM_1_0_5_Sample_Application\toolchains\autosar_flash.ld) file to c:\NXP\AUTOSAR\MPC574XG_MCAL4_0_RTM_1_0_5\MPC574XG_MCAL4_0_RTM_1_0_5_Sample_Application\Tresos folder and rename it to sample3_flash.ld
  • open the Tresos project and reconfigure the project from mpc5746c to mpc5748g (in resource module change mpc5746c_lqfp176 to mpc5748g_lqfp176)
  • Update the Mcu driver configuration, container McuPeripheral adding the peripherals available on MPC5748G
  • Update the MCU driver configuration, container McuCoreConfiguration to disable z4b and z2 cores in DRUN mode
  • Update OS configuration os1->OsTargetMCU to be MPC5748G (instead of MPC5746C), update system timer configuration
  • Generate in Tresos
  • Copy the generated files to cfg folder
  • update paths in launch.bat to reflect your environment
  • open command prompt in the sample app (c:\NXP\AUTOSAR\MPC574XG_MCAL4_0_RTM_1_0_5\MPC574XG_MCAL4_0_RTM_1_0_5_Sample_Application) and run this command to build:
    launch OS TOOLCHAIN=ghs
  • after building the executable elf file is created in bin folder and it can be executed on EVB (I tested with DEVKIT board but it should work also on LCEVB)

You can find attached the modified Mcu, Os and Resource configurations.

The MPC574XG_MCAL4_0_RTM_1_0_5_Sample_Application also contains example for DSPI_0 in master mode.

Best Regards,

Frantisek

0 Kudos
Reply
4,245 Views
DannyAtFTECU
Contributor II

Thank you for your prompt reply.  I tried it and here are my results.  I am running on Windows 10 with cygwin64 in the sc1 directory (I copied the sample directory into c:\tmp):

$ make --version
GNU Make 4.3
Built for x86_64-pc-cygwin
Copyright (C) 1988-2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
$ make compiler=ghsppc debug=yes core=both_0_1
Variable DBGDIR must be set
make: Variable: No such file or directory
make: *** [../common_rules.mak:60: tools_validation] Error 127

 

Since we don't have Lauterbach for debug, I turned off debug:


$ make compiler=ghsppc debug=no core=both_0_1
Processing C:\tmp\sample\standard\sc3\src\sample3_mc_both_0_1.oil
C:\NXP\AUTOSAR\MPC574xG_AUTOSAR_OS_4_0_92_RTM_1_0_3\ssc\bin\generator\sg.exe -cC:\tmp\sample\standard\sc3\output\obj\sample3_cfg.c -hC:\tmp\sample\standard\sc3\output\obj\sample3_cfg.h -oC:\tmp\sample\standard\sc3\output\bin\sample3_mc_both_0_1.ort -iC:\NXP\AUTOSAR\MPC574xG_AUTOSAR_OS_4_0_92_RTM_1_0_3\ssc\bin\generator -pC:\tmp\sample\standard\sc3\output\obj\Os_prop.h -LC:\tmp\sample\standard\sc3\lcf\sample3_flash.ld -MC:\tmp\sample\standard\sc3\output\obj\sample3.ld C:\tmp\sample\standard\sc3\src\sample3_mc_both_0_1.oil
warning 0109: arg length = 8
My path: C:\NXP\AUTOSAR\MPC574xG_AUTOSAR_OS_4_0_92_RTM_1_0_3\ssc\bin\generator\sg.exe
warning 0109: arg 0: -cC:\tmp\sample\standard\sc3\output\obj\sample3_cfg.c
warning 0109: arg 1: -hC:\tmp\sample\standard\sc3\output\obj\sample3_cfg.h
warning 0109: arg 2: -oC:\tmp\sample\standard\sc3\output\bin\sample3_mc_both_0_1.ort
warning 0109: arg 3: -iC:\NXP\AUTOSAR\MPC574xG_AUTOSAR_OS_4_0_92_RTM_1_0_3\ssc\bin\generator
warning 0109: arg 4: -pC:\tmp\sample\standard\sc3\output\obj\Os_prop.h
warning 0109: arg 5: -LC:\tmp\sample\standard\sc3\lcf\sample3_flash.ld
warning 0109: arg 6: -MC:\tmp\sample\standard\sc3\output\obj\sample3.ld
warning 0109: arg 7: C:\tmp\sample\standard\sc3\src\sample3_mc_both_0_1.oil
my exe C:\NXP\AUTOSAR\MPC574xG_AUTOSAR_OS_4_0_92_RTM_1_0_3\ssc\bin\generator\sg_orig.exe
System Generator for AUTOSAR OS/MPC574xG - Version 4.0.92
Freescale(TM) and the Freescale logo are trademarks of Freescale Semiconductor, Inc.
All other product or service names are the property of their respective owners.
(C) Freescale Semiconductor, Inc. 2017

error 3008: An input file shall be defined
1 error(s), 0 warning(s)


"C:\\tmp\\sample\\standard\\sc3\\output\\obj\\targetcheck.c", line 1: fatal error #2330:
cannot open source file
"C:\tmp\sample\standard\sc3\output\obj\Os_prop.h"
#include "C:\tmp\sample\standard\sc3\output\obj\Os_prop.h"
^
make: *** [../common_rules.mak:81: C:\tmp\sample\standard\sc3\output\obj\targetcheck_sample3.stamp] Error 1

 

 

Did I miss something or not configure correctly?  Thanks.

0 Kudos
Reply
4,240 Views
frantisekdobes
NXP Employee
NXP Employee

Thank you for more details. I have checked and we use exactly the same command line, also the call to sg.exe is exactly the same on my side. I also tried from the same path and not able to reproduce. Originally I was using the make.exe from NXP S32 Design Studio for Power Architecture (it is available from NXP web pages), after install it is available at c:\NXP\S32DS_Power_v2.1\S32DS\build_tools\msys32\usr\bin.

Today I tried to switch my environment also to cygwin and it works on my side (I'm using windows command prompt):
c:\tmp\sample\standard\sc3>path=c:\cygwin64\bin;%path%
c:\tmp\sample\standard\sc3>make --version
  GNU Make 4.3
  Built for x86_64-pc-cygwin
  Copyright (C) 1988-2020 Free Software Foundation, Inc.
  License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
  This is free software: you are free to change and redistribute it.
  There is NO WARRANTY, to the extent permitted by law.
c:\tmp\sample\standard\sc3>make compiler=ghsppc debug=no core=both_0_1

Processing C:\tmp\sample\standard\sc3\src\sample3_mc_both_0_1.oil
C:\NXP\AUTOSAR\MPC574xG_AUTOSAR_OS_4_0_92_RTM_1_0_3\ssc\bin\generator\sg.exe -cC:\tmp\sample\standard\sc3\output\obj\sample3_cfg.c -hC:\tmp\sample\standard\sc3\output\obj\sample3_cfg.h -oC:\tmp\sample\standard\sc3\output\bin\sample3_mc_both_0_1.ort -iC:\NXP\AUTOSAR\MPC574xG_AUTOSAR_OS_4_0_92_RTM_1_0_3\ssc\bin\generator -pC:\tmp\sample\standard\sc3\output\obj\Os_prop.h -LC:\tmp\sample\standard\sc3\lcf\sample3_flash.ld -MC:\tmp\sample\standard\sc3\output\obj\sample3.ld C:\tmp\sample\standard\sc3\src\sample3_mc_both_0_1.oil
System Generator for AUTOSAR OS/MPC574xG - Version 4.0.92
Freescale(TM) and the Freescale logo are trademarks of Freescale Semiconductor, Inc.
All other product or service names are the property of their respective owners.
(C) Freescale Semiconductor, Inc. 2017

C:\tmp\sample\standard\sc3\src\sample3_mc_both_0_1.oil - 0 error(s), 0 warning(s)

From your error log I see:
3008: An input file shall be defined
Error: The input OIL file cannot be found if it does not exist or there are no permissions to open the file or directory.

The path to oil file seems to be correct so I'm suspecting something with cygwin install or windows permissions but as I cannot reproduce it is difficult to say. You might try to use make.exe from S32 Design Studio to see whether it is caused by cygwin or not. 

Best Regards,

Frantisek

0 Kudos
Reply
4,203 Views
DannyAtFTECU
Contributor II

Thanks for your updates.  I've accepted your original reply as the solution since it worked for me.

Turns out that the errors you are seeing are of my doing (I was trying to debug sg.exe by creating a wrapper to print the parameters but the wrapper had a bug so it didn't pass the parameters correctly).  If sg.exe printed the problem parameter, it would have been clear what my bug was...

Again, thanks for your help!!

[I have a different problem but will open a new question...]

0 Kudos
Reply