Skip to content

Commit 43251e1

Browse files
author
deepikabhavnani
committed
Updated the script to be generic for any repo
1 parent d4e6dec commit 43251e1

File tree

3 files changed

+316
-177
lines changed

3 files changed

+316
-177
lines changed

tools/importer/README.md

Lines changed: 48 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,50 @@
1-
## Porting CMSIS/RTX Code in Mbed OS
1+
## Importing repositories into mbed-os
22

3-
This directory contains scripts to import latest CMSIS/RTX code into mbed-os local repository.
4-
CMSIS/RTX fixes and new releases are imported into mbed-os on regular basis using the `cmsis_importer.py` python script input to which is `cmsis_importer.json`
3+
importer.py script can be used to import code base from different repositories into mbed-os.
54

6-
Verify the files and path in `cmsis_importer.json`
5+
### Pre-requisties
6+
1. Get the required repository clone and update it to commit required. Note: Repository should be placed outside the mbed-os.
7+
2. Create json file as per template
8+
9+
### JSON file template
10+
11+
You can list all the files and folders which are required to be copied in config file in `file` and `folder` arrays respectively. Script will remove the files/folders specified in `src` section from mbed-os repository before copy operation is performed.
12+
New commit is created on branch `feature_+repo_name+last_sha` with commit message "[REPO_NAME]: Updated to last_sha"
13+
14+
Note: Only files present in folder will be copied, directories inside the folder will not be copied.
15+
16+
`commit_sha` is list of commits present in mbed-os repo. These commits will be applied after copying files and folders listed above.Each commit in the commit_sha list is cherry-picked and applied with the -x option, which records the SHA of the source commit in the commit message.
17+
Note: You must resolve any conflicts that arise during this cherry-pick process. Make sure that the "(cherry picked from commit ...)" statement is present in the commit message. Re-execute the python script to apply rest of the SHA commits.
18+
19+
{
20+
"files" : [
21+
{
22+
"src_file" : "CMSIS/Core/Template/ARMv8-M/tz_context.c",
23+
"dest_file" : "cmsis/TARGET_CORTEX_M/mbed_tz_context.c"
24+
},
25+
...
26+
{
27+
"src_file" : "",
28+
"dest_file" : ""
29+
}
30+
],
31+
"folders" : [
32+
{
33+
"src_folder" : "CMSIS/Core/Include/",
34+
"dest_folder" : "cmsis/TARGET_CORTEX_M/"
35+
},
36+
...
37+
{
38+
"src_folder" : "",
39+
"dest_folder" : ""
40+
}
41+
],
42+
"commit_sha" : [
43+
"428acae1b2ac15c3ad523e8d40755a9301220822",
44+
"d9d622afe0ca8c7ab9d24c17f9fe59b54dcc61c9",
45+
]
46+
}
47+
48+
### Input to importer.py
49+
1. Repository: -r <repo_path> ( Example: CMSIS / Mbed-tls / uVisor)
50+
2. `repo`_importer.json: -c <json_file> (Example: cmsis_importer.json)

tools/importer/cmsis_importer.json

