Skip to content

Commit 2a406fc

Browse files
committed
nrf52840_hic: Change default memory map and IO configuration
1 parent ed10c7f commit 2a406fc

File tree

4 files changed

+77
-12
lines changed

4 files changed

+77
-12
lines changed

records/board/nrf52840_bl.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
common:
22
sources:
33
board:
4-
- source/board/nrf52820_bl.c
4+
- source/board/nrf52840_bl.c

source/board/nrf52840_bl.c

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
/**
2+
* @file nrf52840_bl.c
3+
* @brief board ID and meta-data for HIC based on Nordic Semiconductor nRF52840
4+
*
5+
* DAPLink Interface Firmware
6+
* Copyright (c) 2009-2021, 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_addr.h"
24+
#include "compiler.h"
25+
#include "target_board.h"
26+
#include "target_family.h"
27+
28+
// Warning - changing the interface start will break backwards compatibility
29+
COMPILER_ASSERT(DAPLINK_ROM_IF_START == 0x00010000);
30+
COMPILER_ASSERT(DAPLINK_ROM_IF_SIZE == KB(188));
31+
32+
/**
33+
* List of start and size for each size of flash sector
34+
* The size will apply to all sectors between the listed address and the next address
35+
* in the list.
36+
* The last pair in the list will have sectors starting at that address and ending
37+
* at address start + size.
38+
*/
39+
static const sector_info_t sectors_info[] = {
40+
{DAPLINK_ROM_IF_START, 0x1000},
41+
};
42+
43+
// nrf52840 target information
44+
target_cfg_t target_device = {
45+
.sectors_info = sectors_info,
46+
.sector_info_length = (sizeof(sectors_info))/(sizeof(sector_info_t)),
47+
.flash_regions[0].start = DAPLINK_ROM_IF_START,
48+
.flash_regions[0].end = DAPLINK_ROM_IF_START + DAPLINK_ROM_IF_SIZE,
49+
.flash_regions[0].flags = kRegionIsDefault,
50+
.ram_regions[0].start = DAPLINK_RAM_START,
51+
.ram_regions[0].end = DAPLINK_RAM_START + DAPLINK_RAM_SIZE,
52+
/* .flash_algo not needed for bootloader */
53+
};
54+
55+
// bootloader has no family
56+
const target_family_descriptor_t *g_target_family = NULL;
57+
58+
const board_info_t g_board_info = {
59+
.info_version = kBoardInfoVersion,
60+
.board_id = "0000",
61+
.daplink_url_name = "HELP_FAQHTM",
62+
.daplink_drive_name = "MAINTENANCE",
63+
.daplink_target_url = "https://mbed.com/daplink",
64+
.target_cfg = &target_device,
65+
};

source/hic_hal/nordic/nrf52840/IO_Config.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,13 @@ COMPILER_ASSERT(DAPLINK_HIC_ID == DAPLINK_HIC_ID_NRF52840);
5757
#undef LED_CONNECTED
5858

5959
// HID LED
60-
#define LED_HID NRF_GPIO_PIN_MAP(0, 14)
60+
#define LED_HID NRF_GPIO_PIN_MAP(0, 15)
6161

6262
// MSC LED
63-
#define LED_MSC NRF_GPIO_PIN_MAP(0, 14)
63+
#define LED_MSC NRF_GPIO_PIN_MAP(0, 15)
6464

6565
// CDC LED
66-
#define LED_CDC NRF_GPIO_PIN_MAP(0, 14)
66+
#define LED_CDC NRF_GPIO_PIN_MAP(0, 15)
6767

6868
// POWER LED
6969
#define LED_PWR NRF_GPIO_PIN_MAP(0, 17)

source/hic_hal/nordic/nrf52840/daplink_addr.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,29 +22,29 @@
2222
/* Device sizes */
2323

2424
#define DAPLINK_ROM_START 0x00000000
25-
#define DAPLINK_ROM_SIZE 0x00020000 // Limit to 128 KiB
25+
#define DAPLINK_ROM_SIZE 0x00040000 // 256 KiB
2626

2727

2828
#define DAPLINK_RAM_START 0x20000000
29-
#define DAPLINK_RAM_SIZE 0x00008000 // 32 KiB
29+
#define DAPLINK_RAM_SIZE 0x00010000 // 64 KiB
3030

3131
/* ROM sizes */
3232

3333
#define DAPLINK_ROM_BL_START 0x00000000
34-
#define DAPLINK_ROM_BL_SIZE 0x00008000 // 32 KiB bootloader
34+
#define DAPLINK_ROM_BL_SIZE 0x00010000 // 64 KiB bootloader
3535

36-
#define DAPLINK_ROM_IF_START 0x00008000
37-
#define DAPLINK_ROM_IF_SIZE 0x00017000
36+
#define DAPLINK_ROM_IF_START 0x00010000
37+
#define DAPLINK_ROM_IF_SIZE 0x0002F000
3838

39-
#define DAPLINK_ROM_CONFIG_USER_START 0x0001F000
39+
#define DAPLINK_ROM_CONFIG_USER_START 0x0003F000
4040
#define DAPLINK_ROM_CONFIG_USER_SIZE 0x00001000
4141

4242
/* RAM sizes */
4343

4444
#define DAPLINK_RAM_APP_START 0x20000000
45-
#define DAPLINK_RAM_APP_SIZE 0x00007F00
45+
#define DAPLINK_RAM_APP_SIZE 0x0000FF00
4646

47-
#define DAPLINK_RAM_SHARED_START 0x20007F00
47+
#define DAPLINK_RAM_SHARED_START 0x2000FF00
4848
#define DAPLINK_RAM_SHARED_SIZE 0x00000100
4949

5050
/* Flash Programming Info */

0 commit comments

Comments
 (0)