MKM34Z256VLx7 Bare Metal Software Drivers  R4.1.6
Reference Manual
AIPS Example

This example shows typical use of the Peripheral Bridge (AIPS) module to manage all bus master transactions ("bus cycles") destined for the attached slave devices. The Peripheral Bridge (AIPS) is programmable only in privileged secure mode. Each peripheral slot supports read and write protection definition for bus masters and privileged secure and user secure/non-secure modes.

The software example demonstrates LPTMR slot being configured for read and write access from software running in privileged secure mode only. Therefore any attempts to access LPTMR registers from software running either in user secure or user non-secure modes are not allowed and generate Hard Fault.

Source code:
/******************************************************************************
* (c) Copyright 2010-2015, Freescale Semiconductor Inc.
* ALL RIGHTS RESERVED.
******************************************************************************
* aips_test.c
******************************************************************************/
#include "drivers.h"
volatile int16 counter;
void main (void)
{
/* enable clock to all peripherals */
/* set bus masters attribute to be controlled internally by the core */
TRUE);
/* set LPTMR slot for RW access from privileged secure mode - slot opened */
while(1)
{
counter = LPTMR_ReadCnt(); /* executes in privileged mode */
counter = LPTMR_ReadCnt(); /* hangs up in user mode */
}
}
Toolchain support:
IAR EWARM 7.40.7KEIL uVision 5.15CrossWorks 3.6ATOLLIC TrueStudio 5.3.0Kinetis Design Studio 3.0.0