Skip to content

Commit 08f3402

Browse files
Merge pull request #5407 from deepikabhavnani/importer_script
Python script to add cmsis/rtx changes in mbed-os
2 parents 41dcd25 + d4f7291 commit 08f3402

File tree

4 files changed

+459
-1
lines changed

4 files changed

+459
-1
lines changed

tools/importer/README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
## Importing repositories into mbed-os
2+
3+
importer.py script can be used to import code base from different repositories into mbed-os.
4+
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: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
{
2+
"files" : [
3+
{
4+
"src_file" : "CMSIS/Core/Template/ARMv8-M/tz_context.c",
5+
"dest_file" : "cmsis/TARGET_CORTEX_M/mbed_tz_context.c"
6+
},
7+
{
8+
"src_file" : "CMSIS/RTOS2/RTX/Config/handlers.c",
9+
"dest_file" : "rtos/TARGET_CORTEX/rtx5/RTX/Config/TARGET_CORTEX_A/handlers.c"
10+
},
11+
{
12+
"src_file" : "CMSIS/RTOS2/RTX/Config/RTX_Config.h",
13+
"dest_file" : "rtos/TARGET_CORTEX/rtx5/RTX/Config/RTX_Config.h"
14+
},
15+
{
16+
"src_file" : "CMSIS/RTOS2/RTX/Config/RTX_Config.c",
17+
"dest_file" : "rtos/TARGET_CORTEX/rtx5/RTX/Config/RTX_Config.c"
18+
},
19+
{
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"
22+
},
23+
{
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"
26+
},
27+
{
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"
30+
},
31+
{
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"
34+
},
35+
{
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"
38+
},
39+
{
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"
42+
},
43+
{
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"
46+
},
47+
{
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"
50+
},
51+
{
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"
54+
},
55+
{
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"
58+
},
59+
{
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"
62+
},
63+
{
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"
66+
},
67+
{
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"
70+
},
71+
{
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"
74+
},
75+
{
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"
78+
},
79+
{
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"
82+
},
83+
{
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"
86+
},
87+
{
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"
90+
},
91+
{
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"
94+
},
95+
{
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"
98+
},
99+
{
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"
102+
}
103+
],
104+
"folders" : [
105+
{
106+
"src_folder" : "CMSIS/Core/Include/",
107+
"dest_folder" : "cmsis/TARGET_CORTEX_M/"
108+
},
109+
{
110+
"src_folder" : "CMSIS/RTOS2/Include/",
111+
"dest_folder" : "rtos/TARGET_CORTEX/rtx5/Include/"
112+
},
113+
{
114+
"src_folder" : "CMSIS/RTOS2/RTX/Include1/",
115+
"dest_folder" : "rtos/TARGET_CORTEX/rtx4/"
116+
},
117+
{
118+
"src_folder" : "CMSIS/RTOS2/RTX/Include/",
119+
"dest_folder" : "rtos/TARGET_CORTEX/rtx5/RTX/Include/"
120+
},
121+
{
122+
"src_folder" : "CMSIS/RTOS2/RTX/Source/",
123+
"dest_folder" : "rtos/TARGET_CORTEX/rtx5/RTX/Source/"
124+
},
125+
{
126+
"src_folder" : "CMSIS/RTOS2/RTX/Source/",
127+
"dest_folder" : "rtos/TARGET_CORTEX/rtx5/RTX/Source/"
128+
},
129+
{
130+
"src_folder" : "CMSIS/Core_A/Include/",
131+
"dest_folder" : "cmsis/TARGET_CORTEX_A/"
132+
},
133+
{
134+
"src_folder" : "CMSIS/Core_A/Source/",
135+
"dest_folder" : "cmsis/TARGET_CORTEX_A/"
136+
}
137+
],
138+
"commit_sha" : [
139+
"428acae1b2ac15c3ad523e8d40755a9301220822",
140+
"d9d622afe0ca8c7ab9d24c17f9fe59b54dcc61c9",
141+
"a1fcd36be8ee00aba2c9c1b079f5728368922bc8",
142+
"f3db103d481d8729950414868cfc8123b8055601",
143+
"c07cc6b0f42ff4fe215aa1641a043e205d9128a5",
144+
"dd8fdf4c768e5fef3a7ce2e014de4339dbafe5ce",
145+
"2a837ea97900cc30f82e5a23b95b3f293d17eae1",
146+
"c03b3f9eedab7cb0732d1519c4f1a8d90b08eede",
147+
"314a9eb559752132a89b0dbd986db960b3ab9055",
148+
"e83fd0099a69e6eb865e4e6fcadbfb1328c04c85",
149+
"a019acaf8d6fb1f0512414d072f667cc2749b1d9",
150+
"a884fdc0639ae4e17299838ec9de4fddd83cf93c",
151+
"6c827cb5879bc096e45efd992dfadcb96c1d50bc"
152+
]
153+
}
154+

0 commit comments

Comments
 (0)