Skip to content

Commit 9ba0caa

Browse files
committed
Add Arm China STAR-MC3 port support:
Fix corresponding issue #1359
1 parent d33d04b commit 9ba0caa

50 files changed

Lines changed: 24129 additions & 25 deletions

Some content is hidden

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

CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ if(NOT FREERTOS_PORT)
8888
" GCC_ARM_CM85_SECURE - Compiler: GCC Target: ARM Cortex-M85 secure\n"
8989
" GCC_ARM_CM85_NTZ_NONSECURE - Compiler: GCC Target: ARM Cortex-M85 non-trustzone non-secure\n"
9090
" GCC_ARM_CM85_TFM - Compiler: GCC Target: ARM Cortex-M85 non-secure for TF-M\n"
91+
" GCC_STAR_MC3_NONSECURE - Compiler: GCC Target: Arm China STAR-MC3 non-secure\n"
92+
" GCC_STAR_MC3_SECURE - Compiler: GCC Target: Arm China STAR-MC3 secure\n"
93+
" GCC_STAR_MC3_NTZ_NONSECURE - Compiler: GCC Target: Arm China STAR-MC3 non-trustzone non-secure\n"
94+
" GCC_STAR_MC3_TFM - Compiler: GCC Target: Arm China STAR-MC3 non-secure for TF-M\n"
9195
" GCC_ARM_CR5 - Compiler: GCC Target: ARM Cortex-R5\n"
9296
" GCC_ARM_CRX_MPU - Compiler: GCC Target: ARM Cortex-Rx with MPU\n"
9397
" GCC_ARM_CRX_NOGIC - Compiler: GCC Target: ARM Cortex-Rx no GIC\n"
@@ -159,6 +163,10 @@ if(NOT FREERTOS_PORT)
159163
" IAR_ARM_CM85_SECURE - Compiler: IAR Target: ARM Cortex-M85 secure\n"
160164
" IAR_ARM_CM85_NTZ_NONSECURE - Compiler: IAR Target: ARM Cortex-M85 non-trustzone non-secure\n"
161165
" IAR_ARM_CM85_TFM - Compiler: IAR Target: ARM Cortex-M85 non-secure for TF-M\n"
166+
" IAR_STAR_MC3_NONSECURE - Compiler: IAR Target: Arm China STAR-MC3 non-secure\n"
167+
" IAR_STAR_MC3_SECURE - Compiler: IAR Target: Arm China STAR-MC3 secure\n"
168+
" IAR_STAR_MC3_NTZ_NONSECURE - Compiler: IAR Target: Arm China STAR-MC3 non-trustzone non-secure\n"
169+
" IAR_STAR_MC3_TFM - Compiler: IAR Target: Arm China STAR-MC3 non-secure for TF-M\n"
162170
" IAR_ARM_CRX_NOGIC - Compiler: IAR Target: ARM Cortex-Rx no GIC\n"
163171
" IAR_ATMEGA323 - Compiler: IAR Target: ATMega323\n"
164172
" IAR_ATMEL_SAM7S64 - Compiler: IAR Target: Atmel SAM7S64\n"

examples/template_configuration/FreeRTOSConfig.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -602,8 +602,8 @@
602602

603603
/* Set configENABLE_MVE to 1 to enable the M-Profile Vector Extension (MVE)
604604
* support, or 0 to leave the MVE support disabled. This option is only
605-
* applicable to Cortex-M52, Cortex-M55 and Cortex-M85 ports as M-Profile
606-
* Vector Extension (MVE) is available only on these architectures.
605+
* applicable to Cortex-M52, Cortex-M55, Cortex-M85 and STAR-MC3 ports as
606+
* M-Profile Vector Extension (MVE) is available only on these architectures.
607607
* configENABLE_MVE must be left undefined, or defined to 0 for the
608608
* Cortex-M23,Cortex-M33 and Cortex-M35P ports. */
609609
#define configENABLE_MVE 1

