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

boards/common/qn908x: Define a common qn908x board

Boards based on the qn908x CPU will share the same OpenOCD configuration
regarding the image offset and OpenOCD commands needed to flash the
image directly with "make flash".
This commit is contained in:
iosabi 2020-04-11 17:07:51 +00:00
parent cde8ac6093
commit 86ab9401aa
5 changed files with 54 additions and 0 deletions

View File

@ -0,0 +1,10 @@
# Copyright (c) 2020 iosabi
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
config BOARD_COMMON_QN908X
bool
depends on CPU_FAM_QN908X
# Add common board support here.

View File

@ -0,0 +1,3 @@
MODULE = boards_common_qn908x
include $(RIOTBASE)/Makefile.base

View File

@ -0,0 +1,3 @@
CPU ?= qn908x
# Put defined MCU peripherals here (in alphabetical order)

View File

@ -0,0 +1,26 @@
# Using dap or jlink depends on which firmware the OpenSDA debugger is running
#DEBUG_ADAPTER ?= dap
DEBUG_ADAPTER ?= jlink
# Use the shared OpenOCD configuration
OPENOCD_CONFIG ?= $(RIOTBOARD)/common/qn908x/dist/openocd.cfg
# Disable the watchdog when flashing. OpenOCD runs a CRC program in RAM to
# verify the image, which needs to have the WDT disabled but it is normally
# enabled after a 'reset halt' command.
OPENOCD_PRE_FLASH_CMDS += "-c qn908x disable_wdog"
# Set default port depending on operating system
PORT_LINUX ?= /dev/ttyACM0
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbmodem*)))
# OpenOCD is able to handle .elf files and is the preferred way.
FLASHFILE ?= $(ELFFILE)
# Setup serial terminal
include $(RIOTMAKE)/tools/serial.inc.mk
# This board uses OpenOCD. Note that support for QN908x in OpenOCD at the time
# of writing has not been merged in the tree and is only available at
# http://openocd.zylin.com/#/c/5584/ .
include $(RIOTMAKE)/tools/openocd.inc.mk

12
boards/common/qn908x/dist/openocd.cfg vendored Normal file
View File

@ -0,0 +1,12 @@
# Generic configuration for a qn908x-based board.
# QN908X only supports SWD
transport select swd
# NXP QN908x.
source [find target/qn908x.cfg]
$TARGETNAME configure -event gdb-attach {
halt
}
$TARGETNAME configure -rtos auto