Initial import of NFC GNSS SDK project

This commit is contained in:
chenjintao
2026-09-15 16:10:12 +08:00
commit 2746cc3d4e
3070 changed files with 892062 additions and 0 deletions
@@ -0,0 +1,26 @@
export FLASHER ?= $(RIOTBASE)/dist/tools/bossa/bossac
export FFLAGS ?= -p $(PORT) -e -i -w -v -b -R $(HEXFILE)
export OFLAGS = -O binary
export HEXFILE = $(ELFFILE:.elf=.bin)
# some arduino boards need to toggle the serial interface a little bit to get
# them ready for flashing...
ifneq (,$(BOSSA_ARDUINO_PREFLASH))
OS := $(shell uname)
ifeq ($(OS),Linux)
STTY_FLAG = -F
else ifeq ($(OS),Darwin)
STTY_FLAG = -f
endif
PREFLASHER ?= stty
PREFFLAGS ?= $(STTY_FLAG) $(PORT) raw ispeed 1200 ospeed 1200 cs8 -cstopb ignpar eol 255 eof 255
FLASHDEPS += preflash
endif
# if we go with the default (BOSSA shipped with RIOT), we download and build
# the tool if not already done
ifeq ($(RIOTBASE)/dist/tools/bossa/bossac,$(FLASHER))
FLASHDEPS += $(RIOTBASE)/dist/tools/bossa/bossac
endif
@@ -0,0 +1,20 @@
RIOT_EDBG = $(RIOTBASE)/dist/tools/edbg/edbg
EDBG ?= $(RIOT_EDBG)
FLASHER ?= $(EDBG)
OFLAGS ?= -O binary
HEXFILE = $(ELFFILE:.elf=.bin)
# Use USB serial number to select device when more than one is connected
# Use /dist/tools/usb-serial/list-ttys.sh to find out serial number.
# Usage:
# export DEBUG_ADAPTER_ID="ATML..."
# BOARD=<board> make flash
ifneq (,$(DEBUG_ADAPTER_ID))
EDBG_ARGS += --serial $(DEBUG_ADAPTER_ID)
endif
FFLAGS ?= $(EDBG_ARGS) -t $(EDBG_DEVICE_TYPE) -b -e -v -p -f $(HEXFILE)
ifeq ($(RIOT_EDBG),$(FLASHER))
FLASHDEPS += $(RIOT_EDBG)
endif
RESET ?= $(EDBG)
RESET_FLAGS ?= $(EDBG_ARGS) -t $(EDBG_DEVICE_TYPE)
@@ -0,0 +1,2 @@
export GDBPREFIX ?= $(PREFIX)
export GDB ?= $(GDBPREFIX)gdb
@@ -0,0 +1,12 @@
export FLASHER = $(RIOTBASE)/dist/tools/jlink/jlink.sh
export DEBUGGER = $(RIOTBASE)/dist/tools/jlink/jlink.sh
export DEBUGSERVER = $(RIOTBASE)/dist/tools/jlink/jlink.sh
export RESET = $(RIOTBASE)/dist/tools/jlink/jlink.sh
export OFLAGS = -O binary
export HEXFILE = $(ELFFILE:.elf=.bin)
export FFLAGS ?= flash
export DEBUGGER_FLAGS ?= debug
export DEBUGSERVER_FLAGS ?= debug-server
export RESET_FLAGS ?= reset
@@ -0,0 +1,2 @@
This directory contains definitions of debugger hardware interfaces to be used
by the OpenOCD integration.
@@ -0,0 +1,7 @@
# CMSIS DAP debug adapter
OPENOCD_ADAPTER_INIT ?= -c 'source [find interface/cmsis-dap.cfg]'
# Add serial matching command, only if DEBUG_ADAPTER_ID was specified
ifneq (,$(DEBUG_ADAPTER_ID))
OPENOCD_ADAPTER_INIT += -c 'cmsis_dap_serial $(DEBUG_ADAPTER_ID)'
endif
export OPENOCD_ADAPTER_INIT
@@ -0,0 +1,7 @@
# Segger J-Link debug adapter
OPENOCD_ADAPTER_INIT ?= -c 'source [find interface/jlink.cfg]'
# Add serial matching command, only if DEBUG_ADAPTER_ID was specified
ifneq (,$(DEBUG_ADAPTER_ID))
OPENOCD_ADAPTER_INIT += -c 'jlink serial $(DEBUG_ADAPTER_ID)'
endif
export OPENOCD_ADAPTER_INIT
@@ -0,0 +1,33 @@
# OpenOCD settings for Mulle programmer board.
# Try to determine which OpenOCD config file we should use based on the
# programmer board serial number.
# Fall back to PROGRAMMER_SERIAL for backwards compatibility
export DEBUG_ADAPTER_ID ?= $(PROGRAMMER_SERIAL)
ifneq (,$(DEBUG_ADAPTER_ID))
# Makefile-way of comparing numbers, using lexicographical sorting since we
# don't have any arithmetic comparisons.
# Programmers with serial 100 -- 148 are version 0.60
# Programmers with serial 301 -- 330 are version 0.70
ifeq "100" "$(word 1, $(sort 100 $(DEBUG_ADAPTER_ID)))"
# >= 100
ifneq "149" "$(word 1, $(sort 149 $(DEBUG_ADAPTER_ID)))"
# < 149
PROGRAMMER_VERSION = 0.60
else
# >= 149
PROGRAMMER_VERSION = 0.70
endif
endif
endif
# Default to version 0.70 programmer
PROGRAMMER_VERSION ?= 0.70
OPENOCD_ADAPTER_INIT ?= -f '$(RIOTBASE)/boards/mulle/dist/openocd/mulle-programmer-$(PROGRAMMER_VERSION).cfg'
# Add serial matching command, only if DEBUG_ADAPTER_ID was specified
ifneq (,$(DEBUG_ADAPTER_ID))
OPENOCD_ADAPTER_INIT += -c 'ftdi_serial $(DEBUG_ADAPTER_ID)'
endif
export OPENOCD_ADAPTER_INIT
@@ -0,0 +1,10 @@
# ST-Link debug adapter
# Use STLINK_VERSION to select which stlink version is used
OPENOCD_ADAPTER_INIT ?= \
-c 'source [find interface/stlink-v$(STLINK_VERSION).cfg]' \
-c 'transport select hla_swd'
# Add serial matching command, only if DEBUG_ADAPTER_ID was specified
ifneq (,$(DEBUG_ADAPTER_ID))
OPENOCD_ADAPTER_INIT += -c 'hla_serial $(DEBUG_ADAPTER_ID)'
endif
export OPENOCD_ADAPTER_INIT
@@ -0,0 +1,14 @@
export FLASHER ?= $(RIOTBASE)/dist/tools/openocd/openocd.sh
export DEBUGGER = $(RIOTBASE)/dist/tools/openocd/openocd.sh
export DEBUGSERVER = $(RIOTBASE)/dist/tools/openocd/openocd.sh
export RESET ?= $(RIOTBASE)/dist/tools/openocd/openocd.sh
export OFLAGS ?= -O ihex
export FFLAGS ?= flash
export DEBUGGER_FLAGS ?= debug
export DEBUGSERVER_FLAGS ?= debug-server
export RESET_FLAGS ?= reset
ifneq (,$(DEBUG_ADAPTER))
include $(RIOTMAKE)/tools/openocd-adapters/$(DEBUG_ADAPTER).inc.mk
endif
@@ -0,0 +1,2 @@
export EMULATOR ?= $(RIOTBASE)/dist/tools/renode/run-renode.sh
export EMULATOR_FLAGS ?= start
@@ -0,0 +1,22 @@
# set default port depending on operating system
OS := $(shell uname)
ifeq ($(OS),Linux)
PORT ?= $(PORT_LINUX)
else ifeq ($(OS),Darwin)
PORT ?= $(PORT_DARWIN)
endif
ifeq ($(PORT),)
$(info Warning: no PORT set!)
endif
export PORT
export BAUD ?= 115200
RIOT_TERMINAL ?= pyterm
ifeq ($(RIOT_TERMINAL),pyterm)
export TERMPROG ?= $(RIOTBASE)/dist/tools/pyterm/pyterm
export TERMFLAGS ?= -p "$(PORT)" -b "$(BAUD)"
else ifeq ($(RIOT_TERMINAL),picocom)
export TERMPROG ?= picocom
export TERMFLAGS ?= --nolock --imap lfcrlf --echo --baud "$(BAUD)" "$(PORT)"
endif
@@ -0,0 +1,16 @@
# This file contains a collection of targets defined by tools shipped with RIOT.
# The reason for keeping those targets separated from their tool Makfiles is
# that these targets have to be defined after the default build targets
# (as `all`), so `all` will always be the first target defined and thereby the
# default target when `make` is called without any further argument.
# target for building the bossac binary
$(RIOTBASE)/dist/tools/bossa/bossac:
@echo "[INFO] bossac binary not found - building it from source"
@make -C $(RIOTBASE)/dist/tools/bossa
@echo "[INFO] bossac binary successfully build!"
$(RIOTBASE)/dist/tools/edbg/edbg:
@echo "[INFO] edbg binary not found - building it from source now"
CC= CFLAGS= make -C $(RIOTBASE)/dist/tools/edbg
@echo "[INFO] edbg binary successfully build!"