The PIL Sample is an ARM project that has a single input and output that emulates a door warning when a door open is detected.
When working with the sample, we recommend that you use the Checkpoints.
Click here to download the project: https://github.com/DanlawMxTeam/Samples/raw/master/PiL.rar
You can see the file structure of the sample project here:

It contains two MxVDev projects (MxV.mxp and MxVMakefile.mxp) both pointing to S32K144 ARM chip code in the subdirectory ARMDemo. The MxV.mxp project is configured to build the source code in ARMDemo via the NXP S32 Design Studio. It is set to compile using the GCC bare metal 6.3 compiler. The project builds directly through eclipse. The MxVMakefile.mxp project points to a build that uses the make system and a hand generated Makefile. See ARMDemoMakefile for the Makefile that is used.
The user source code to be tested is available in this folder along with hardware dependent code (the linker file (.ld) and startup code). The MxV‑Dev wrapper code (to setup communication with MxSuite to target), TRACE32 configuration(.ts2), and script (.cmm) files are also available in the same folder.
This basic algorithm is defined in the following files:
1.DoorOpenMonitor The Green LED glows at initialization. The Tick function gets called with a periodic scheduler. The Red LED glows when ‘Door_Open’ is set, which also updates the warning status to ‘Door_Open_Warning’.

2.Ledfuncs This defines the functions which set/reset the register to turn on/off the LEDs.

|
This project calls the Init function at start up, calls the Tick function with a periodic scheduler and while ticking, set the ‘Door_Open’ and see the simulation results such as ‘Door_Open_Warning’ status and monitor led color on the target.
1.AppIF.c InIt and Tick functions of DoorOpenMonitor invoked from here in SUT_Init and SUT_Tick functions, which gets called from ‘MxNet_Target’ code.

Note: MxNet_Target.c is provided by MxSuite which is available in Mxsuite installation directory.
2. AppIF.h
The I/O’s (Door_Open, Door_Open_Warning) identified in the objectives are being configured here in this file. MxNet_Target (MxSuite wrapper code) can read these configurations and locate the memory addresses on target and establishes communications.

|
1.Simulator.cmm – TRACE32 reads this script to load and run executable (.elf) as virtual target. 2.Debugger.cmm – TRACE32 reads this script to flash and run the executable (.elf) on real target. More details on PRACTICE script language described here at http://www2.lauterbach.com/pdf/practice_user.pdf
|
1.Simulator.ts2 – This TRACE32 configuration file has references to the Simulator script file. It is used only if the Simulation Mode property is set to Simulator as shown below: 
2.Debugger.ts2 – This TRACE32 configuration file has references to the Debugger script file. It is used only if the Simulation Mode property is set to Debugger. |
|
|
The whole process can be summarized in this diagram:

When you open the MxV.mxp project, the PiL Transform invokes the Build verb (as highlighted below), which invokes the NXP S32 Design Studio Eclipse project (ARMDemo) and generates an executable (ARMDemo.elf) file.

In addition, it starts a TRACE 32 instance, which runs the executable on the virtual target or on a real target.
|
|
|
To run the project, open the Default Scenario and click the green arrow to run the Scenario. This Scenario is designed to pass.
|
Related Topics:
PIL
Checkpoints
FAQs
MxSuite Sample Projects