Skip to content

Commit f8091f7

Browse files
committed
Add ARM Cortex-M52 port support
Fixes #1305 - Add ARM_CM52 and ARM_CM52_NTZ port implementations for GCC and IAR compilers
1 parent 439af33 commit f8091f7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+24103
-19
lines changed

CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ if(NOT FREERTOS_PORT)
7676
" GCC_ARM_CM35P_NONSECURE - Compiler: GCC Target: ARM Cortex-M35P non-secure\n"
7777
" GCC_ARM_CM35P_SECURE - Compiler: GCC Target: ARM Cortex-M35P secure\n"
7878
" GCC_ARM_CM35P_NTZ_NONSECURE - Compiler: GCC Target: ARM Cortex-M35P non-trustzone non-secure\n"
79+
" GCC_ARM_CM52_NONSECURE - Compiler: GCC Target: ARM Cortex-M52 non-secure\n"
80+
" GCC_ARM_CM52_SECURE - Compiler: GCC Target: ARM Cortex-M52 secure\n"
81+
" GCC_ARM_CM52_NTZ_NONSECURE - Compiler: GCC Target: ARM Cortex-M52 non-trustzone non-secure\n"
82+
" GCC_ARM_CM52_TFM - Compiler: GCC Target: ARM Cortex-M52 non-secure for TF-M\n"
7983
" GCC_ARM_CM55_NONSECURE - Compiler: GCC Target: ARM Cortex-M55 non-secure\n"
8084
" GCC_ARM_CM55_SECURE - Compiler: GCC Target: ARM Cortex-M55 secure\n"
8185
" GCC_ARM_CM55_NTZ_NONSECURE - Compiler: GCC Target: ARM Cortex-M55 non-trustzone non-secure\n"
@@ -143,6 +147,10 @@ if(NOT FREERTOS_PORT)
143147
" IAR_ARM_CM35P_NONSECURE - Compiler: IAR Target: ARM Cortex-M35P non-secure\n"
144148
" IAR_ARM_CM35P_SECURE - Compiler: IAR Target: ARM Cortex-M35P secure\n"
145149
" IAR_ARM_CM35P_NTZ_NONSECURE - Compiler: IAR Target: ARM Cortex-M35P non-trustzone non-secure\n"
150+
" IAR_ARM_CM52_NONSECURE - Compiler: IAR Target: ARM Cortex-M52 non-secure\n"
151+
" IAR_ARM_CM52_SECURE - Compiler: IAR Target: ARM Cortex-M52 secure\n"
152+
" IAR_ARM_CM52_NTZ_NONSECURE - Compiler: IAR Target: ARM Cortex-M52 non-trustzone non-secure\n"
153+
" IAR_ARM_CM52_TFM - Compiler: IAR Target: ARM Cortex-M52 non-secure for TF-M\n"
146154
" IAR_ARM_CM55_NONSECURE - Compiler: IAR Target: ARM Cortex-M55 non-secure\n"
147155
" IAR_ARM_CM55_SECURE - Compiler: IAR Target: ARM Cortex-M55 secure\n"
148156
" IAR_ARM_CM55_NTZ_NONSECURE - Compiler: IAR Target: ARM Cortex-M55 non-trustzone non-secure\n"

portable/ARMv8M/ReadMe.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
This directory tree contains the master copy of the FreeRTOS Armv8-M and
22
Armv8.1-M ports.
33
Do not use the files located here! These file are copied into separate
4-
FreeRTOS/Source/portable/[compiler]/ARM_CM[23|33|55|85]_NNN directories prior to each
4+
FreeRTOS/Source/portable/[compiler]/ARM_CM[23|33|52|55|85]_NNN directories prior to each
55
FreeRTOS release.
66

77
If your Armv8-M and Armv8.1-M application uses TrustZone then use the files from the
8-
FreeRTOS/Source/portable/[compiler]/ARM_CM[23|33|55|85] directories.
8+
FreeRTOS/Source/portable/[compiler]/ARM_CM[23|33|52|55|85] directories.
99

1010
If your Armv8-M and Armv8.1-M application does not use TrustZone then use the files from
11-
the FreeRTOS/Source/portable/[compiler]/ARM_CM[23|33|55|85]_NTZ directories.
11+
the FreeRTOS/Source/portable/[compiler]/ARM_CM[23|33|52|55|85]_NTZ directories.

portable/ARMv8M/copy_files.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
_FREERTOS_PORTABLE_DIRECTORY_ = os.path.dirname(_THIS_FILE_DIRECTORY_)
3434

