Skip to content
This repository was archived by the owner on Jan 17, 2023. It is now read-only.

Commit 1e0f6e4

Browse files
authored
Merge pull request #52 from NordicSemiconductor/feature/graviton_settings_page
Generation and display of NRF52840 settings page added
2 parents 82a5ebc + 87209c6 commit 1e0f6e4

4 files changed

Lines changed: 16 additions & 6 deletions

File tree

nordicsemi/__main__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ def settings():
169169
@settings.command(short_help='Generate a .hex file with Bootloader DFU settings.')
170170
@click.argument('hex_file', required=True, type=click.Path())
171171
@click.option('--family',
172-
help='nRF IC family: NRF51 or NRF52',
173-
type=click.Choice(['NRF51', 'NRF52']))
172+
help='nRF IC family: NRF51 or NRF52 or NRF52840',
173+
type=click.Choice(['NRF51', 'NRF52', 'NRF52840']))
174174
@click.option('--application',
175175
help='The application firmware file. This can be omitted if'
176176
'the target IC does not contain an application in flash.'

nordicsemi/dfu/bl_dfu_sett.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ class BLDFUSettings(object):
7676
flash_page_52_sz = 0x1000
7777
bl_sett_51_addr= 0x0003FC00
7878
bl_sett_52_addr= 0x0007F000
79+
bl_sett_52840_addr= 0x000FF000
7980

8081

8182
def __init__(self, ):
@@ -105,11 +106,15 @@ def set_arch(self, arch):
105106
self.arch_str = 'nRF52'
106107
self.flash_page_sz = BLDFUSettings.flash_page_52_sz
107108
self.bl_sett_addr = BLDFUSettings.bl_sett_52_addr
109+
elif arch == 'NRF52840':
110+
self.arch = nRFArch.NRF52840
111+
self.arch_str = 'NRF52840'
112+
self.flash_page_sz = BLDFUSettings.flash_page_52_sz
113+
self.bl_sett_addr = BLDFUSettings.bl_sett_52840_addr
108114
else:
109115
raise RuntimeError("Unknown architecture")
110116

111117
def generate(self, arch, app_file, app_ver, bl_ver, bl_sett_ver):
112-
113118
# Set the architecture
114119
self.set_arch(arch)
115120

@@ -215,7 +220,7 @@ def fromhexfile(self, f, arch=None):
215220
# autodetect based on base address
216221
base = self.ihex.minaddr()
217222

218-
# check the 2 possible addresses for CRC matches
223+
# check the 3 possible addresses for CRC matches
219224
try:
220225
self.probe_settings(BLDFUSettings.bl_sett_51_addr)
221226
self.set_arch('NRF51')
@@ -224,7 +229,11 @@ def fromhexfile(self, f, arch=None):
224229
self.probe_settings(BLDFUSettings.bl_sett_52_addr)
225230
self.set_arch('NRF52')
226231
except Exception as e:
227-
return "Failed to parse .hex file: {0}".format(e)
232+
try:
233+
self.probe_settings(BLDFUSettings.bl_sett_52840_addr)
234+
self.set_arch('NRF52840')
235+
except Exception as e:
236+
return "Failed to parse .hex file: {0}".format(e)
228237

229238
def __str__(self):
230239
s = """

nordicsemi/dfu/nrfhex.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
class nRFArch(Enum):
4343
NRF51 = 1
4444
NRF52 = 2
45+
NRF52840 = 3
4546

4647
class nRFHex(intelhex.IntelHex):
4748
"""

nordicsemi/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@
3737

3838
""" Version definition for nrfutil. """
3939

40-
NRFUTIL_VERSION = "2.1.0"
40+
NRFUTIL_VERSION = "2.2.0"

0 commit comments

Comments
 (0)