Skip to content

Commit 4b0293f

Browse files
author
Cruz Monrreal
authored
Merge pull request #8175 from c1728p9/fix_mpu
Fix the CMSIS macro ARM_MPU_RASR
2 parents c9b9ee8 + c13c3e3 commit 4b0293f

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

cmsis/TARGET_CORTEX_M/mpu_armv7.h

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/******************************************************************************
22
* @file mpu_armv7.h
33
* @brief CMSIS MPU API for Armv7-M MPU
4-
* @version V5.0.4
5-
* @date 10. January 2018
4+
* @version V5.0.5
5+
* @date 06. September 2018
66
******************************************************************************/
77
/*
88
* Copyright (c) 2017-2018 Arm Limited. All rights reserved.
@@ -86,10 +86,10 @@
8686
* \param IsBufferable Region is bufferable, i.e. using write-back caching. Cacheable but non-bufferable regions use write-through policy.
8787
*/
8888
#define ARM_MPU_ACCESS_(TypeExtField, IsShareable, IsCacheable, IsBufferable) \
89-
((((TypeExtField ) << MPU_RASR_TEX_Pos) & MPU_RASR_TEX_Msk) | \
90-
(((IsShareable ) << MPU_RASR_S_Pos) & MPU_RASR_S_Msk) | \
91-
(((IsCacheable ) << MPU_RASR_C_Pos) & MPU_RASR_C_Msk) | \
92-
(((IsBufferable ) << MPU_RASR_B_Pos) & MPU_RASR_B_Msk))
89+
((((TypeExtField) << MPU_RASR_TEX_Pos) & MPU_RASR_TEX_Msk) | \
90+
(((IsShareable) << MPU_RASR_S_Pos) & MPU_RASR_S_Msk) | \
91+
(((IsCacheable) << MPU_RASR_C_Pos) & MPU_RASR_C_Msk) | \
92+
(((IsBufferable) << MPU_RASR_B_Pos) & MPU_RASR_B_Msk))
9393

9494
/**
9595
* MPU Region Attribute and Size Register Value
@@ -100,11 +100,14 @@
100100
* \param SubRegionDisable Sub-region disable field.
101101
* \param Size Region size of the region to be configured, for example 4K, 8K.
102102
*/
103-
#define ARM_MPU_RASR_EX(DisableExec, AccessPermission, AccessAttributes, SubRegionDisable, Size) \
104-
((((DisableExec ) << MPU_RASR_XN_Pos) & MPU_RASR_XN_Msk) | \
105-
(((AccessPermission) << MPU_RASR_AP_Pos) & MPU_RASR_AP_Msk) | \
106-
(((AccessAttributes) ) & (MPU_RASR_TEX_Msk | MPU_RASR_S_Msk | MPU_RASR_C_Msk | MPU_RASR_B_Msk)))
107-
103+
#define ARM_MPU_RASR_EX(DisableExec, AccessPermission, AccessAttributes, SubRegionDisable, Size) \
104+
((((DisableExec) << MPU_RASR_XN_Pos) & MPU_RASR_XN_Msk) | \
105+
(((AccessPermission) << MPU_RASR_AP_Pos) & MPU_RASR_AP_Msk) | \
106+
(((AccessAttributes) & (MPU_RASR_TEX_Msk | MPU_RASR_S_Msk | MPU_RASR_C_Msk | MPU_RASR_B_Msk))) | \
107+
(((SubRegionDisable) << MPU_RASR_SRD_Pos) & MPU_RASR_SRD_Msk) | \
108+
(((Size) << MPU_RASR_SIZE_Pos) & MPU_RASR_SIZE_Msk) | \
109+
(((MPU_RASR_ENABLE_Msk))))
110+
108111
/**
109112
* MPU Region Attribute and Size Register Value
110113
*

0 commit comments

Comments
 (0)