From 7c60ffbb63e5b61d4ab9fbafc4ea62eefe5222cf Mon Sep 17 00:00:00 2001 From: Mathias Brossard Date: Wed, 14 Feb 2024 21:44:58 -0600 Subject: [PATCH] Add lpc4367xpresso interface project --- projects.yaml | 4 ++ records/board/lpc4367xpresso.yaml | 6 +++ source/board/lpc4367xpresso.c | 35 +++++++++++++++++ source/family/nxp/lpc43xx/target_lpc4367.c | 44 ++++++++++++++++++++++ test/info.py | 1 + 5 files changed, 90 insertions(+) create mode 100644 records/board/lpc4367xpresso.yaml create mode 100644 source/board/lpc4367xpresso.c create mode 100644 source/family/nxp/lpc43xx/target_lpc4367.c diff --git a/projects.yaml b/projects.yaml index ee982fe8d5..664375a40a 100644 --- a/projects.yaml +++ b/projects.yaml @@ -507,6 +507,10 @@ projects: - *module_if - *module_hic_lpc4322 - records/board/lpc4337xpresso.yaml + lpc4322_lpc4367xpresso_if: + - *module_if + - *module_hic_lpc4322 + - records/board/lpc4367xpresso.yaml lpc4322_lpc54114xpresso_if: - *module_if - *module_hic_lpc4322 diff --git a/records/board/lpc4367xpresso.yaml b/records/board/lpc4367xpresso.yaml new file mode 100644 index 0000000000..91479dd857 --- /dev/null +++ b/records/board/lpc4367xpresso.yaml @@ -0,0 +1,6 @@ +common: + sources: + board: + - source/board/lpc4367xpresso.c + family: + - source/family/nxp/lpc43xx/target_lpc4367.c diff --git a/source/board/lpc4367xpresso.c b/source/board/lpc4367xpresso.c new file mode 100644 index 0000000000..52e7485155 --- /dev/null +++ b/source/board/lpc4367xpresso.c @@ -0,0 +1,35 @@ +/** + * @file lpc4367xpresso.c + * @brief board ID for the NXP LPC4367Xpresso board + * + * DAPLink Interface Firmware + * Copyright (c) 2022, Arm Limited, All Rights Reserved + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "target_family.h" +#include "target_board.h" + +const board_info_t g_board_info = { + .info_version = kBoardInfoVersion, + .board_id = "4367", + .family_id = kStub_HWReset_FamilyID, + .daplink_url_name = "PRODINFOHTM", + .daplink_drive_name = "LPC4367", + .daplink_target_url = "https://os.mbed.com/platforms/LPCXpresso4337", + .target_cfg = &target_device, + .board_vendor = "NXP", + .board_name = "LPC4367Xpresso", +}; diff --git a/source/family/nxp/lpc43xx/target_lpc4367.c b/source/family/nxp/lpc43xx/target_lpc4367.c new file mode 100644 index 0000000000..bf5c66bef5 --- /dev/null +++ b/source/family/nxp/lpc43xx/target_lpc4367.c @@ -0,0 +1,44 @@ +/** + * @file target.c + * @brief Target information for the lpc4367 + * + * DAPLink Interface Firmware + * Copyright (c) 2022, Arm Limited, All Rights Reserved + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "target_config.h" +#include "daplink_debug.h" +// The file flash_blob.c must only be included in target.c +#include "flash_blob.c" + +// target information +target_cfg_t target_device = { + .version = kTargetConfigVersion, + .sectors_info = sectors_info, + .sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)), + .flash_regions[0].start = 0x1a000000, + .flash_regions[0].end = 0x1a000000 + KB(512), + .flash_regions[0].flags = kRegionIsDefault, + .flash_regions[0].flash_algo = (program_target_t *) &flash, + .flash_regions[1].start = 0x1b000000, + .flash_regions[1].end = 0x1b000000 + KB(512), + .flash_regions[1].flags = 0, + .flash_regions[1].flash_algo = (program_target_t *) &flash, + .ram_regions[0].start = 0x10000000, + .ram_regions[0].end = 0x10000000 + KB(32), + .target_vendor = "NXP", + .target_part_number = "LPC4367JET100", +}; diff --git a/test/info.py b/test/info.py index cfa5fb4867..f481800eee 100644 --- a/test/info.py +++ b/test/info.py @@ -222,6 +222,7 @@ def VENDOR_TO_FAMILY(x, y) : return (VENDOR_ID[x] <<8) | y ( 0x2600, VENDOR_TO_FAMILY('Nordic', 2), 'k20dx_ep_agora_if', None, None ), ( 0x2601, VENDOR_TO_FAMILY('NXP', 0), 'k20dx_ep_kairos_if', None, None ), ( 0x4337, VENDOR_TO_FAMILY('Stub', 1), 'lpc4322_lpc4337xpresso_if', 'lpc4322_bl', 'LPCXpresso4337' ), + ( 0x4367, VENDOR_TO_FAMILY('Stub', 1), 'lpc4322_lpc4367xpresso_if', 'lpc4322_bl', 'LPCXpresso4367' ), ( 0x4600, VENDOR_TO_FAMILY('Realtek', 1), 'lpc11u35_rtl8195am_if', None, 'REALTEK-RTL8195AM' ), ( 0x5006, VENDOR_TO_FAMILY('Stub', 1), 'lpc11u35_musca_a_if', None, 'ARM_MUSCA_A1' ), ( 0x5007, VENDOR_TO_FAMILY('Stub', 1), 'lpc11u35_musca_b_if', None, 'ARM_MUSCA_B1' ),