Skip to content

Commit 22eb274

Browse files
maxd-nordicmbrossard
authored andcommitted
nrf52840_hic: Add nrf52840 HIC
1 parent d4ecce2 commit 22eb274

File tree

17 files changed

+3922
-1
lines changed

17 files changed

+3922
-1
lines changed

projects.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,11 @@ module:
9898
- records/hic_hal/nrf52820.yaml
9999
- records/usb/usb-bulk.yaml
100100
- records/usb/usb-hid.yaml
101+
hic_nrf52840: &module_hic_nrf52840
102+
- records/rtos/rtos-cm4.yaml
103+
- records/hic_hal/nrf52840.yaml
104+
- records/usb/usb-bulk.yaml
105+
- records/usb/usb-hid.yaml
101106
hic_sam3u2c: &module_hic_sam3u2c
102107
- records/rtos/rtos-cm3.yaml
103108
- records/hic_hal/sam3u2c.yaml
@@ -208,6 +213,14 @@ projects:
208213
- *module_if
209214
- *module_hic_nrf52820
210215
- records/family/all_family.yaml
216+
nrf52840_bl:
217+
- *module_bl
218+
- records/hic_hal/nrf52840.yaml
219+
- records/board/nrf52840_bl.yaml
220+
nrf52840_if:
221+
- *module_if
222+
- *module_hic_nrf52840
223+
- records/family/all_family.yaml
211224
sam3u2c_bl:
212225
- *module_bl
213226
- records/hic_hal/sam3u2c.yaml

records/board/nrf52840_bl.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
common:
2+
sources:
3+
board:
4+
- source/board/nrf52820_bl.c

records/hic_hal/nrf52840.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
common:
2+
target:
3+
- Cortex-M4
4+
core:
5+
- Cortex-M4
6+
macros:
7+
- INTERFACE_NRF52840
8+
- NRF52840_XXAA
9+
- DAPLINK_HIC_ID=0x6E052840 # DAPLINK_HIC_ID_NRF52840
10+
- OS_CLOCK=64000000
11+
- __DAPLINK
12+
includes:
13+
- source/hic_hal/nordic/nrf52840
14+
- source/hic_hal/nordic/nrfx
15+
- source/hic_hal/nordic/nrfx/drivers
16+
- source/hic_hal/nordic/nrfx/hal
17+
- source/hic_hal/nordic/nrfx/mdk
18+
- source/hic_hal/nordic/shared/nrf52
19+
sources:
20+
hic_hal:
21+
- source/hic_hal/nordic/nrf52840
22+
- source/hic_hal/nordic/nrf52820/cmsis
23+
- source/hic_hal/nordic/nrfx/drivers
24+
- source/hic_hal/nordic/shared
25+
- source/hic_hal/nordic/shared/nrf52
26+
27+
tool_specific:
28+
uvision:
29+
misc:
30+
ld_flags:
31+
- --predefine="-I..\..\..\source\hic_hal\nordic\nrf52840"
32+
sources:
33+
hic_hal:
34+
- source/hic_hal/nordic/nrf52840/arm
35+
armcc:
36+
sources:
37+
hic_hal:
38+
- source/hic_hal/nordic/nrf52840/arm
39+
armclang:
40+
misc:
41+
common_flags:
42+
- -mfpu=none
43+
sources:
44+
hic_hal:
45+
- source/hic_hal/nordic/nrf52840/arm
46+
gcc_arm:
47+
sources:
48+
hic_hal:
49+
- source/hic_hal/nordic/nrf52840/gcc

source/daplink/daplink.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ COMPILER_ASSERT(DAPLINK_RAM_SHARED_START + DAPLINK_RAM_SHARED_SIZE == DAPLINK_RA
7474
#define DAPLINK_HIC_ID_STM32H743II 0x97969940 // Newer STM HICs
7575
#define DAPLINK_HIC_ID_PSOC5 0x2E127069
7676
#define DAPLINK_HIC_ID_NRF52820 0x6E052820 // 'n\x05\x28\x20'
77+
#define DAPLINK_HIC_ID_NRF52840 0x6E052840 // 'n\x05\x28\x40'
7778
//@}
7879

7980
#define DAPLINK_INFO_OFFSET 0x20

source/hic_hal/device.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@
4848
#include "M480.h"
4949
#elif defined (INTERFACE_NRF52820)
5050
#include "nrf52820.h"
51+
#elif defined (INTERFACE_NRF52840)
52+
#include "nrf52840.h"
5153
#else
5254
#error "CMSIS core headers needed"
5355
#endif

source/hic_hal/nordic/nrf52820/DAP_config.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,13 @@ Configures the DAP Hardware I/O pins for Serial Wire Debug (SWD) mode:
203203
- TDI, nTRST to HighZ mode (pins are unused in SWD mode).
204204
*/
205205
__STATIC_INLINE void PORT_SWD_SETUP (void) {
206+
#if defined (NRF52840_XXAA) || defined (DEVELOP_IN_NRF52840)
207+
COMPILER_ASSERT(GPIO_CHECK_PRESENT_NRF52840(PIN_SWCLK));
208+
COMPILER_ASSERT(GPIO_CHECK_PRESENT_NRF52840(PIN_SWDIO));
209+
#else
206210
COMPILER_ASSERT(GPIO_CHECK_PRESENT_NRF52820(PIN_SWCLK));
207211
COMPILER_ASSERT(GPIO_CHECK_PRESENT_NRF52820(PIN_SWDIO));
212+
#endif
208213
gpio_cfg(GPIO_REG(PIN_SWCLK), GPIO_IDX(PIN_SWCLK),
209214
NRF_GPIO_PIN_DIR_OUTPUT, NRF_GPIO_PIN_INPUT_DISCONNECT,
210215
NRF_GPIO_PIN_NOPULL, NRF_GPIO_PIN_S0S1, NRF_GPIO_PIN_NOSENSE);

0 commit comments

Comments
 (0)