portable/ARMv8M/ReadMe.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
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|52|55|85]_NNN directories prior to each
5-
FreeRTOS release.
4+
FreeRTOS/Source/portable/[compiler]/ARM_CM[23|33|52|55|85]_NNN and
5+
FreeRTOS/Source/portable/[compiler]/STAR_MC3_NNN directories prior to each 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|52|55|85] directories.
8+
FreeRTOS/Source/portable/[compiler]/ARM_CM[23|33|52|55|85] and
9+
FreeRTOS/Source/portable/[compiler]/STAR_MC3 directories.
910

1011
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|52|55|85]_NTZ directories.
12+
the FreeRTOS/Source/portable/[compiler]/ARM_CM[23|33|52|55|85]_NTZ and
13+
FreeRTOS/Source/portable/[compiler]/STAR_MC3_NTZ directories.

portable/ARMv8M/copy_files.py

Lines changed: 20 additions & 6 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_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']
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', 'STAR_MC3', 'STAR_MC3_NTZ']
37+
_ARCH_S_ = ['ARM_CM85', 'ARM_CM55', 'ARM_CM52', 'ARM_CM35P', 'ARM_CM33', 'ARM_CM23', 'STAR_MC3']
3838

3939
# Files to be compiled in the Secure Project
4040
_SECURE_COMMON_FILE_PATHS_ = [
@@ -51,15 +51,17 @@
5151
'ARM_CM35P':[os.path.join('secure', 'context', 'portable', 'GCC', 'ARM_CM33')],
5252
'ARM_CM52' :[os.path.join('secure', 'context', 'portable', 'GCC', 'ARM_CM33')],
5353
'ARM_CM55' :[os.path.join('secure', 'context', 'portable', 'GCC', 'ARM_CM33')],
54-
'ARM_CM85' :[os.path.join('secure', 'context', 'portable', 'GCC', 'ARM_CM33')]
54+
'ARM_CM85' :[os.path.join('secure', 'context', 'portable', 'GCC', 'ARM_CM33')],
55+
'STAR_MC3' :[os.path.join('secure', 'context', 'portable', 'GCC', 'ARM_CM33')]
5556
},
5657
'IAR':{
5758
'ARM_CM23' :[os.path.join('secure', 'context', 'portable', 'IAR', 'ARM_CM23')],
5859
'ARM_CM33' :[os.path.join('secure', 'context', 'portable', 'IAR', 'ARM_CM33')],
5960
'ARM_CM35P':[os.path.join('secure', 'context', 'portable', 'IAR', 'ARM_CM33')],
6061
'ARM_CM52' :[os.path.join('secure', 'context', 'portable', 'IAR', 'ARM_CM33')],
6162
'ARM_CM55' :[os.path.join('secure', 'context', 'portable', 'IAR', 'ARM_CM33')],
62-
'ARM_CM85' :[os.path.join('secure', 'context', 'portable', 'IAR', 'ARM_CM33')]
63+
'ARM_CM85' :[os.path.join('secure', 'context', 'portable', 'IAR', 'ARM_CM33')],
64+
'STAR_MC3' :[os.path.join('secure', 'context', 'portable', 'IAR', 'ARM_CM33')]
6365
}
6466
}
6567