3535
_COMPILERS_ = ['GCC', 'IAR']
36-
_ARCH_NS_ = ['ARM_CM85', 'ARM_CM85_NTZ', 'ARM_CM55', 'ARM_CM55_NTZ', 'ARM_CM35P', 'ARM_CM35P_NTZ', 'ARM_CM33', 'ARM_CM33_NTZ', 'ARM_CM23', 'ARM_CM23_NTZ']
37-
_ARCH_S_ = ['ARM_CM85', 'ARM_CM55', 'ARM_CM35P', 'ARM_CM33', 'ARM_CM23']
36+
_ARCH_NS_ = ['ARM_CM85', 'ARM_CM85_NTZ', 'ARM_CM55', 'ARM_CM55_NTZ', 'ARM_CM52', 'ARM_CM52_NTZ', 'ARM_CM35P', 'ARM_CM35P_NTZ', 'ARM_CM33', 'ARM_CM33_NTZ', 'ARM_CM23', 'ARM_CM23_NTZ']
37+
_ARCH_S_ = ['ARM_CM85', 'ARM_CM55', 'ARM_CM52', 'ARM_CM35P', 'ARM_CM33', 'ARM_CM23']
3838

3939
# Files to be compiled in the Secure Project
4040
_SECURE_COMMON_FILE_PATHS_ = [
@@ -49,13 +49,15 @@
4949
'ARM_CM23' :[os.path.join('secure', 'context', 'portable', 'GCC', 'ARM_CM23')],
5050
'ARM_CM33' :[os.path.join('secure', 'context', 'portable', 'GCC', 'ARM_CM33')],
5151
'ARM_CM35P':[os.path.join('secure', 'context', 'portable', 'GCC', 'ARM_CM33')],
52+
'ARM_CM52' :[os.path.join('secure', 'context', 'portable', 'GCC', 'ARM_CM33')],
5253
'ARM_CM55' :[os.path.join('secure', 'context', 'portable', 'GCC', 'ARM_CM33')],
5354
'ARM_CM85' :[os.path.join('secure', 'context', 'portable', 'GCC', 'ARM_CM33')]
5455
},
5556
'IAR':{
5657
'ARM_CM23' :[os.path.join('secure', 'context', 'portable', 'IAR', 'ARM_CM23')],
5758
'ARM_CM33' :[os.path.join('secure', 'context', 'portable', 'IAR', 'ARM_CM33')],
5859
'ARM_CM35P':[os.path.join('secure', 'context', 'portable', 'IAR', 'ARM_CM33')],
60+
'ARM_CM52' :[os.path.join('secure', 'context', 'portable', 'IAR', 'ARM_CM33')],
5961
'ARM_CM55' :[os.path.join('secure', 'context', 'portable', 'IAR', 'ARM_CM33')],
6062
'ARM_CM85' :[os.path.join('secure', 'context', 'portable', 'IAR', 'ARM_CM33')]
6163
}
@@ -78,6 +80,12 @@
7880
'ARM_CM35P_NTZ' : [os.path.join('non_secure', 'portable', 'GCC', 'ARM_CM33_NTZ', 'portasm.c'),
7981
os.path.join('non_secure', 'portable', 'GCC', 'ARM_CM33_NTZ', 'mpu_wrappers_v2_asm.c'),
8082
os.path.join('non_secure', 'portable', 'GCC', 'ARM_CM35P', 'portmacro.h')],
83+
'ARM_CM52' : [os.path.join('non_secure', 'portable', 'GCC', 'ARM_CM33', 'portasm.c'),
84+
os.path.join('non_secure', 'portable', 'GCC', 'ARM_CM33', 'mpu_wrappers_v2_asm.c'),
85+
os.path.join('non_secure', 'portable', 'GCC', 'ARM_CM52', 'portmacro.h')],
86+
'ARM_CM52_NTZ' : [os.path.join('non_secure', 'portable', 'GCC', 'ARM_CM33_NTZ', 'portasm.c'),
87+
os.path.join('non_secure', 'portable', 'GCC', 'ARM_CM33_NTZ', 'mpu_wrappers_v2_asm.c'),
88+
os.path.join('non_secure', 'portable', 'GCC', 'ARM_CM52', 'portmacro.h')],
8189
'ARM_CM55' : [os.path.join('non_secure', 'portable', 'GCC', 'ARM_CM33', 'portasm.c'),
8290
os.path.join('non_secure', 'portable', 'GCC', 'ARM_CM33', 'mpu_wrappers_v2_asm.c'),
8391
os.path.join('non_secure', 'portable', 'GCC', 'ARM_CM55', 'portmacro.h')],
@@ -102,6 +110,12 @@
102110
'ARM_CM35P_NTZ' : [os.path.join('non_secure', 'portable', 'IAR', 'ARM_CM33_NTZ', 'portasm.s'),
103111
os.path.join('non_secure', 'portable', 'IAR', 'ARM_CM33_NTZ', 'mpu_wrappers_v2_asm.S'),
104112
os.path.join('non_secure', 'portable', 'IAR', 'ARM_CM35P', 'portmacro.h')],
113+
'ARM_CM52' : [os.path.join('non_secure', 'portable', 'IAR', 'ARM_CM33', 'portasm.s'),
114+
os.path.join('non_secure', 'portable', 'IAR', 'ARM_CM33', 'mpu_wrappers_v2_asm.S'),
115+
os.path.join('non_secure', 'portable', 'IAR', 'ARM_CM52', 'portmacro.h')],
116+
'ARM_CM52_NTZ' : [os.path.join('non_secure', 'portable', 'IAR', 'ARM_CM33_NTZ', 'portasm.s'),
117+
os.path.join('non_secure', 'portable', 'IAR', 'ARM_CM33_NTZ', 'mpu_wrappers_v2_asm.S'),
118+
os.path.join('non_secure', 'portable', 'IAR', 'ARM_CM52', 'portmacro.h')],
105119
'ARM_CM55' : [os.path.join('non_secure', 'portable', 'IAR', 'ARM_CM33', 'portasm.s'),
106120
os.path.join('non_secure', 'portable', 'IAR', 'ARM_CM33', 'mpu_wrappers_v2_asm.S'),
107121
os.path.join('non_secure', 'portable', 'IAR', 'ARM_CM55', 'portmacro.h')],
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
This directory tree contains the master copy of the FreeRTOS Armv8-M and
22
Armv8.1-M ports.
33
Do not use the files located here! These file are copied into separate
4-
FreeRTOS/Source/portable/[compiler]/ARM_CM[23|33|55|85]_NNN directories prior to
4+
FreeRTOS/Source/portable/[compiler]/ARM_CM[23|33|52|55|85]_NNN directories prior to
55
each FreeRTOS release.
66

