Skip to content

Commit 0f1a603

Browse files
mbrossardmathias-arm
authored andcommitted
Add lpc4337xpresso interface project
1 parent 2457a1b commit 0f1a603

File tree

6 files changed

+181
-0
lines changed

6 files changed

+181
-0
lines changed

projects.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,10 @@ projects:
465465
- *module_if
466466
- *module_hic_lpc4322
467467
- records/board/hani_iot.yaml
468+
lpc4322_lpc4337xpresso_if:
469+
- *module_if
470+
- *module_hic_lpc4322
471+
- records/board/lpc4337xpresso.yaml
468472
lpc4322_lpc54114xpresso_if:
469473
- *module_if
470474
- *module_hic_lpc4322

records/board/lpc4337xpresso.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
common:
2+
sources:
3+
board:
4+
- source/board/lpc4337xpresso.c
5+
family:
6+
- source/family/nxp/lpc43xx/target_lpc4337.c

source/board/lpc4337xpresso.c

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/**
2+
* @file lpc4337xpresso.c
3+
* @brief board ID for the NXP LPC4337Xpresso board
4+
*
5+
* DAPLink Interface Firmware
6+
* Copyright (c) 2022, Arm Limited, 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_family.h"
23+
#include "target_board.h"
24+
25+
const board_info_t g_board_info = {
26+
.info_version = kBoardInfoVersion,
27+
.board_id = "4337",
28+
.family_id = kStub_HWReset_FamilyID,
29+
.daplink_url_name = "PRODINFOHTM",
30+
.daplink_drive_name = "LPC4337",
31+
.daplink_target_url = "https://os.mbed.com/platforms/LPCXpresso4337/",
32+
.target_cfg = &target_device,
33+
.board_vendor = "NXP",
34+
.board_name = "LPC4337Xpresso",
35+
};
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
/* Flash algorithm for LPC18xx/43xx IAP 512kB Flash Bank A/B
2+
*
3+
* DAPLink Interface Firmware
4+
* Copyright (c) 2009-2022 Arm Limited, All Rights Reserved
5+
* SPDX-License-Identifier: Apache-2.0
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*/
19+
20+
// Generated from 'LPC18xx43xx_512_BA.FLM' (LPC18xx/43xx IAP 512kB Flash Bank A)
21+
// and 'LPC18xx43xx_512_BB.FLM' (LPC18xx/43xx IAP 512kB Flash Bank B)
22+
// Originating from 'Keil.LPC4300_DFP.2.9.0.pack'
23+
// digest = 61c40f68a6d637e3be566d503ac3f8dba13b6f39c7caae1a268f8945e468bd3f, file size = 12560
24+
// algo version = 0x101, algo size = 452 (0x1c4)
25+
static const uint32_t LPC18xx43xx_512_flash_prog_blob[] = {
26+
0xe7fdbe00,
27+
0x0e400300, 0xd3012807, 0x1dc008c0, 0xb5704770, 0x220d4956, 0x06524449, 0x42906048, 0x2001d001,
28+
0x2000e000, 0x4a536088, 0x62d04851, 0x4c534852, 0x444c6008, 0x4e522031, 0x46216020, 0x68323118,
29+
0x4620460d, 0x20004790, 0x203661a0, 0x68326020, 0x46204629, 0x69a04790, 0xd0002800, 0xbd702001,
30+
0x47702000, 0x4c45b5f8, 0x444c2032, 0x270e2600, 0x4d3ec4c1, 0x444d4621, 0x602068a8, 0x310c4840,
31+
0x483e6802, 0x44483c0c, 0x47909100, 0x280069a0, 0x2034d10f, 0x6828c4c1, 0x68a86020, 0x48386060,
32+
0x68023c0c, 0x99004835, 0x47904448, 0x280069a0, 0x2001d000, 0xb5f8bdf8, 0xffa2f7ff, 0x46044d2f,
33+
0x444d2032, 0x4e29c511, 0x444e602c, 0x606868b0, 0x46294f2b, 0x48293110, 0x4448683a, 0x91003d08,
34+
0x69a84790, 0xd10f2800, 0xc5112034, 0x6830602c, 0x68b06068, 0x482160a8, 0x4448683a, 0x99003d08,
35+
0x69a84790, 0xd0002800, 0xbdf82001, 0xb082b5f7, 0xf7ff4607, 0x4c19ff75, 0x444c2132, 0x60216060,
36+
0x60a04d12, 0x68a8444d, 0x60e04e15, 0x31184621, 0x46206832, 0x47909100, 0x280069a0, 0x2033d113,
37+
0x9804c481, 0x20016020, 0x60600280, 0x60a06828, 0x60e068a8, 0x68324809, 0x3c084448, 0x47909900,
38+
0x280069a0, 0x2001d000, 0xbdf0b005, 0x00000004, 0x01000800, 0x40050040, 0x00002ee0, 0x00000010,
39+
0x10400100, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
40+
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000
41+
};
42+
43+
// Start address of flash
44+
static const uint32_t flash_start = 0x1a000000;
45+
// Size of flash
46+
static const uint32_t flash_size = 0x00080000;
47+
48+
/**
49+
* List of start and size for each size of flash sector - even indexes are start, odd are size
50+
* The size will apply to all sectors between the listed address and the next address
51+
* in the list.
52+
* The last pair in the list will have sectors starting at that address and ending
53+
* at address flash_start + flash_size.
54+
*/
55+
static const sector_info_t sectors_info[] = {
56+
{0x1a000000, 0x00002000},
57+
{0x1a010000, 0x00010000},
58+
{0x1b000000, 0x00002000},
59+
{0x1b010000, 0x00010000},
60+
};
61+
62+
static const program_target_t flash = {
63+
0x20000013, // Init
64+
0x20000065, // UnInit
65+
0x20000069, // EraseChip
66+
0x200000bb, // EraseSector
67+
0x20000111, // ProgramPage
68+
0x00000000, // Verify
69+
70+
// BKPT : start of blob + 1
71+
// RSB : blob start + header + rw data offset
72+
// RSP : stack pointer
73+
{
74+
0x20000001,
75+
0x20000188,
76+
0x20000c00
77+
},
78+
79+
// mem buffer location
80+
0x20000c00,
81+
// location to write prog_blob in target RAM
82+
0x20000000,
83+
// prog_blob size
84+
sizeof(LPC18xx43xx_512_flash_prog_blob),
85+
// address of prog_blob
86+
LPC18xx43xx_512_flash_prog_blob,
87+
// ram_to_flash_bytes_to_be_written
88+
0x00000400
89+
};
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/**
2+
* @file target.c
3+
* @brief Target information for the lpc4337
4+
*
5+
* DAPLink Interface Firmware
6+
* Copyright (c) 2022, Arm Limited, 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+
#include "daplink_debug.h"
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+
.version = kTargetConfigVersion,
30+
.sectors_info = sectors_info,
31+
.sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)),
32+
.flash_regions[0].start = 0x1a000000,
33+
.flash_regions[0].end = 0x1a000000 + KB(512),
34+
.flash_regions[0].flags = kRegionIsDefault,
35+
.flash_regions[0].flash_algo = (program_target_t *) &flash,
36+
.flash_regions[1].start = 0x1b000000,
37+
.flash_regions[1].end = 0x1b000000 + KB(512),
38+
.flash_regions[1].flags = 0,
39+
.flash_regions[1].flash_algo = (program_target_t *) &flash,
40+
.ram_regions[0].start = 0x10000000,
41+
.ram_regions[0].end = 0x10008000,
42+
.ram_regions[1].start = 0x20000000,
43+
.ram_regions[1].end = 0x20010000,
44+
.target_vendor = "NXP",
45+
.target_part_number = "LPC4337JET100",
46+
};

test/info.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ def VENDOR_TO_FAMILY(x, y) : return (VENDOR_ID[x] <<8) | y
220220
( 0x1313, VENDOR_TO_FAMILY('Stub', 3), 'm48ssidae_numaker_iot_m467_if', 'm48ssidae_bl', None ),
221221
( 0x2600, VENDOR_TO_FAMILY('Nordic', 2), 'k20dx_ep_agora_if', None, None ),
222222
( 0x2601, VENDOR_TO_FAMILY('NXP', 0), 'k20dx_ep_kairos_if', None, None ),
223+
( 0x4337, VENDOR_TO_FAMILY('Stub', 1), 'lpc4322_lpc4337xpresso_if', 'lpc4322_bl', 'LPCXpresso4337' ),
223224
( 0x4600, VENDOR_TO_FAMILY('Realtek', 1), 'lpc11u35_rtl8195am_if', None, 'REALTEK-RTL8195AM' ),
224225
( 0x5006, VENDOR_TO_FAMILY('Stub', 1), 'lpc11u35_musca_a_if', None, 'ARM_MUSCA_A1' ),
225226
( 0x5007, VENDOR_TO_FAMILY('Stub', 1), 'lpc11u35_musca_b_if', None, 'ARM_MUSCA_B1' ),

0 commit comments

Comments
 (0)