Example description
CortexM3_BitBand CortexM3 BitBand example
Example Description
This example shows how to use CortexM3 Bit-Band access to perform atomic
read-modify-write and read operations on a variable in SRAM.
Directory contents
- CortexM3/BitBand/stm32f2xx_conf.h Library Configuration file
- CortexM3/BitBand/stm32f2xx_it.c Interrupt handlers
- CortexM3/BitBand/stm32f2xx_it.h Interrupt handlers header file
- CortexM3/BitBand/main.c Main program
- CortexM3/BitBand/system_stm32f2xx.c STM32F2xx system source file
The "system_stm32f2xx.c" is generated by an automatic clock configuration
tool and can be easily customized to your own configuration.
To select different clock setup, use the "STM32F2xx_Clock_Configuration_V1.0.0.xls" tool.
Hardware and Software environment
- This example runs on STM32F2xx Devices.
- This example has been tested with STM322xG-EVAL RevB and can be easily tailored
to any other development board
===============================================================================
CortexM3_Mode_Privilege CortexM3 Mode Privilege example
Example Description
This example shows how to modify CortexM3 Thread mode privilege access and stack.
CortexM3 Thread mode is entered on Reset, and can be entered as a result of an
exception return.
The associated program is used to:
1. Switch the Thread mode stack from Main stack to Process stack
2. Switch the Thread mode from Privileged to Unprivileged
3. Switch the Thread mode from Unprivileged back to Privileged
To monitor the stack used and the privileged or unprivileged access level of code
in Thread mode, a set of variables is available within the program. It is also
possible to use the 'Cortex register' window of the debugger.
Directory contents
- CortexM3/Mode_Privilege/stm32f2xx_conf.h Library Configuration file
- CortexM3/Mode_Privilege/stm32f2xx_it.c Interrupt handlers
- CortexM3/Mode_Privilege/stm32f2xx_it.h Interrupt handlers header file
- CortexM3/Mode_Privilege/main.c Main program
- CortexM3/Mode_Privilege/system_stm32f2xx.c STM32F2xx system source file
The "system_stm32f2xx.c" is generated by an automatic clock configuration
tool and can be easily customized to your own configuration.
To select different clock setup, use the "STM32F2xx_Clock_Configuration_V1.0.0.xls" tool.
Hardware and Software environment
- This example runs on STM32F2xx Devices.
- This example has been tested with STM322xG-EVAL RevB and can be easily tailored
to any other development board
===============================================================================
CortexM3_MPU CortexM3 MPU example
Example Description
This example presents the MPU features on STM32F2xx devices and it can be easily
ported to any other STM32 device supporting MPU.
The example purpose is to configure a memory region as privileged read only region
and tries to perform read and write operation in different mode.
If the access is permitted LED1 is toggling. If the access is not permitted,
a memory management fault is generated and LED2 is ON.
To generate an MPU memory fault exception due to an access right error, uncomment
the following line "PrivilegedReadOnlyArray[0] = 'e';" in the "stm32_mpu.c" file.
Directory contents
- CortexM3/MPU/stm32f2xx_conf.h Library Configuration file
- CortexM3/MPU/stm32f2xx_it.c Interrupt handlers
- CortexM3/MPU/stm32f2xx_it.h Header for stm32f2xx_it.c
- CortexM3/MPU/main.c Main program
- CortexM3/MPU/system_stm32f2xx.c STM32F2xx system source file
- CortexM3/MPU/stm32_mpu.c Cortex-M3 MPU regions Access rights file
The "system_stm32f2xx.c" is generated by an automatic clock configuration
tool and can be easily customized to your own configuration.
To select different clock setup, use the "STM32F2xx_Clock_Configuration_V1.0.0.xls" tool.
Hardware and Software environment
- This example runs on STM32F2xx Devices.
- This example has been tested with STM322xG-EVAL RevB and can be easily tailored
to any other development board