Lines changed: 74 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,152 +1,154 @@
11
{
2-
"config" : {
3-
"cmsis_repo" : "https://github.com/ARM-software/CMSIS_5",
4-
"cmsis_branch" : "develop"
5-
},
62
"files" : [
73
{
8-
"cmsis_file" : "CMSIS/Core/Template/ARMv8-M/tz_context.c",
9-
"mbed_file" : "platform/mbed_tz_context.c"
4+
"src_file" : "CMSIS/Core/Template/ARMv8-M/tz_context.c",
5+
"dest_file" : "cmsis/TARGET_CORTEX_M/mbed_tz_context.c"
106
},
117
{
12-
"cmsis_file" : "CMSIS/RTOS2/RTX/Config/handlers.c",
13-
"mbed_file" : "rtos/TARGET_CORTEX/rtx5/RTX/Config/TARGET_CORTEX_A/handlers.c"
8+
"src_file" : "CMSIS/RTOS2/RTX/Config/handlers.c",
9+
"dest_file" : "rtos/TARGET_CORTEX/rtx5/RTX/Config/TARGET_CORTEX_A/handlers.c"
1410
},
1511
{
16-
"cmsis_file" : "CMSIS/RTOS2/RTX/Config/RTX_Config.h",
17-
"mbed_file" : "rtos/TARGET_CORTEX/rtx5/RTX/Config/RTX_Config.h"
12+
"src_file" : "CMSIS/RTOS2/RTX/Config/RTX_Config.h",
13+
"dest_file" : "rtos/TARGET_CORTEX/rtx5/RTX/Config/RTX_Config.h"
1814
},
1915
{
20-
"cmsis_file" : "CMSIS/RTOS2/RTX/Config/RTX_Config.c",
21-
"mbed_file" : "rtos/TARGET_CORTEX/rtx5/RTX/Config/RTX_Config.c"
16+
"src_file" : "CMSIS/RTOS2/RTX/Config/RTX_Config.c",
17+
"dest_file" : "rtos/TARGET_CORTEX/rtx5/RTX/Config/RTX_Config.c"
2218
},
2319
{
24-
"cmsis_file" : "CMSIS/RTOS2/RTX/Source/ARM/irq_cm0.S",
25-
"mbed_file" : "rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_ARM/TARGET_M0/irq_cm0.S"
20+
"src_file" : "CMSIS/RTOS2/RTX/Source/ARM/irq_cm0.S",
21+
"dest_file" : "rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_ARM/TARGET_M0/irq_cm0.S"
2622
},
2723
{
28-
"cmsis_file" : "CMSIS/RTOS2/RTX/Source/ARM/irq_cm0.S",
29-
"mbed_file" : "rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_ARM/TARGET_M0P/irq_cm0.S"
24+
"src_file" : "CMSIS/RTOS2/RTX/Source/ARM/irq_cm0.S",
25+
"dest_file" : "rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_ARM/TARGET_M0P/irq_cm0.S"
3026
},
3127
{
32-
"cmsis_file" : "CMSIS/RTOS2/RTX/Source/ARM/irq_armv8mbl.S",
33-
"mbed_file" : "rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_ARM/TARGET_M23/irq_armv8mbl.S"
28+
"src_file" : "CMSIS/RTOS2/RTX/Source/ARM/irq_armv8mbl.S",
29+
"dest_file" : "rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_ARM/TARGET_M23/irq_armv8mbl.S"
3430
},
3531
{
36-
"cmsis_file" : "CMSIS/RTOS2/RTX/Source/ARM/irq_cm3.S",
37-
"mbed_file" : "rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_ARM/TARGET_M3/irq_cm3.S"
32+
"src_file" : "CMSIS/RTOS2/RTX/Source/ARM/irq_cm3.S",
33+
"dest_file" : "rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_ARM/TARGET_M3/irq_cm3.S"
3834
},
3935
{
40-
"cmsis_file" : "CMSIS/RTOS2/RTX/Source/ARM/irq_armv8mml.S",
41-
"mbed_file" : "rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_ARM/TARGET_M33/irq_armv8mml.S"
36+
"src_file" : "CMSIS/RTOS2/RTX/Source/ARM/irq_armv8mml.S",
37+
"dest_file" : "rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_ARM/TARGET_M33/irq_armv8mml.S"
4238
},
4339
{
44-
"cmsis_file" : "CMSIS/RTOS2/RTX/Source/ARM/irq_cm4f.S",
45-
"mbed_file" : "rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_ARM/TARGET_RTOS_M4_M7/irq_cm4f.S"
40+
"src_file" : "CMSIS/RTOS2/RTX/Source/ARM/irq_cm4f.S",
41+
"dest_file" : "rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_ARM/TARGET_RTOS_M4_M7/irq_cm4f.S"
4642
},
4743
{
48-
"cmsis_file" : "CMSIS/RTOS2/RTX/Source/ARM/irq_ca.S",
49-
"mbed_file" : "rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_ARM/TARGET_CORTEX_A/irq_ca.S"
44+
"src_file" : "CMSIS/RTOS2/RTX/Source/ARM/irq_ca.S",
45+
"dest_file" : "rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_ARM/TARGET_CORTEX_A/irq_ca.S"
5046
},
5147
{
52-
"cmsis_file" : "CMSIS/RTOS2/RTX/Source/GCC/irq_cm0.S",
53-
"mbed_file" : "rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_GCC/TARGET_M0/irq_cm0.S"
48+
"src_file" : "CMSIS/RTOS2/RTX/Source/GCC/irq_cm0.S",
49+
"dest_file" : "rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_GCC/TARGET_M0/irq_cm0.S"
5450
},
5551
{
56-
"cmsis_file" : "CMSIS/RTOS2/RTX/Source/GCC/irq_cm0.S",
57-
"mbed_file" : "rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_GCC/TARGET_M0P/irq_cm0.S"
52+
"src_file" : "CMSIS/RTOS2/RTX/Source/GCC/irq_cm0.S",
53+
"dest_file" : "rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_GCC/TARGET_M0P/irq_cm0.S"
5854
},
5955
{
60-
"cmsis_file" : "CMSIS/RTOS2/RTX/Source/GCC/irq_armv8mbl.S",
61-
"mbed_file" : "rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_GCC/TARGET_M23/irq_armv8mbl.S"
56+
"src_file" : "CMSIS/RTOS2/RTX/Source/GCC/irq_armv8mbl.S",
57+
"dest_file" : "rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_GCC/TARGET_M23/irq_armv8mbl.S"
6258
},
6359
{
64-
"cmsis_file" : "CMSIS/RTOS2/RTX/Source/GCC/irq_cm3.S",
65-
"mbed_file" : "rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_GCC/TARGET_M3/irq_cm3.S"
60+
"src_file" : "CMSIS/RTOS2/RTX/Source/GCC/irq_cm3.S",
61+
"dest_file" : "rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_GCC/TARGET_M3/irq_cm3.S"
6662
},
6763
{
68-
"cmsis_file" : "CMSIS/RTOS2/RTX/Source/GCC/irq_armv8mml.S",
69-
"mbed_file" : "rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_GCC/TARGET_M33/irq_armv8mml.S"
64+
"src_file" : "CMSIS/RTOS2/RTX/Source/GCC/irq_armv8mml.S",
65+
"dest_file" : "rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_GCC/TARGET_M33/irq_armv8mml.S"
7066
},
7167
{
72-
"cmsis_file" : "CMSIS/RTOS2/RTX/Source/GCC/irq_cm4f.S",
73-
"mbed_file" : "rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_GCC/TARGET_RTOS_M4_M7/irq_cm4f.S"
68+
"src_file" : "CMSIS/RTOS2/RTX/Source/GCC/irq_cm4f.S",
69+
"dest_file" : "rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_GCC/TARGET_RTOS_M4_M7/irq_cm4f.S"
7470
},
7571
{
76-
"cmsis_file" : "CMSIS/RTOS2/RTX/Source/GCC/irq_ca.S",
77-
"mbed_file" : "rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_GCC/TARGET_CORTEX_A/irq_ca.S"
72+
"src_file" : "CMSIS/RTOS2/RTX/Source/GCC/irq_ca.S",
73+
"dest_file" : "rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_GCC/TARGET_CORTEX_A/irq_ca.S"
7874
},
7975
{
80-
"cmsis_file" : "CMSIS/RTOS2/RTX/Source/IAR/irq_cm0.S",
81-
"mbed_file" : "rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_IAR/TARGET_M0/irq_cm0.S"
76+
"src_file" : "CMSIS/RTOS2/RTX/Source/IAR/irq_cm0.S",
77+
"dest_file" : "rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_IAR/TARGET_M0/irq_cm0.S"
8278
},
8379
{
84-
"cmsis_file" : "CMSIS/RTOS2/RTX/Source/IAR/irq_cm0.S",
85-
"mbed_file" : "rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_IAR/TARGET_M0P/irq_cm0.S"
80+
"src_file" : "CMSIS/RTOS2/RTX/Source/IAR/irq_cm0.S",
81+
"dest_file" : "rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_IAR/TARGET_M0P/irq_cm0.S"
8682
},
8783
{
88-
"cmsis_file" : "CMSIS/RTOS2/RTX/Source/IAR/irq_armv8mbl_common.S",
89-
"mbed_file" : "rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_IAR/TARGET_M23/irq_armv8mbl_common.S"
84+
"src_file" : "CMSIS/RTOS2/RTX/Source/IAR/irq_armv8mbl_common.S",
85+
"dest_file" : "rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_IAR/TARGET_M23/irq_armv8mbl_common.S"
9086
},
9187
{
92-
"cmsis_file" : "CMSIS/RTOS2/RTX/Source/IAR/irq_cm3.S",
93-
"mbed_file" : "rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_IAR/TARGET_M3/irq_cm3.S"
88+
"src_file" : "CMSIS/RTOS2/RTX/Source/IAR/irq_cm3.S",
89+
"dest_file" : "rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_IAR/TARGET_M3/irq_cm3.S"
9490
},
9591
{
96-
"cmsis_file" : "CMSIS/RTOS2/RTX/Source/IAR/irq_armv8mml_common.S",
97-
"mbed_file" : "rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_IAR/TARGET_M33/irq_armv8mml_common.S"
92+
"src_file" : "CMSIS/RTOS2/RTX/Source/IAR/irq_armv8mml_common.S",
93+
"dest_file" : "rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_IAR/TARGET_M33/irq_armv8mml_common.S"
9894
},
9995
{
100-
"cmsis_file" : "CMSIS/RTOS2/RTX/Source/IAR/irq_cm4f.S",
101-
"mbed_file" : "rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_IAR/TARGET_RTOS_M4_M7/irq_cm4f.S"
96+
"src_file" : "CMSIS/RTOS2/RTX/Source/IAR/irq_cm4f.S",
97+
"dest_file" : "rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_IAR/TARGET_RTOS_M4_M7/irq_cm4f.S"
10298
},
10399
{
104-
"cmsis_file" : "CMSIS/RTOS2/RTX/Source/IAR/irq_ca.S",
105-
"mbed_file" : "rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_IAR/TARGET_CORTEX_A/irq_ca.S"
100+
"src_file" : "CMSIS/RTOS2/RTX/Source/IAR/irq_ca.S",
101+
"dest_file" : "rtos/TARGET_CORTEX/rtx5/RTX/Source/TOOLCHAIN_IAR/TARGET_CORTEX_A/irq_ca.S"
106102
}
107103
],
108104
"folders" : [
109105
{
110-
"cmsis_folder" : "CMSIS/Core/Include/",
111-
"mbed_folder" : "cmsis/TARGET_CORTEX_M/"
106+
"src_folder" : "CMSIS/Core/Include/",
107+
"dest_folder" : "cmsis/TARGET_CORTEX_M/"
112108
},
113109
{
114-
"cmsis_folder" : "CMSIS/RTOS2/Include/",
115-
"mbed_folder" : "rtos/TARGET_CORTEX/rtx5/Include/"
110+
"src_folder" : "CMSIS/RTOS2/Include/",
111+
"dest_folder" : "rtos/TARGET_CORTEX/rtx5/Include/"
116112
},
117113
{
118-
"cmsis_folder" : "CMSIS/RTOS2/RTX/Include1/",
119-
"mbed_folder" : "rtos/TARGET_CORTEX/rtx4/"
114+
"src_folder" : "CMSIS/RTOS2/RTX/Include1/",
115+
"dest_folder" : "rtos/TARGET_CORTEX/rtx4/"
120116
},
121117
{
122-
"cmsis_folder" : "CMSIS/RTOS2/RTX/Include/",
123-
"mbed_folder" : "rtos/TARGET_CORTEX/rtx5/RTX/Include/"
118+
"src_folder" : "CMSIS/RTOS2/RTX/Include/",
119+
"dest_folder" : "rtos/TARGET_CORTEX/rtx5/RTX/Include/"
124120
},
125121
{
126-
"cmsis_folder" : "CMSIS/RTOS2/RTX/Source/",
127-
"mbed_folder" : "rtos/TARGET_CORTEX/rtx5/RTX/Source/"
122+
"src_folder" : "CMSIS/RTOS2/RTX/Source/",
123+
"dest_folder" : "rtos/TARGET_CORTEX/rtx5/RTX/Source/"
128124
},
129125
{
130-
"cmsis_folder" : "CMSIS/RTOS2/RTX/Source/",
131-
"mbed_folder" : "rtos/TARGET_CORTEX/rtx5/RTX/Source/"
126+
"src_folder" : "CMSIS/RTOS2/RTX/Source/",
127+
"dest_folder" : "rtos/TARGET_CORTEX/rtx5/RTX/Source/"
132128
},
133129
{
134-
"cmsis_folder" : "CMSIS/Core_A/Include/",
135-
"mbed_folder" : "cmsis/TARGET_CORTEX_A/"
130+
"src_folder" : "CMSIS/Core_A/Include/",
131+
"dest_folder" : "cmsis/TARGET_CORTEX_A/"
136132
},
137133
{
138-
"cmsis_folder" : "CMSIS/Core_A/Source/",
139-
"mbed_folder" : "cmsis/TARGET_CORTEX_A/"
134+
"src_folder" : "CMSIS/Core_A/Source/",
135+
"dest_folder" : "cmsis/TARGET_CORTEX_A/"
140136
}
141137
],
142-
"Mbed_sha" : [
138+
"commit_sha" : [
143139
"428acae1b2ac15c3ad523e8d40755a9301220822",
144140
"d9d622afe0ca8c7ab9d24c17f9fe59b54dcc61c9",
145141
"a1fcd36be8ee00aba2c9c1b079f5728368922bc8",
146142
"f3db103d481d8729950414868cfc8123b8055601",
147143
"c07cc6b0f42ff4fe215aa1641a043e205d9128a5",
148144
"dd8fdf4c768e5fef3a7ce2e014de4339dbafe5ce",
149-
"2a837ea97900cc30f82e5a23b95b3f293d17eae1"
145+
"2a837ea97900cc30f82e5a23b95b3f293d17eae1",
146+
"c03b3f9eedab7cb0732d1519c4f1a8d90b08eede",
147+
"314a9eb559752132a89b0dbd986db960b3ab9055",
148+
"e83fd0099a69e6eb865e4e6fcadbfb1328c04c85",
149+
"a019acaf8d6fb1f0512414d072f667cc2749b1d9",
150+
"a884fdc0639ae4e17299838ec9de4fddd83cf93c",
151+
"6c827cb5879bc096e45efd992dfadcb96c1d50bc"
150152
]
151153
}
152154

0 commit comments

Comments
 (0)