Kinetis SDK v.1.2 Demo Applications User's Guide  Rev. 0
Freescale Semiconductor, Inc.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
driver_examples/mpu/main.c File Reference
#include <stdio.h>
#include "board.h"
#include "fsl_mpu_driver.h"
#include "fsl_debug_console.h"

Macros

#define MPU_INSTANCE
 
#define ARRAY_SIZE
 
#define CPU_REG_NVIC_SHCSR
 
#define CPU_REG_NVIC_SHCSR_BUSFAULTENA
 
#define CPU_REG_SCnSCB_ACTLR
 
#define CPU_REG_SCnSCB_ACTLR_DISDEFWBUF
 
#define ACTUAL_END_ADDR(x)
 
#define ACTUAL_START_ADDR(x)
 

Functions

void enable_busfault (void)
 The function is used to enable bus fault. More...
 
void disable_writebuffer (void)
 The function is used to disable write buffer. More...
 
void BusFault_Handler (void)
 BusFault IRQ Handler. More...
 
int main (void)
 MPU example defines protected/unprotected memory region from core The first and third memory region are configured to read/write/execute able. A second memory region is configured to be un-writeable, writing to it is to generate bus fault. In bus fault handler, the region is configured to writeable to allow writting. More...
 

Variables

mpu_user_config_t userConfig1
 
mpu_user_config_t userConfig2
 
mpu_user_config_t userConfig3
 
volatile bool busFaultFlag
 
volatile uint32_t regionArray [ARRAY_SIZE]
 
uint32_t cnt
 

Macro Definition Documentation

#define ACTUAL_END_ADDR (   x)
#define ACTUAL_START_ADDR (   x)
#define ARRAY_SIZE
#define CPU_REG_NVIC_SHCSR
#define CPU_REG_NVIC_SHCSR_BUSFAULTENA
#define CPU_REG_SCnSCB_ACTLR
#define CPU_REG_SCnSCB_ACTLR_DISDEFWBUF
#define MPU_INSTANCE

Function Documentation

void BusFault_Handler ( void  )
void disable_writebuffer ( void  )
void enable_busfault ( void  )
int main ( void  )

Function prototype for main function.

Parameters
receiveBuffBuffer used to hold received data

Return code from each SSD function

Address of the target location

Return protection status

Number of longword or phrase to be verified

0=normal, 1=user, 2=factory - margin read for reading

Indicate LED is brighter or dimmer

Use LPTMR in Time Counter mode

When hit compare value, set counter back to zero

bypass prescaler

use 1kHz Low Power Clock

Variable Documentation

volatile bool busFaultFlag
uint32_t cnt
volatile uint32_t regionArray[ARRAY_SIZE]
mpu_user_config_t userConfig1
mpu_user_config_t userConfig2
mpu_user_config_t userConfig3