77
If your Armv8-M/Armv8.1-M application uses TrustZone then use the files from the
8-
FreeRTOS/Source/portable/[compiler]/ARM_CM[23|33|55|85] directories.
8+
FreeRTOS/Source/portable/[compiler]/ARM_CM[23|33|52|55|85] directories.
99

1010
If your Armv8-M/Armv8.1-M application does not use TrustZone then use the files from
11-
the FreeRTOS/Source/portable/[compiler]/ARM_CM[23|33|55|85]_NTZ directories.
11+
the FreeRTOS/Source/portable/[compiler]/ARM_CM[23|33|52|55|85]_NTZ directories.
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
/*
2+
* FreeRTOS Kernel <DEVELOPMENT BRANCH>
3+
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4+
* Copyright (c) 2025 Arm Technology (China) Co., Ltd.All Rights Reserved.
5+
*
6+
* SPDX-License-Identifier: MIT
7+
*
8+
* Permission is hereby granted, free of charge, to any person obtaining a copy of
9+
* this software and associated documentation files (the "Software"), to deal in
10+
* the Software without restriction, including without limitation the rights to
11+
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
12+
* the Software, and to permit persons to whom the Software is furnished to do so,
13+
* subject to the following conditions:
14+
*
15+
* The above copyright notice and this permission notice shall be included in all
16+
* copies or substantial portions of the Software.
17+
*
18+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
20+
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
21+
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
22+
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
23+
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24+
*
25+
* https://www.FreeRTOS.org
26+
* https://github.com/FreeRTOS
27+
*
28+
*/
29+
30+
#ifndef PORTMACRO_H
31+
#define PORTMACRO_H
32+
33+
/* *INDENT-OFF* */
34+
#ifdef __cplusplus
35+
extern "C" {
36+
#endif
37+
/* *INDENT-ON* */
38+
39+
/*------------------------------------------------------------------------------
40+
* Port specific definitions.
41+
*
42+
* The settings in this file configure FreeRTOS correctly for the given hardware
43+
* and compiler.
44+
*
45+
* These settings should not be altered.
46+
*------------------------------------------------------------------------------
47+
*/
48+
49+
#ifndef configENABLE_MVE
50+
#error configENABLE_MVE must be defined in FreeRTOSConfig.h. Set configENABLE_MVE to 1 to enable the MVE or 0 to disable the MVE.
51+
#endif /* configENABLE_MVE */
52+
/*-----------------------------------------------------------*/
53+
54+
/**
55+
* Architecture specifics.
56+
*/
57+
#define portARCH_NAME "Cortex-M52"
58+
#define portHAS_ARMV8M_MAIN_EXTENSION 1
59+
#define portARMV8M_MINOR_VERSION 1
60+
#define portDONT_DISCARD __attribute__( ( used ) )
61+
/*-----------------------------------------------------------*/
62+
63+
/* ARMv8-M common port configurations. */
64+
#include "portmacrocommon.h"
65+
/*-----------------------------------------------------------*/
66+
67+
/**
68+
* @brief Critical section management.
69+
*/
70+
#define portDISABLE_INTERRUPTS() ulSetInterruptMask()
71+
#define portENABLE_INTERRUPTS() vClearInterruptMask( 0 )
72+
/*-----------------------------------------------------------*/
73+
74+
/* *INDENT-OFF* */
75+
#ifdef __cplusplus
76+
}
77+
#endif
78+
/* *INDENT-ON* */
79+
80+
#endif /* PORTMACRO_H */
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
/*
2+
* FreeRTOS Kernel <DEVELOPMENT BRANCH>
3+
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4+
* Copyright (c) 2025 Arm Technology (China) Co., Ltd.All Rights Reserved.
5+
*
6+
* SPDX-License-Identifier: MIT
7+
*
8+
* Permission is hereby granted, free of charge, to any person obtaining a copy of
9+
* this software and associated documentation files (the "Software"), to deal in
10+
* the Software without restriction, including without limitation the rights to
11+
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
12+
* the Software, and to permit persons to whom the Software is furnished to do so,
13+
* subject to the following conditions:
14+
*
15+
* The above copyright notice and this permission notice shall be included in all
16+
* copies or substantial portions of the Software.
17+
*
18+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
20+
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
21+
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
22+
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
23+
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24+
*
25+
* https://www.FreeRTOS.org
26+
* https://github.com/FreeRTOS
27+
*
28+
*/
29+
30+
#ifndef PORTMACRO_H
31+
#define PORTMACRO_H
32+
33+
/* *INDENT-OFF* */
34+
#ifdef __cplusplus
35+
extern "C" {
36+
#endif
37+
/* *INDENT-ON* */
38+
39+
/*------------------------------------------------------------------------------
40+
* Port specific definitions.
41+
*
42+
* The settings in this file configure FreeRTOS correctly for the given hardware
43+
* and compiler.
44+
*
45+
* These settings should not be altered.
46+
*------------------------------------------------------------------------------
47+
*/
48+
49+
#ifndef configENABLE_MVE
50+
#error configENABLE_MVE must be defined in FreeRTOSConfig.h. Set configENABLE_MVE to 1 to enable the MVE or 0 to disable the MVE.
51+
#endif /* configENABLE_MVE */
52+
/*-----------------------------------------------------------*/
53+
54+
/**
55+
* Architecture specifics.
56+
*/
57+
#define portARCH_NAME "Cortex-M52"
58+
#define portHAS_ARMV8M_MAIN_EXTENSION 1
59+
#define portARMV8M_MINOR_VERSION 1
60+
#define portDONT_DISCARD __root
61+
/*-----------------------------------------------------------*/
62+
63+
/* ARMv8-M common port configurations. */
64+
#include "portmacrocommon.h"
65+
/*-----------------------------------------------------------*/
66+
67+
/**
68+
* @brief Critical section management.
69+
*/
70+
#define portDISABLE_INTERRUPTS() ulSetInterruptMask()
71+
#define portENABLE_INTERRUPTS() vClearInterruptMask( 0 )
72+
/*-----------------------------------------------------------*/
73+
74+
/* Suppress warnings that are generated by the IAR tools, but cannot be fixed in
75+
* the source code because to do so would cause other compilers to generate
76+
* warnings. */
77+
#pragma diag_suppress=Be006
78+
#pragma diag_suppress=Pa082
79+
/*-----------------------------------------------------------*/
80+
81+
/* *INDENT-OFF* */
82+
#ifdef __cplusplus
83+
}
84+
#endif
85+
/* *INDENT-ON* */
86+
87+
#endif /* PORTMACRO_H */

portable/ARMv8M/secure/ReadMe.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
This directory tree contains the master copy of the FreeRTOS Armv8-M and
22
Armv8.1-M ports.
33
Do not use the files located here! These file are copied into separate
4-
FreeRTOS/Source/portable/[compiler]/ARM_CM[23|33|55|85]_NNN directories prior to
4+
FreeRTOS/Source/portable/[compiler]/ARM_CM[23|33|52|55|85]_NNN directories prior to
55
each FreeRTOS release.
66

77
If your Armv8-M/Armv8.1-M application uses TrustZone then use the files from the
8-
FreeRTOS/Source/portable/[compiler]/ARM_CM[23|33|55|85] directories.
8+
FreeRTOS/Source/portable/[compiler]/ARM_CM[23|33|52|55|85] directories.
99

1010
If your Armv8-M/Armv8.1-M application does not use TrustZone then use the files from
11-
the FreeRTOS/Source/portable/[compiler]/ARM_CM[23|33|55|85]_NTZ directories.
11+
the FreeRTOS/Source/portable/[compiler]/ARM_CM[23|33|52|55|85]_NTZ directories.

0 commit comments

Comments
 (0)