1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 01:09:47 +01:00

Merge pull request #20965 from crasbe/pr/nRF52_pinreset

boards/nrf52*dk: Enable Pinreset after Flashing
This commit is contained in:
Marian Buschsieweke 2024-11-21 22:14:24 +00:00 committed by GitHub
commit ab67824770
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 29 additions and 1 deletions

View File

@ -1,2 +1,7 @@
# Set UICR.PSELRESET[0] and UICR.PSELRESET[1] registers at 0x10001200
# to pin P0.21 (0x15), which is connected to the onboard Reset button
JLINK_POST_FLASH = Write4 0x10001200 00000015 00000015
OPENOCD_PRE_VERIFY_CMDS = -c 'flash fillw 0x10001200 0x00000015 2'
# include common configuration for nrf52 based boards
include $(RIOTBOARD)/common/nrf52/Makefile.include

View File

@ -6,4 +6,9 @@ TTY_BOARD_FILTER := --model J-Link
# the debug adapter
DEBUG_ADAPTER_ID_IS_TTY_SERIAL := 1
# Set UICR.PSELRESET[0] and UICR.PSELRESET[1] registers at 0x10001200
# to pin P0.18 (0x12), which is connected to the onboard Reset button
JLINK_POST_FLASH = Write4 0x10001200 00000012 00000012
OPENOCD_PRE_VERIFY_CMDS = -c 'flash fillw 0x10001200 0x00000012 2'
include $(RIOTBOARD)/common/nrf52xxxdk/Makefile.include

View File

@ -2,4 +2,9 @@
# USB serials to only select the UART bridge of integrated J-Link debugger.
TTY_BOARD_FILTER := --model J-Link
# Set UICR.PSELRESET[0] and UICR.PSELRESET[1] registers at 0x10001200
# to pin P0.21 (0x15), which is connected to the onboard Reset button
JLINK_POST_FLASH = Write4 0x10001200 00000015 00000015
OPENOCD_PRE_VERIFY_CMDS = -c 'flash fillw 0x10001200 0x00000015 2'
include $(RIOTBOARD)/common/nrf52xxxdk/Makefile.include

View File

@ -2,5 +2,9 @@
OPENOCD_DEBUG_ADAPTER ?= dap
PROGRAMMER ?= openocd
# Set UICR.PSELRESET[0] and UICR.PSELRESET[1] registers at 0x10001200
# to pin P0.18 (0x12), which is connected to the onboard Reset button
OPENOCD_PRE_VERIFY_CMDS = -c 'flash fillw 0x10001200 0x00000012 2'
# use the common nrf52 config for the rest
include $(RIOTBOARD)/common/nrf52/Makefile.include

View File

@ -1,3 +1,8 @@
MODULE = board
# Set UICR.PSELRESET[0] and UICR.PSELRESET[1] registers at 0x10001200
# to pin P0.18 (0x12), which is connected to the onboard Reset button
JLINK_POST_FLASH = Write4 0x10001200 00000012 00000012
OPENOCD_PRE_VERIFY_CMDS = -c 'flash fillw 0x10001200 0x00000012 2'
include $(RIOTBASE)/Makefile.base

View File

@ -119,7 +119,7 @@ UNEXPORTED_VARIABLES+=('OPENOCD_PRE_FLASH_CHECK_SCRIPT')
UNEXPORTED_VARIABLES+=('PYOCD_FLASH_TARGET_TYPE')
UNEXPORTED_VARIABLES+=('PYOCD_ADAPTER_INIT')
UNEXPORTED_VARIABLES+=('JLINK_DEVICE' 'JLINK_IF')
UNEXPORTED_VARIABLES+=('JLINK_PRE_FLASH' 'JLINK_RESET_FILE')
UNEXPORTED_VARIABLES+=('JLINK_PRE_FLASH' 'JLINK_POST_FLASH' 'JLINK_RESET_FILE')
UNEXPORTED_VARIABLES+=('GIT_CACHE' 'GIT_CACHE_DIR')
UNEXPORTED_VARIABLES+=('LINKXX')
UNEXPORTED_VARIABLES+=('APPDEPS' 'BUILDDEPS' 'DEBUGDEPS')

View File

@ -5,6 +5,10 @@ Simply compile, flash, and run this tool on your nRF52x-based board. It will
program the given `RESET_PIN` into the NRF_UICR->PSELRESET registers, hence
allowing for hardware resets using a button connected to that pin.
> [!WARNING]
> This tool only works with early nRF52 chips with build codes before Fxx.
> Later build codes automatically erase the UICR register on each flashing
> operation.
Context
=======