Skip to content

Commit ca1bfb2

Browse files
HuanQian571mathias-arm
authored andcommitted
Add support for the NXP LPC845 Breakout board.
On this board the HIC is an LPC11U35 and the target is an LPC845, so the firmware is built from the existing lpc11u35 HIC anchor and only the board and target family layers are new. The LPC84x family shares the LPC82x IAP ROM interface (entry 0x1FFF1FF1) and IAP command model, so the LPC824 flash algorithm applies unchanged. No custom reset or unlock behavior is needed, so the generic kStub_HWReset_FamilyID stub family is used rather than a new target_reset.c. Signed-off-by: Harry Qian <huan.qian@nxp.com>
1 parent b6597d8 commit ca1bfb2

6 files changed

Lines changed: 165 additions & 0 deletions

File tree

projects.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,10 @@ projects:
410410
- *module_if
411411
- *module_hic_lpc11u35
412412
- records/board/lpc824xpresso.yaml
413+
lpc11u35_lpc845breakout_if:
414+
- *module_if
415+
- *module_hic_lpc11u35
416+
- records/board/lpc845breakout.yaml
413417
lpc11u35_mini_iot_lpc54018_if:
414418
- *module_if
415419
- *module_hic_lpc11u35

records/board/lpc845breakout.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/lpc845breakout.c
5+
family:
6+
- source/family/nxp/lpc845/target.c

source/board/lpc845breakout.c

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/**
2+
* @file lpc845breakout.c
3+
* @brief board ID for the NXP LPC845 Breakout board
4+
*
5+
* DAPLink Interface Firmware
6+
* Copyright (c) 2009-2019, 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 = "D002",
28+
.family_id = kStub_HWReset_FamilyID,
29+
.target_cfg = &target_device,
30+
.board_vendor = "NXP",
31+
.board_name = "LPC845BREAKOUT",
32+
};
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
/* Flash algorithm for LPC84x IAP 64kB Flash
2+
*
3+
* DAPLink Interface Firmware
4+
* Copyright (c) 2009-2026 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 'LPC84x_64.FLM' (LPC84x IAP 64kB Flash)
21+
// Originating from 'Keil.LPC800_DFP.1.10.2.pack'
22+
// digest = 7456044e6eab538adb83363713d1bf756d11efc6acce4f93e184587a8b8b97bc, file size = 12556
23+
// algo version = 0x101, algo size = 356 (0x164)
24+
static const uint32_t LPC84x_64_flash_prog_blob[] = {
25+
0xe7fdbe00,
26+
0x47700a80, 0x48474948, 0x60084449, 0x22004847, 0x21016102, 0x61426141, 0x61816141, 0x20024943,
27+
0x70083940, 0x47704610, 0x47702000, 0x4c40b5f8, 0x444c2032, 0x25004621, 0xc461263f, 0x483c3114,
28+
0x44484f3c, 0x91003c0c, 0x696047b8, 0xd10d2800, 0xc4612034, 0x44484834, 0x60206800, 0x3c0c4834,
29+
0x99004448, 0x696047b8, 0xd0002800, 0xbdf82001, 0x4d2fb5f8, 0x20320a84, 0xc511444d, 0x310c4629,
30+
0x4e2c482b, 0x460f602c, 0x3d084448, 0x696847b0, 0xd10e2800, 0xc5112034, 0x602c4823, 0x68004448,
31+
0x48236068, 0x44484639, 0x47b03d08, 0x28006968, 0x2001d000, 0xb5f8bdf8, 0x00064614, 0xcc03d10e,
32+
0x18406862, 0x18896821, 0x68a11840, 0x68e11840, 0x69211840, 0x42401840, 0x3c086160, 0x0ab04d14,
33+
0x2132444d, 0x60296068, 0x462960a8, 0x4f113114, 0x91004628, 0x696847b8, 0xd1112800, 0x60ac2033,
34+
0x20ffc541, 0x60683001, 0x44484807, 0x60a86800, 0x3d084807, 0x99004448, 0x696847b8, 0xd0002800,
35+
0xbdf82001, 0x00002ee0, 0x00000004, 0x40048040, 0x00000008, 0x0f001ff1, 0x00000000, 0x00000000,
36+
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000
37+
};
38+
39+
// Start address of flash
40+
static const uint32_t flash_start = 0x00000000;
41+
// Size of flash
42+
static const uint32_t flash_size = 0x00010000;
43+
44+
/**
45+
* List of start and size for each size of flash sector - even indexes are start, odd are size
46+
* The size will apply to all sectors between the listed address and the next address
47+
* in the list.
48+
* The last pair in the list will have sectors starting at that address and ending
49+
* at address flash_start + flash_size.
50+
*/
51+
static const sector_info_t sectors_info[] = {
52+
{0x00000000, 0x00000400},
53+
};
54+
55+
static const program_target_t flash = {
56+
0x10000009, // Init
57+
0x1000002d, // UnInit
58+
0x10000031, // EraseChip
59+
0x10000075, // EraseSector
60+
0x100000bb, // ProgramPage
61+
0x00000000, // Verify
62+
63+
// BKPT : start of blob + 1
64+
// RSB : blob start + header + rw data offset
65+
// RSP : stack pointer
66+
{
67+
0x10000001,
68+
0x1000013c,
69+
0x10000a00
70+
},
71+
72+
// mem buffer location
73+
0x10000a00,
74+
// location to write prog_blob in target RAM
75+
0x10000000,
76+
// prog_blob size
77+
sizeof(LPC84x_64_flash_prog_blob),
78+
// address of prog_blob
79+
LPC84x_64_flash_prog_blob,
80+
// ram_to_flash_bytes_to_be_written
81+
0x00000100
82+
};

source/family/nxp/lpc845/target.c

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/**
2+
* @file target.c
3+
* @brief Target information for the LPC845
4+
*
5+
* DAPLink Interface Firmware
6+
* Copyright (c) 2009-2019, 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+
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 = 0,
33+
.flash_regions[0].end = KB(64),
34+
.flash_regions[0].flags = kRegionIsDefault,
35+
.flash_regions[0].flash_algo = (program_target_t *) &flash,
36+
.ram_regions[0].start = 0x10000000,
37+
.ram_regions[0].end = 0x10004000,
38+
.target_vendor = "NXP",
39+
.target_part_number = "LPC845M301JBD48",
40+
};

test/info.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ def VENDOR_TO_FAMILY(x, y) : return (VENDOR_ID[x] <<8) | y
245245
( 0x9905, VENDOR_TO_FAMILY('Nordic', 2), 'nrf52820_microbit_if', 'nrf52820_bl', 'Microbitv2' ),
246246
( 0x9906, VENDOR_TO_FAMILY('Nordic', 2), 'nrf52820_microbit_if', 'nrf52820_bl', 'Microbitv2' ),
247247
( 0xA127, VENDOR_TO_FAMILY('Ambiq', 1), 'kl26z_artemis_dk_if', 'kl26z_bl', 'ARTMBED' ),
248+
( 0xD002, VENDOR_TO_FAMILY('Stub', 1), 'lpc11u35_lpc845breakout_if', None, 'LPC845BREAKOUT' ),
248249
( 0x0000, VENDOR_TO_FAMILY('Stub', 1), 'kl26z_if', None, None ),
249250
( 0x0000, VENDOR_TO_FAMILY('Stub', 1), 'k20dx_if', None, None ),
250251
( 0x0000, VENDOR_TO_FAMILY('Stub', 1), 'k26f_if', None, None ),

0 commit comments

Comments
 (0)