This example implements a multi-rate cooperative scheduler on the S32K358 (Cortex-M7) using the RTD AUTOSAR 4.9 drivers on a shared eMIOS_1 counter bus. A GPT channel generates a 1 ms tick that releases 10 ms, 100 ms and 1000 ms tasks, while an eMIOS SAOC (OCU) compare event provides hardware-assisted deadline supervision for the 10 ms task; the 100 ms and 1000 ms tasks are supervised in software. A demo load-injection mode (auto-toggled every 5 s) forces deadline overruns, and a status report is sent over UART every second. The on-board RGB LED shows the state: GREEN = normal, BLUE = load injection, RED = missed deadline.
This example was developed using the FRDM Automotive Bundle for S32K3 + S32M27. To download and install the complete software and tools ecosystem, use the following link:
- Type-C USB cable
- Personal Computer
- FRDM-A-S32K358
-
Open S32 Design Studio IDE. In the Dashboard Panel, choose Import project from Application Code Hub.
-
Find the demo by searching: dm-persistent-settings-s32k358
-
Open the project, click the GitHub link, S32 Design Studio IDE will automatically retrieve project attributes, then click Next>.
-
Select main branch and then click Next>.
-
Select your local path for the repo in the Destination->Directory: window. The S32 Design Studio IDE will clone the repo into this path, click Next>.
-
Select Import existing Eclipse projects then click Next>.
-
Select the project in this repo (only one project in this repo) then click Finish.
-
In Project Explorer, right-click the project and select Update Code and Build Project. This will generate the configuration (Pins, Clocks, Peripherals), update the source code and build the project using the active configuration (e.g. Debug_FLASH). Make sure the build completes successfully and the *.elf file is generated without errors.
Press Yes in the SDK Component Management pop-up window to continue. -
Go to Debug and select Debug Configurations. There will be a debug configuration for this project:
Configuration Name Description ------------------------------- ----------------------- $(example)_debug_flash_pemicro Debug the FLASH configuration using PEmicro probeSelect the desired debug configuration and click on Debug. Now the perspective will change to the Debug Perspective. Use the controls to control the program flow.
Once the application is flashed and running, open a serial terminal on the board's console UART to observe the scheduler in action.
After the welcoming banner is shown a status report is transmitted every second summarizing the scheduler activity.
During normal operation all tasks complete well within their deadlines and no misses are recorded:
Scheduler Report
----------------
10ms Executions : 100
100ms Executions : 10
1000ms Executions: 1
Missed Deadlines : 0 (0)
CPU Load Mode : OFF
Every 5 seconds the demo automatically toggles into load injection mode, artificially stressing the 10 ms task until it overruns its deadline. The hardware-assisted eMIOS SAOC compare event detects the overrun and the missed-deadline counter starts incrementing:
Scheduler Report
----------------
10ms Executions : 200
100ms Executions : 20
1000ms Executions: 2
Missed Deadlines : 8 (8)
CPU Load Mode : ON
The first number in the Missed Deadlines field is the count of new misses since the previous report, while the number in parentheses is the running total since startup.
The on-board RGB LEDs give an at-a-glance visual indication of the current state:
| LED Color | Meaning |
|---|---|
| USERLED0 GREEN | Normal mode - all tasks meeting deadlines |
| USERLED0 BLUE | Load injection mode active |
| USERLED1 RED | GPT Timer ticks |
This demonstrates a multi-rate cooperative scheduler releasing tasks at 10 ms, 100 ms and 1000 ms rates from a single shared time base, with the fastest (and most timing-critical) task under hardware-assisted deadline supervision, while the slower tasks rely on software period checks. The automatic mode toggling makes it easy to observe both the nominal behavior and the deadline-miss detection without requiring any user interaction.
For general technical questions related to NXP microcontrollers, please use the NXP Community Forum.
Questions regarding the content/correctness of this example can be entered as Issues within this GitHub repository.
Note: For more general technical questions regarding NXP Microcontrollers and differences in expected functionality, enter your questions on the NXP Community Forum
| Version | Description / Update | Date |
|---|---|---|
| 1.0 | Initial release on Application Code Hub | October 1st, 2026 |