@@ -97,7 +99,13 @@
9799
os.path.join('non_secure', 'portable', 'GCC', 'ARM_CM85', 'portmacro.h')],
98100
'ARM_CM85_NTZ' : [os.path.join('non_secure', 'portable', 'GCC', 'ARM_CM33_NTZ', 'portasm.c'),
99101
os.path.join('non_secure', 'portable', 'GCC', 'ARM_CM33_NTZ', 'mpu_wrappers_v2_asm.c'),
100-
os.path.join('non_secure', 'portable', 'GCC', 'ARM_CM85', 'portmacro.h')]
102+
os.path.join('non_secure', 'portable', 'GCC', 'ARM_CM85', 'portmacro.h')],
103+
'STAR_MC3' : [os.path.join('non_secure', 'portable', 'GCC', 'ARM_CM33', 'portasm.c'),
104+
os.path.join('non_secure', 'portable', 'GCC', 'ARM_CM33', 'mpu_wrappers_v2_asm.c'),
105+
os.path.join('non_secure', 'portable', 'GCC', 'STAR_MC3', 'portmacro.h')],
106+
'STAR_MC3_NTZ' : [os.path.join('non_secure', 'portable', 'GCC', 'ARM_CM33_NTZ', 'portasm.c'),
107+
os.path.join('non_secure', 'portable', 'GCC', 'ARM_CM33_NTZ', 'mpu_wrappers_v2_asm.c'),
108+
os.path.join('non_secure', 'portable', 'GCC', 'STAR_MC3', 'portmacro.h')]
101109
},
102110
'IAR':{
103111
'ARM_CM23' : [os.path.join('non_secure', 'portable', 'IAR', 'ARM_CM23')],
@@ -127,7 +135,13 @@
127135
os.path.join('non_secure', 'portable', 'IAR', 'ARM_CM85', 'portmacro.h')],
128136
'ARM_CM85_NTZ' : [os.path.join('non_secure', 'portable', 'IAR', 'ARM_CM33_NTZ', 'portasm.s'),
129137
os.path.join('non_secure', 'portable', 'IAR', 'ARM_CM33_NTZ', 'mpu_wrappers_v2_asm.S'),
130-
os.path.join('non_secure', 'portable', 'IAR', 'ARM_CM85', 'portmacro.h')]
138+
os.path.join('non_secure', 'portable', 'IAR', 'ARM_CM85', 'portmacro.h')],
139+
'STAR_MC3' : [os.path.join('non_secure', 'portable', 'IAR', 'ARM_CM33', 'portasm.s'),
140+
os.path.join('non_secure', 'portable', 'IAR', 'ARM_CM33', 'mpu_wrappers_v2_asm.S'),
141+
os.path.join('non_secure', 'portable', 'IAR', 'STAR_MC3', 'portmacro.h')],
142+
'STAR_MC3_NTZ' : [os.path.join('non_secure', 'portable', 'IAR', 'ARM_CM33_NTZ', 'portasm.s'),
143+
os.path.join('non_secure', 'portable', 'IAR', 'ARM_CM33_NTZ', 'mpu_wrappers_v2_asm.S'),
144+
os.path.join('non_secure', 'portable', 'IAR', 'STAR_MC3', 'portmacro.h')]
131145
},
132146
}
133147

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
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|52|55|85]_NNN directories prior to
4+
FreeRTOS/Source/portable/[compiler]/ARM_CM[23|33|52|55|85]_NNN and
5+
FreeRTOS/Source/portable/[compiler]/STAR_MC3_NNN directories prior to
56
each FreeRTOS release.
67

78
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|52|55|85] directories.
9+
FreeRTOS/Source/portable/[compiler]/ARM_CM[23|33|52|55|85] and
10+
FreeRTOS/Source/portable/[compiler]/STAR_MC3 directories.
911

1012
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|52|55|85]_NTZ directories.
13+
the FreeRTOS/Source/portable/[compiler]/ARM_CM[23|33|52|55|85]_NTZ and
14+
FreeRTOS/Source/portable/[compiler]/STAR_MC3_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) 2026 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 "STAR-MC3"
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) 2026 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 "STAR-MC3"
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: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
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|52|55|85]_NNN directories prior to
4+
FreeRTOS/Source/portable/[compiler]/ARM_CM[23|33|52|55|85]_NNN and
5+
FreeRTOS/Source/portable/[compiler]/STAR_MC3_NNN directories prior to
56
each FreeRTOS release.
67

78
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|52|55|85] directories.
9+
FreeRTOS/Source/portable/[compiler]/ARM_CM[23|33|52|55|85] and
10+
FreeRTOS/Source/portable/[compiler]/STAR_MC3 directories.
911

1012
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|52|55|85]_NTZ directories.
13+
the FreeRTOS/Source/portable/[compiler]/ARM_CM[23|33|52|55|85]_NTZ and
14+
FreeRTOS/Source/portable/[compiler]/STAR_MC3_NTZ directories.

0 commit comments

Comments
 (0)