Skip to content

Commit a7e5c80

Browse files
nxpyandldmbrossard
authored andcommitted
Add MIMXRT1170-EVK board support
Signed-off-by: Alex Yang <[email protected]> Signed-off-by: Adrian Negreanu <[email protected]>
1 parent c89c629 commit a7e5c80

File tree

6 files changed

+191
-2
lines changed

6 files changed

+191
-2
lines changed

projects.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,10 @@ projects:
462462
- *module_if
463463
- *module_hic_lpc4322
464464
- records/board/lpc55S69xpresso.yaml
465+
lpc4322_mimxrt1170_evk_qspi_if:
466+
- *module_if
467+
- *module_hic_lpc4322
468+
- records/board/mimxrt1170_evk_qspi.yaml
465469
lpc55s69_mculink_bl:
466470
- *module_bl
467471
- records/hic_hal/lpc55s69.yaml
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
common:
2+
macros:
3+
- SOFT_RESET=VECTRESET
4+
includes:
5+
- source/family/nxp/mimxrt1170_spi_flash
6+
sources:
7+
board:
8+
- source/board/mimxrt1170_evk.c
9+
target:
10+
- source/family/nxp/mimxrt1170_spi_flash/target.c
11+
- source/family/freescale/target_reset_mimxrt.c

source/board/mimxrt1170_evk.c

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/**
2+
* @file mimxrt1170_evk.c
3+
* @brief board ID for the NXP MIMXRT1170-EVK board.
4+
*
5+
* DAPLink Interface Firmware
6+
* Copyright (c) 2020 - 2021 NXP, All Rights Reserved
7+
* SPDX-License-Identifier: Apache-2.0
8+
*
9+
* Licensed under the Apache License, Version 2.0 (the "License"); you may
10+
* not use this file except in compliance with the License.
11+
* You may obtain a copy of the License at
12+
*
13+
* http://www.apache.org/licenses/LICENSE-2.0
14+
*
15+
* Unless required by applicable law or agreed to in writing, software
16+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
17+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
* See the License for the specific language governing permissions and
19+
* limitations under the License.
20+
*/
21+
22+
#include "target_board.h"
23+
#include "target_family.h"
24+
25+
const board_info_t g_board_info = {
26+
.info_version = kBoardInfoVersion,
27+
.board_id = "0244",
28+
.family_id = kNXP_Mimxrt_FamilyID,
29+
.flags = kEnablePageErase,
30+
.daplink_url_name = "PRODINFOHTM",
31+
.daplink_drive_name = "RT1170-EVK",
32+
.daplink_target_url = "http://www.nxp.com/imxrt1170evk",
33+
.target_cfg = &target_device,
34+
};

source/family/freescale/target_reset_mimxrt.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121

2222
#include "swd_host.h"
2323
#include "info.h"
24+
#include "target_config.h"
2425
#include "target_family.h"
2526
#include "cmsis_os2.h"
2627

@@ -49,12 +50,16 @@ static uint8_t validate_bin_nvic(const uint8_t *buf)
4950
{
5051
if(buf[0] == 'F' && buf[1] == 'C' && buf[2] == 'F' && buf[3] == 'B')
5152
{
53+
target_device.flash_regions[0].start = 0x30000400;
5254
return 1;
5355
}
54-
else
56+
else if(buf[0] == 0xFF && buf[1] == 0xFF && buf[2] == 0xFF && buf[3] == 0xFF)
5557
{
56-
return 0;
58+
target_device.flash_regions[0].start = 0x30000000;
59+
return 1;
5760
}
61+
62+
return 0;
5863
}
5964

