Commit Graph

8 Commits (27bcaa47d563cf8dee8b62a3ee26f7ea9d7390d9)

Author SHA1 Message Date
Kevin Bracey 770baa22ea Rework MPU use option
Make the option positively named, and as it is a platform config
option make sure it only affects platform code.

HAL functions still remain available even if platform is told not
to use them.
2018-12-11 13:03:59 +02:00
Russ Butler 2af6642f68 Add a platform config to disable the MPU
Add the platform config DISABLE_MPU to allow the MPU to be disabled
from an application.
2018-12-11 13:03:58 +02:00
Russ Butler 390ef301a8 Add header to fix compile failures
Add the header platform/mbed_assert.h to fix build errors with
platform/mbed_mpu_mgmt.c.
2018-12-10 12:54:17 -06:00
Kevin Bracey 1289406f9f Use MBED_ASSERT in MPU manager
MPU lock under- or overflow is not a likely random runtime failure - it
will be a mismatched lock/unlock programming error, so should be
detected during development.  Make the checks asserts so they can be
left out from release builds.  MBED_ASSERT is also a bit smaller than
MBED_ERROR in develop builds.
2018-12-10 15:53:35 +02:00
Kevin Bracey e2f6025b17 Exclude MPU manager code if MPU disabled
Save around 400 bytes from images using FlashIAP by omitting MPU manager
reference counting if DEVICE_MPU is 0.
2018-12-10 14:44:03 +02:00
Russ Butler caa7b93921 Rename lock functions and classes
Invert the name of the lock functions and classes so you are not
locking a negative.
2018-11-27 09:29:32 +00:00
Russ Butler 1821d37621 Overhaul MPU for new requirements
Make the following changes:
-Allow a vector specific ARM MPU driver by defining MBED_MPU_CUSTOM
-Allow ROM address to be configured for ARMv7-M devices by
    setting the define MBED_MPU_ROM_END
-Add ROM write protection
    -Add new functions and lock
    -enable at boot
    -disable during flash programming
2018-11-27 09:29:32 +00:00
Russ Butler ecd0414494 Integrate MPU with mbed
Enable the MPU as part of the boot sequence and disable it before
starting a new application. Also add reference counted MPU lock and
unlock functions to allow code to execute from ram when necessary.
2018-11-27 09:29:31 +00:00