Skip to content

Commit 6ccf584

Browse files
authored
Merge pull request #962 from Hoohaha/feat/imxrt106x
add support for NXP mimxrt1060 and mimxrt1064
2 parents 25fe0db + 91c34fd commit 6ccf584

File tree

9 files changed

+519030
-31
lines changed

9 files changed

+519030
-31
lines changed

pyocd/board/board_ids.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,10 @@ def __init__(self, name, target, binary):
5050
"0226": BoardInfo( "MIMXRT1020-EVK", "mimxrt1020", "l1_mimxrt1020-evk.bin",),
5151
"0227": BoardInfo( "MIMXRT1050-EVKB", "mimxrt1050_hyperflash", "l1_mimxrt1050-evkb_hyperflash.bin",),
5252
"0228": BoardInfo( "Rapid-IoT-K64F", "k64f", None, ),
53+
"0229": BoardInfo( "MIMXRT1060-EVK", "mimxrt1060", 'evkmimxrt1060.bin', ),
5354
"0230": BoardInfo( "FRDM-K20D50M", "k20d50m", "l1_k20d50m.bin", ),
5455
"0231": BoardInfo( "FRDM-K22F", "k22f", "l1_k22f.bin", ),
55-
"0232": BoardInfo( "MIMXRT1064-EVK", "mimxrt1064cvl5a", None, ),
56+
"0232": BoardInfo( "MIMXRT1064-EVK", "mimxrt1064", 'evkmimxrt1064.bin', ),
5657
"0233": BoardInfo( "FRDM-KE16Z", "mke16z64vlf4", None, ),
5758
"0234": BoardInfo( "Rapid-IoT-KW41Z", "kw41z4", "l1_kw41z4.bin", ),
5859
"0235": BoardInfo( "LPC54018IoTModule", "lpc54018jet180", None, ),

pyocd/debug/svd/data/MIMXRT1062.xml

Lines changed: 260023 additions & 0 deletions
Large diffs are not rendered by default.

pyocd/debug/svd/data/MIMXRT1064.xml

Lines changed: 258663 additions & 0 deletions
Large diffs are not rendered by default.