6065
const target_family_descriptor_t g_nxp_mimxrt = {
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
/* Flash OS Routines (Automagically Generated)
2+
* Copyright (c) 2020 - 2021 NXP, All Rights Reserved
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
static const uint32_t DAPLINK_RT1170_flash_prog_blob[] = {
18+
0xE00ABE00, 0x062D780D, 0x24084068, 0xD3000040, 0x1E644058, 0x1C49D1FA, 0x2A001E52, 0x4770D1F2,
19+
0x4770ba40, 0x4770ba40, 0x4770bac0, 0x4770bac0, 0x49414770, 0x4449b510, 0x460a483e, 0x493f6008,
20+
0x44492001, 0xf894f000, 0xd1062800, 0x2001493b, 0xf0004449, 0x2800f878, 0x2001d000, 0x2000bd10,
21+
0xb5704770, 0x460d4613, 0x4604460a, 0x46184601, 0xf8b2f000, 0xd0012800, 0xbd702000, 0xbd701960,
22+
0x4f2db5f8, 0x4d2e2600, 0x4634444f, 0x444d1f3f, 0x492a6c6b, 0x43604618, 0x44491982, 0xf0002001,
23+
0x1c64f86d, 0x2c806038, 0xbdf8dbf2, 0x0107b5f8, 0x093f4e23, 0x444e2400, 0x4628e00d, 0x491f4360,
24+
0x462b19c2, 0x20014449, 0xf858f000, 0x4449491a, 0x1c641f09, 0x6c756008, 0x46292001, 0xf0000300,
25+
0x42a0f8a8, 0x4814d8e9, 0x1f004448, 0xbdf86800, 0x0106b570, 0x09364812, 0x6c444448, 0x46214615,
26+
0xf0004630, 0x2900f896, 0x490cd106, 0x46324623, 0x20014449, 0xf832f000, 0x462b4908, 0x44494632,
27+
0xf0002001, 0x4904f816, 0x1f094449, 0xbd706008, 0x00004770, 0xc0000005, 0x00000008, 0x00000010,
28+
0x00000190, 0x22214770, 0x69d20412, 0x685268d2, 0xb4304710, 0x04242421, 0x68e469e4, 0x46a468a4,
29+
0x4760bc30, 0x04122221, 0x68d269d2, 0x471068d2, 0x041b2321, 0x68db69db, 0x47186a5b, 0x2421b430,
30+
0x69e40424, 0x692468e4, 0xbc3046a4, 0xb5384760, 0x94009c04, 0x04242421, 0x68e469e4, 0x47a06964,
31+
0xb430bd38, 0x04242421, 0x68e469e4, 0x46a46a24, 0x4760bc30, 0x04122221, 0x68d269d2, 0x471069d2,
32+
0x04092121, 0x68c969c9, 0x47086989, 0x04122221, 0x68d269d2, 0x47106b92, 0xb5104603, 0x079b430b,
33+
0x2a04d10f, 0xc808d30d, 0x1f12c910, 0xd0f842a3, 0xba21ba18, 0xd9014288, 0xbd102001, 0x43c02000,
34+
0x2a00bd10, 0x07d3d003, 0x1c52d003, 0x2000e007, 0x7803bd10, 0x1c40780c, 0x1b1b1c49, 0x7803d107,
35+
0x1c40780c, 0x1b1b1c49, 0x1e92d101, 0x4618d1f1, 0x2200bd10, 0x428b0903, 0x0a03d32c, 0xd311428b,
36+
0x469c2300, 0x4603e04e, 0xd43c430b, 0x08432200, 0xd331428b, 0x428b0903, 0x0a03d31c, 0xd301428b,
37+
0xe03f4694, 0x428b09c3, 0x01cbd301, 0x41521ac0, 0x428b0983, 0x018bd301, 0x41521ac0, 0x428b0943,
38+
0x014bd301, 0x41521ac0, 0x428b0903, 0x010bd301, 0x41521ac0, 0x428b08c3, 0x00cbd301, 0x41521ac0,
39+
0x428b0883, 0x008bd301, 0x41521ac0, 0x428b0843, 0x004bd301, 0x41521ac0, 0xd2001a41, 0x41524601,
40+
0x47704610, 0x0fcae05d, 0x4249d000, 0xd3001003, 0x40534240, 0x469c2200, 0x428b0903, 0x0a03d32d,
41+
0xd312428b, 0x018922fc, 0x0a03ba12, 0xd30c428b, 0x11920189, 0xd308428b, 0x11920189, 0xd304428b,
42+
0xd03a0189, 0xe0001192, 0x09c30989, 0xd301428b, 0x1ac001cb, 0x09834152, 0xd301428b, 0x1ac0018b,
43+
0x09434152, 0xd301428b, 0x1ac0014b, 0x09034152, 0xd301428b, 0x1ac0010b, 0x08c34152, 0xd301428b,
44+
0x1ac000cb, 0x08834152, 0xd301428b, 0x1ac0008b, 0xd2d94152, 0x428b0843, 0x004bd301, 0x41521ac0,
45+
0xd2001a41, 0x46634601, 0x105b4152, 0xd3014610, 0x2b004240, 0x4249d500, 0x46634770, 0xd300105b,
46+
0xb5014240, 0x46c02000, 0xbd0246c0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
47+
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
48+
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
49+
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
50+
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
51+
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
52+
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
53+
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
54+
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
55+
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
56+
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
57+
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
58+
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
59+
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
60+
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
61+
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
62+
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000
63+
};
64+
65+
// Start address of flash
66+
static const uint32_t flash_start = 0x30000000;
67+
// Size of flash
68+
static const uint32_t flash_size = 0x00800000;
69+
70+
/**
71+
* List of start and size for each size of flash sector - even indexes are start, odd are size
72+
* The size will apply to all sectors between the listed address and the next address
73+
* in the list.
74+
* The last pair in the list will have sectors starting at that address and ending
75+
* at address flash_start + flash_size.
76+
*/
77+
static const sector_info_t sectors_info[] = {
78+
{0x30000000, 0x00001000},
79+
};
80+
81+
static const program_target_t flash = {
82+
0x20000033, // .init
83+
0x2000005f, // .uninit
84+
0x20000081, // .erase_chip
85+
0x200000ad, // .erase_sector
86+
0x200000f1, // .program_page
87+
0x0, // .verify
88+
{ // .sys_call_s
89+
0x20000001, // .breakpoint : start of blob + 1
90+
0x2000038C, // .static_base : blob start + header + rw data offset
91+
0x20002800 // .stack_pointer
92+
},
93+
0x20000000 + 0x00003000, // mem buffer location
94+
0x20000000, // location to write prog_blob in target RAM
95+
sizeof(DAPLINK_RT1170_flash_prog_blob), // prog_blob size
96+
DAPLINK_RT1170_flash_prog_blob, // address of prog_blob
97+
0x00000100 // .algo_flags: ram_to_flash_bytes_to_be_written
98+
};
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/**
2+
* @file target.c
3+
* @brief Target information for the NXP MIMXRT1170-EVK board.
4+
*
5+
* DAPLink Interface Firmware
6+
* Copyright (c) 2020 - 2021 NXP, All Rights Reserved
7+
* SPDX-License-Identifier: Apache-2.0
8+
*
9+
* Licensed under the Apache License, Version 2.0 (the "License"); you may
10+
* not use this file except in compliance with the License.
11+
* You may obtain a copy of the License at
12+
*
13+
* http://www.apache.org/licenses/LICENSE-2.0
14+
*
15+
* Unless required by applicable law or agreed to in writing, software
16+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
17+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18+
* See the License for the specific language governing permissions and
19+
* limitations under the License.
20+
*/
21+
22+
#include "target_config.h"
23+
24+
// The file flash_blob.c must only be included in target.c
25+
#include "flash_blob.c"
26+
27+
// target information
28+
target_cfg_t target_device = {
29+
.sectors_info = sectors_info,
30+
.sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)),
31+
.flash_regions[0].start = 0x30000000,
32+
.flash_regions[0].end = 0x30000000 + MB(64),
33+
.flash_regions[0].flags = kRegionIsDefault,
34+
.flash_regions[0].flash_algo = (program_target_t *) &flash,
35+
.ram_regions[0].start = 0x30000000,
36+
.ram_regions[0].end = 0x30000000 + MB(64),
37+
};

0 commit comments

Comments
 (0)