1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/makefiles/tools/openocd.inc.mk
bors[bot] 829af7c105
Merge #19703 #19724 #19735
19703: cpu/sam0_eth: interrupt based link detection/auto-negotiation r=benpicco a=benpicco



19724: dist/tools/openocd: add OPENOCD_SERVER_ADDRESS variable r=benpicco a=fabian18



19735: nrf5x_common: Clear I2C periph shorts r=benpicco a=bergzand

### Contribution description

The I2C peripheral's shortcuts are used with the read and write register to automatically stop the I2C transaction or to continue with the next stage.

With simple I2C read and write bytes these shorts are not used, but are also not cleared by the function in all cases, causing it to use the shortcut configuration set by a previous function call. This patch ensures that the shorts are always set by the read and write functions

### Testing procedure

Should be possible to spot with a logic analyzer and the I2C periph test. Maybe the HIL test can also detect it :)

### Issues/PRs references

None

Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
Co-authored-by: Fabian Hüßler <fabian.huessler@ml-pa.com>
Co-authored-by: Koen Zandberg <koen@bergzand.net>
2023-06-14 12:34:33 +00:00

87 lines
3.1 KiB
Makefile

FLASHER ?= $(RIOTTOOLS)/openocd/openocd.sh
DEBUGGER ?= $(RIOTTOOLS)/openocd/openocd.sh
DEBUGSERVER ?= $(RIOTTOOLS)/openocd/openocd.sh
DEBUGCLIENT ?= $(RIOTTOOLS)/openocd/openocd.sh
RESET ?= $(RIOTTOOLS)/openocd/openocd.sh
FLASHFILE ?= $(ELFFILE)
FFLAGS ?= flash $(FLASHFILE)
DEBUGGER_FLAGS ?= debug $(DEBUG_ELFFILE)
DEBUGSERVER_FLAGS ?= debug-server
DEBUGCLIENT_FLAGS ?= debug-client $(DEBUG_ELFFILE)
RESET_FLAGS ?= reset
ifneq (,$(OPENOCD_DEBUG_ADAPTER))
include $(RIOTMAKE)/tools/openocd-adapters/$(OPENOCD_DEBUG_ADAPTER).inc.mk
OPENOCD_ADAPTER_INIT += -c 'transport select $(OPENOCD_TRANSPORT)'
endif
OPENOCD_CONFIG ?= $(BOARDDIR)/dist/openocd.cfg
OPENOCD_TARGETS = debug% flash% reset
# Export GDB_PORT_CORE_OFFSET to required targets
$(call target-export-variables,$(OPENOCD_TARGETS),GDB_PORT_CORE_OFFSET)
# Export OPENOCD_CONFIG to required targets
$(call target-export-variables,$(OPENOCD_TARGETS),OPENOCD_CONFIG)
# Export OPENOCD_CORE to required targets
$(call target-export-variables,$(OPENOCD_TARGETS),OPENOCD_CORE)
# Export OPENOCD_ADAPTER_INIT to required targets
$(call target-export-variables,$(OPENOCD_TARGETS),OPENOCD_ADAPTER_INIT)
# Export OPENOCD_RESET_USE_CONNECT_ASSERT_SRST to required targets
$(call target-export-variables,$(OPENOCD_TARGETS),OPENOCD_RESET_USE_CONNECT_ASSERT_SRST)
ifneq (,$(OPENOCD_SERVER_ADDRESS))
# Export OPENOCD_SERVER_ADDRESS to required targets
$(call target-export-variables,$(OPENOCD_TARGETS),OPENOCD_SERVER_ADDRESS)
endif
ifneq (,$(OPENOCD_CMD_RESET_RUN))
# Export OPENOCD_CMD_RESET_RUN only to the reset target
$(call target-export-variables,reset,OPENOCD_CMD_RESET_RUN)
endif
ifneq (,$(OPENOCD_CMD_RESET_HALT))
# Export OPENOCD_CMD_RESET_HALT only to the flash targets
$(call target-export-variables,flash,OPENOCD_CMD_RESET_HALT)
$(call target-export-variables,flash-only,OPENOCD_CMD_RESET_HALT)
endif
OPENOCD_DEBUG_TARGETS = debug debugr debug-server debug-client
ifneq (,$(OPENOCD_DBG_EXTRA_CMD))
# Export OPENOCD_DBG_EXTRA_CMD only to the flash/flash-only target
$(call target-export-variables,$(OPENOCD_DEBUG_TARGETS),OPENOCD_DBG_EXTRA_CMD)
endif
OPENOCD_FLASH_TARGETS = flash flash-only flashr
ifneq (,$(IMAGE_OFFSET))
# Export IMAGE_OFFSET only to the flash/flash-only target
$(call target-export-variables,$(OPENOCD_FLASH_TARGETS),IMAGE_OFFSET)
endif
ifneq (,$(OPENOCD_PRE_VERIFY_CMDS))
# Export OPENOCD_PRE_VERIFY_CMDS only to the flash/flash-only target
$(call target-export-variables,$(OPENOCD_FLASH_TARGETS),OPENOCD_PRE_VERIFY_CMDS)
endif
ifneq (,$(OPENOCD_SKIP_VERIFY))
# Export OPENOCD_SKIP_VERIFY only to the flash/flash-only target
$(call target-export-variables,$(OPENOCD_FLASH_TARGETS),OPENOCD_SKIP_VERIFY)
endif
ifneq (,$(OPENOCD_PRE_FLASH_CMDS))
# Export OPENOCD_PRE_FLASH_CMDS only to the flash/flash-only targets
$(call target-export-variables,$(OPENOCD_FLASH_TARGETS),OPENOCD_PRE_FLASH_CMDS)
endif
ifneq (,$(OPENOCD_PRE_FLASH_CHECK_SCRIPT))
# Export OPENOCD_PRE_FLASH_CHECK_SCRIPT only to the flash/flash-only targets
$(call target-export-variables,$(OPENOCD_FLASH_TARGETS),OPENOCD_PRE_FLASH_CHECK_SCRIPT)
endif