pyocd/target/builtin/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
from . import target_MIMXRT1021xxxxx
2222
from . import target_MIMXRT1024xxxxx
2323
from . import target_MIMXRT1052xxxxB
24+
from . import target_MIMXRT1062xxxxA
25+
from . import target_MIMXRT1064xxxxA
2426
from . import target_MKE15Z256xxx7
2527
from . import target_MKE18F256xxx16
2628
from . import target_MKL02Z32xxx4
@@ -153,6 +155,8 @@
153155
'mimxrt1050_quadspi': target_MIMXRT1052xxxxB.MIMXRT1052xxxxB_quadspi,
154156
'mimxrt1050_hyperflash': target_MIMXRT1052xxxxB.MIMXRT1052xxxxB_hyperflash,
155157
'mimxrt1050': target_MIMXRT1052xxxxB.MIMXRT1052xxxxB_hyperflash, # Alias for default external flash.
158+
'mimxrt1060': target_MIMXRT1062xxxxA.MIMXRT1062xxxxA,
159+
'mimxrt1064': target_MIMXRT1064xxxxA.MIMXRT1064xxxxA,
156160
'nrf51': target_nRF51822_xxAA.NRF51,
157161
'nrf52': target_nRF52832_xxAA.NRF52832,
158162
'nrf52840' : target_nRF52840_xxAA.NRF52840,
Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
# pyOCD debugger
2+
# Copyright (c) 2017 NXP
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
from ...flash.flash import Flash
18+
from ...coresight.coresight_target import CoreSightTarget
19+
from ...core.memory_map import (FlashRegion, RomRegion, RamRegion, MemoryMap)
20+
from ...debug.svd.loader import SVDFile
21+
from ..family.target_imxrt import IMXRT
22+
23+
FLASH_ALGO = {
24+
'load_address' : 0x20000000,
25+
26+
# Flash algorithm as a hex string
27+
'instructions': [
28+
0xE00ABE00, 0x062D780D, 0x24084068, 0xD3000040, 0x1E644058, 0x1C49D1FA, 0x2A001E52, 0x4770D1F2,
29+
0x4770ba40, 0x4770ba40, 0x4770ba40, 0x4770bac0, 0x4770bac0, 0x4770bac0, 0x4855b51c, 0x48559000,
30+
0x08498901, 0x81010049, 0x890a4953, 0x00520852, 0x8802810a, 0x07522304, 0xda022a00, 0x439a8802,
31+
0x88088002, 0xd5020740, 0x43988808, 0x484c8008, 0x6041494a, 0x6081494b, 0x22806801, 0x22204391,
32+
0x60014311, 0xf8a8f000, 0x68014847, 0xd54503c9, 0x60014946, 0x29006801, 0x6b01dafc, 0x03122201,
33+
0x63014391, 0x29006b01, 0x4a42dafc, 0x60114940, 0x03092103, 0x69016101, 0xdafc2900, 0x22016901,
34+
0x43910412, 0x4b3b6101, 0x3b40493b, 0x493b6319, 0x610b2301, 0x4c3a694b, 0x00544023, 0x2405191b,
35+
0x43230264, 0x698b614b, 0x40234c36, 0x04a42403, 0x4c35191b, 0x618b4323, 0x4c3469cb, 0x24034023,
36+
0x191b0764, 0x43234c32, 0x680161cb, 0x60014391, 0x43916b01, 0x69016301, 0x61014391, 0x466a492d,
37+
0x20004449, 0xf9d3f000, 0xd1052800, 0x44494929, 0xf9b8f000, 0xd0002800, 0xbd1c2001, 0x47702000,
38+
0xb5104924, 0x20004449, 0xf9bbf000, 0xd0002800, 0xbd102001, 0x07492105, 0x491e1842, 0x2301b510,
39+
0x4449041b, 0xf0002000, 0x2800f9b8, 0x2001d000, 0x2105bd10, 0x07494613, 0x49161842, 0x4449b510,
40+
0xf0002000, 0x2800f995, 0x2001d000, 0x0000bd10, 0xc0000006, 0x400b8000, 0x400d0000, 0xd928c520,
41+
0x400bc000, 0x0000ffff, 0x400d8000, 0x00012018, 0x18131818, 0x400d8100, 0x0f1a2323, 0x400fc000,
42+
0xfff8e0ff, 0x1ff3fcff, 0xe0000100, 0x9c7fff80, 0x03800001, 0x0000000c, 0x49d42001, 0x69c00540,
43+
0x60084449, 0x4ad14770, 0x6812444a, 0x68526992, 0x49ce4710, 0x68094449, 0x68896989, 0x4acb4708,
44+
0x6812444a, 0x68d26992, 0x49c84710, 0x68094449, 0x69096989, 0x4ac54708, 0x6812444a, 0x69526992,
45+
0x49c24710, 0x68094449, 0x69896989, 0x49bf4708, 0x68094449, 0x69c96989, 0x49bc4708, 0x68094449,
46+
0x6a096989, 0x4bb94708, 0x681b444b, 0x6a5b699b, 0x48b64718, 0x68004448, 0x6ac06980, 0x48b34700,
47+
0x68004448, 0x6bc06980, 0x49b04700, 0x68094449, 0x6c096989, 0x49ad4708, 0x68094449, 0x6c496989,
48+
0x49aa4708, 0x68094449, 0x6b096989, 0x48a74708, 0x68004448, 0x6b406980, 0x49a44700, 0x68094449,
49+
0x6b896989, 0x48a14708, 0x68004448, 0x6c806980, 0x489e4700, 0x68004448, 0x6cc06980, 0x499b4700,
50+
0x68094449, 0x6a896989, 0x4a984708, 0x6812444a, 0x32806992, 0x47106a52, 0x444a4a94, 0x69926812,
51+
0x6b123280, 0x4a914710, 0x6812444a, 0x32806992, 0x47106a92, 0x4448488d, 0x69806800, 0x6ac03080,
52+
0x498a4700, 0x68094449, 0x6d096989, 0x48874708, 0x68004448, 0x6d406980, 0x49844700, 0x68094449,
53+
0x6d896989, 0x48814708, 0x68004448, 0x6dc06980, 0x497e4700, 0x68094449, 0x6e096989, 0x487b4708,
54+
0x68004448, 0x6e406980, 0x49784700, 0x68094449, 0x6e896989, 0x48754708, 0x68004448, 0x6ec06980,
55+
0x49724700, 0x68094449, 0x6f096989, 0x486f4708, 0x68004448, 0x6f406980, 0x496c4700, 0x68094449,
56+
0x6f896989, 0x48694708, 0x68004448, 0x6fc06980, 0x49664700, 0x68094449, 0x31806989, 0x47086809,
57+
0x44484862, 0x69806800, 0x68403080, 0x495f4700, 0x68094449, 0x31806989, 0x47086889, 0x444a4a5b,
58+
0x69926812, 0x68d23280, 0x49584710, 0x68094449, 0x31806989, 0x47086909, 0x444a4a54, 0x69926812,
59+
0x69523280, 0x49514710, 0x68094449, 0x31806989, 0x47086989, 0x4449494d, 0x69896809, 0x69c93180,
60+
0x494a4708, 0x68094449, 0x31806989, 0x47086a09, 0x444a4a46, 0x69926812, 0x6b523280, 0x48434710,
61+
0x68004448, 0x30806980, 0x47006b80, 0x444a4a3f, 0x69d26812, 0x47106a12, 0x4449493c, 0x69c96809,
62+
0x47086809, 0x444a4a39, 0x69d26812, 0x47106852, 0x44494936, 0x69c96809, 0x47086889, 0x44494933,
63+
0x6a096809, 0x47086809, 0x444a4a30, 0x6a126812, 0x47106852, 0x4449492d, 0x6a096809, 0x47086889,
64+
0x4449492a, 0x6a096809, 0x47086989, 0x444a4a27, 0x6a126812, 0x471069d2, 0x44494924, 0x6a096809,
65+
0x47086ac9, 0x444a4a21, 0x69126812, 0x47106852, 0x4c1eb430, 0x6824444c, 0x68a46924, 0xbc3046a4,
66+
0x4a1a4760, 0x6812444a, 0x68d26912, 0x4b174710, 0x681b444b, 0x6a5b691b, 0xb4304718, 0x444c4c13,
67+
0x69246824, 0x46a46924, 0x4760bc30, 0x9c04b538, 0x4c0e9400, 0x6824444c, 0x69646924, 0xbd3847a0,
68+
0x4c0ab430, 0x6824444c, 0x6a246924, 0xbc3046a4, 0x4a064760, 0x6812444a, 0x69d26912, 0x49034710,
69+
0x68094449, 0x69896909, 0x00004708, 0x00000004, 0xb5104770, 0x89014857, 0x00490849, 0x49568101,
70+
0x0852890a, 0x810a0052, 0x23048802, 0x2a000752, 0x8802da02, 0x8002439a, 0x07408808, 0x8808d502,
71+
0x80084398, 0x494d484e, 0x494e6041, 0x68016081, 0x43912280, 0x43112220, 0x484b6001, 0x07c96901,
72+
0x6901d003, 0x00490849, 0xf7ff6101, 0xbd10ffd1, 0x4d46b5f8, 0x4a466968, 0x01804946, 0x69a8d522,
73+
0x031b2303, 0xd0074018, 0x031b2301, 0xd00c1ac0, 0xd1084298, 0xe0066b10, 0x03c06910, 0xd5066910,
74+
0x0f800400, 0x2000d001, 0x4608e008, 0x0780e006, 0x2016d501, 0x2014e000, 0x43484936, 0x00896969,
75+
0xe03d0f49, 0x03c06810, 0xd5066810, 0x0f800400, 0x2700d001, 0x460fe006, 0x0640e004, 0x0e404b2d,
76+
0x08474358, 0x03c06b10, 0xd5066b10, 0x0f800400, 0x2400d001, 0x460ce008, 0x07c0e006, 0x2416d001,
77+
0x2414e000, 0x43444823, 0x30404821, 0x69006a06, 0xf976f000, 0x23004632, 0xf844f000, 0x190069a9,
78+
0x40114a1d, 0x2201d011, 0x4b1c0492, 0xd0161a89, 0xd0171a89, 0xd1074291, 0x07416928, 0x46380f49,
79+
0xf0001c49, 0xe000f8b0, 0x69692000, 0x0f4904c9, 0xf0001c49, 0x4912f8a8, 0x60084449, 0x6819bdf8,
80+
0xe0000c09, 0x06896819, 0xf0000e89, 0x2112f89c, 0xe7ea4348, 0x400b8000, 0x400d0000, 0xd928c520,
81+
0x400bc000, 0x0000ffff, 0xe000e000, 0x400fc000, 0x400d8000, 0x016e3600, 0x000c0000, 0x400d8100,
82+
0x00000008, 0x4605b5fe, 0x460c4610, 0xd0734318, 0x468c46ae, 0x1aad2000, 0x419c4601, 0x4666d367,
83+
0x24012700, 0x1ab6463d, 0xd302419d, 0x463a4613, 0x46652421, 0x042f4676, 0x433e0c36, 0x1ab60c2d,
84+
0xd304419d, 0x041b0c15, 0x0412432b, 0x46653410, 0x062f4676, 0x433e0a36, 0x1ab60a2d, 0xd304419d,
85+
0x021b0e15, 0x0212432b, 0x46653408, 0x072f4676, 0x433e0936, 0x1ab6092d, 0xd304419d, 0x011b0f15,
86+
0x0112432b, 0x46651d24, 0x07af4676, 0x433e08b6, 0x1ab608ad, 0xd304419d, 0x009b0f95, 0x0092432b,
87+
0x46651ca4, 0x07ef4676, 0x433e0876, 0x1ab6086d, 0xd31a419d, 0x415b1892, 0xe0161c64, 0x46761800,
88+
0x41494665, 0x419d1ab7, 0x90009101, 0x4660d309, 0x41981ab1, 0x4684468e, 0x99019800, 0x1c402500,
89+
0x07dd4169, 0x432a0852, 0x1e64085b, 0x4672d5e6, 0xb0034663, 0xe7ffbdf0, 0x46012000, 0x46c046c0,
90+
0x4623462a, 0x2200e7f5, 0x428b0903, 0x0a03d32c, 0xd311428b, 0x469c2300, 0x4603e04e, 0xd43c430b,
91+
0x08432200, 0xd331428b, 0x428b0903, 0x0a03d31c, 0xd301428b, 0xe03f4694, 0x428b09c3, 0x01cbd301,
92+
0x41521ac0, 0x428b0983, 0x018bd301, 0x41521ac0, 0x428b0943, 0x014bd301, 0x41521ac0, 0x428b0903,
93+
0x010bd301, 0x41521ac0, 0x428b08c3, 0x00cbd301, 0x41521ac0, 0x428b0883, 0x008bd301, 0x41521ac0,
94+
0x428b0843, 0x004bd301, 0x41521ac0, 0xd2001a41, 0x41524601, 0x47704610, 0x0fcae05d, 0x4249d000,
95+
0xd3001003, 0x40534240, 0x469c2200, 0x428b0903, 0x0a03d32d, 0xd312428b, 0x018922fc, 0x0a03ba12,
96+
0xd30c428b, 0x11920189, 0xd308428b, 0x11920189, 0xd304428b, 0xd03a0189, 0xe0001192, 0x09c30989,
97+
0xd301428b, 0x1ac001cb, 0x09834152, 0xd301428b, 0x1ac0018b, 0x09434152, 0xd301428b, 0x1ac0014b,
98+
0x09034152, 0xd301428b, 0x1ac0010b, 0x08c34152, 0xd301428b, 0x1ac000cb, 0x08834152, 0xd301428b,
99+
0x1ac0008b, 0xd2d94152, 0x428b0843, 0x004bd301, 0x41521ac0, 0xd2001a41, 0x46634601, 0x105b4152,
100+
0xd3014610, 0x2b004240, 0x4249d500, 0x46634770, 0xd300105b, 0xb5014240, 0x46c02000, 0xbd0246c0,
101+
0x0c04b5f8, 0x4626b28b, 0x435eb282, 0x46100c0d, 0x43580c37, 0x19800436, 0x41792100, 0x436e4616,
102+
0x04360c37, 0x41791980, 0x436e4626, 0xbdf81989, 0x00000000, 0x00000000, 0x1f78a400, 0x00000000,
103+
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
104+
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
105+
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
106+
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
107+
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
108+
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
109+
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
110+
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
111+
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
112+
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
113+
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
114+
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
115+
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
116+
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
117+
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
118+
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000
119+
],
120+
121+
# Relative function addresses
122+
'pc_init': 0x20000039,
123+
'pc_unInit': 0x2000013d,
124+
'pc_program_page': 0x20000173,
125+
'pc_erase_sector': 0x20000155,
126+
'pc_eraseAll': 0x20000141,
127+
128+
'static_base' : 0x00000000 + 0x00000020 + 0x00000930,
129+
'begin_stack' : 0x20000c00,
130+
'begin_data' : 0x20000000 + 0x1000,
131+
'page_size' : 0x100,
132+
'analyzer_supported' : False,
133+
'analyzer_address' : 0x00000000,
134+
'page_buffers' : [0x20001000, 0x20001100], # Enable double buffering
135+
'min_program_length' : 0x100
136+
}
137+
138+
139+
class MIMXRT1062xxxxA(IMXRT):
140+
141+
VENDOR = "NXP"
142+
143+
# Note: itcm, dtcm, and ocram share a single 512 KB block of RAM that can be configurably
144+
# divided between those regions (this is called FlexRAM). Thus, the memory map regions for
145+
# each of these RAMs allocate the maximum possible of 512 KB, but that is the maximum and
146+
# will not actually be available in all regions simultaneously.
147+
memoryMap = MemoryMap(
148+
RamRegion(name="itcm", start=0x00000000, length=0x80000), # 512 KB
149+
RomRegion(name="romcp", start=0x00200000, length=0x20000),
150+
RamRegion(name="dtcm", start=0x20000000, length=0x80000), # 512 KB
151+
RamRegion(name="ocram", start=0x20200000, length=0x80000), # 512 KB
152+
FlashRegion(name="flexspi", start=0x60000000, length=0x800000, blocksize=0x10000, is_boot_memory=True,
153+
algo=FLASH_ALGO, page_size=0x100),
154+
RamRegion(name="semc", start=0x80000000, length=0x1e00000, is_external=True), # external sdram
155+
)
156+
157+
def __init__(self, link):
158+
super(MIMXRT1062xxxxA, self).__init__(link, self.memoryMap)
159+
self._svd_location = SVDFile.from_builtin("MIMXRT1062.xml")

0 commit comments

Comments
 (0)