mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-30 17:01:19 +01:00
Merge pull request #14724 from fjmolinas/pr_cc2538_makefile.include
boards: use common Makefile.include for cc2538 boards
This commit is contained in:
commit
4ba791fcb9
@ -5,32 +5,8 @@ PROGRAMMER_SERIAL ?= 06EB
|
||||
# the debug UART is always the second tty with the matching serial number:
|
||||
PORT_LINUX ?= $(word 2,$(shell $(RIOTTOOLS)/usb-serial/find-tty.sh '^$(PROGRAMMER_SERIAL)'))
|
||||
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbserial*)))
|
||||
include $(RIOTMAKE)/tools/serial.inc.mk
|
||||
|
||||
# setup emulator
|
||||
include $(RIOTMAKE)/tools/renode.inc.mk
|
||||
|
||||
# debugger config
|
||||
DEBUGGER = $(RIOTBOARD)/cc2538dk/dist/debug.sh
|
||||
DEBUGSERVER = JLinkGDBServer -device CC2538SF53
|
||||
RESET ?= $(RIOTBOARD)/cc2538dk/dist/reset.sh
|
||||
|
||||
# Define the flash-tool and default port:
|
||||
PROGRAMMER ?= cc2538-bsl
|
||||
|
||||
ifeq ($(PROGRAMMER),cc2538-bsl)
|
||||
include $(RIOTMAKE)/tools/cc2538-bsl.inc.mk
|
||||
else ifeq ($(PROGRAMMER),jlink)
|
||||
FLASHER = $(RIOTBOARD)/cc2538dk/dist/flash.sh
|
||||
FFLAGS = $(BINDIR) $(FLASHFILE)
|
||||
endif
|
||||
|
||||
OFLAGS = --gap-fill 0xff
|
||||
FLASHFILE ?= $(BINFILE)
|
||||
DEBUGGER_FLAGS = $(BINDIR) $(ELFFILE)
|
||||
RESET_FLAGS ?= $(BINDIR)
|
||||
|
||||
OBJDUMPFLAGS += --disassemble --source --disassembler-options=force-thumb
|
||||
|
||||
# include common cc2538 includes
|
||||
INCLUDES += -I$(RIOTBOARD)/common/cc2538/include
|
||||
include $(RIOTBOARD)/common/cc2538/Makefile.include
|
||||
|
||||
30
boards/cc2538dk/dist/board.resc
vendored
30
boards/cc2538dk/dist/board.resc
vendored
@ -1,30 +0,0 @@
|
||||
mach create
|
||||
using sysbus
|
||||
machine LoadPlatformDescription @platforms/cpus/cc2538.repl
|
||||
|
||||
machine PyDevFromFile @scripts/pydev/rolling-bit.py 0x400D2004 0x4 True "sysctrl"
|
||||
|
||||
# show the UART output
|
||||
showAnalyzer uart0
|
||||
|
||||
# get an id value starting with 1
|
||||
$id = `next_value 1`
|
||||
|
||||
macro reset
|
||||
"""
|
||||
# set node address based on the $id variable. 0x00 0x12 0x4B is TI OUI
|
||||
sysbus WriteByte 0x00280028 $id
|
||||
sysbus WriteByte 0x0028002C 0x00
|
||||
sysbus WriteByte 0x00280030 0xAB
|
||||
sysbus WriteByte 0x00280034 0x89
|
||||
sysbus WriteByte 0x00280038 0x00
|
||||
sysbus WriteByte 0x0028003C 0x4B
|
||||
sysbus WriteByte 0x00280040 0x12
|
||||
sysbus WriteByte 0x00280044 0x00
|
||||
sysbus LoadBinary @http://antmicro.com/projects/renode/cc2538_rom_dump.bin-s_524288-0c196cdc21b5397f82e0ff42b206d1cc4b6d7522 0x0
|
||||
sysbus LoadELF $image_file
|
||||
cpu VectorTableOffset 0x200000
|
||||
"""
|
||||
|
||||
runMacro $reset
|
||||
start
|
||||
17
boards/cc2538dk/dist/debug.sh
vendored
17
boards/cc2538dk/dist/debug.sh
vendored
@ -1,17 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Start in-circuit debugging on this board: this script starts up the GDB
|
||||
# client and connects to a GDB server.
|
||||
#
|
||||
# Start the GDB server first using the 'make debugserver' target
|
||||
|
||||
# @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
||||
|
||||
BINDIR=$1
|
||||
ELFFILE=$2
|
||||
|
||||
# write GDB config file
|
||||
echo "target extended-remote 127.0.0.1:2331" > $BINDIR/gdb.cfg
|
||||
|
||||
# run GDB
|
||||
arm-none-eabi-gdb -tui -command=$BINDIR/gdb.cfg $ELFFILE
|
||||
23
boards/cc2538dk/dist/flash.sh
vendored
23
boards/cc2538dk/dist/flash.sh
vendored
@ -1,23 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# This flash script dynamically generates a file with a set of commands which
|
||||
# have to be handed to the flashing script of SEGGER (JLinkExe >4.84).
|
||||
# After that, JLinkExe will be executed with that set of commands to flash the
|
||||
# latest .bin file to the board.
|
||||
|
||||
# @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
||||
|
||||
BINDIR=$1
|
||||
BINFILE=$2
|
||||
FLASHADDR=200000
|
||||
|
||||
# setup JLink command file
|
||||
echo "speed 1000" > $BINDIR/burn.seg
|
||||
echo "loadbin $BINFILE $FLASHADDR" >> $BINDIR/burn.seg
|
||||
echo "r" >> $BINDIR/burn.seg
|
||||
echo "g" >> $BINDIR/burn.seg
|
||||
echo "exit" >> $BINDIR/burn.seg
|
||||
|
||||
# flash new binary to the board
|
||||
JLinkExe -device CC2538SF53 < $BINDIR/burn.seg
|
||||
echo ""
|
||||
17
boards/cc2538dk/dist/reset.sh
vendored
17
boards/cc2538dk/dist/reset.sh
vendored
@ -1,17 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# This script resets a CC2538SF53 target using JLink called
|
||||
# with a pre-defined reset sequence.
|
||||
|
||||
# @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
||||
|
||||
BINDIR=$1
|
||||
|
||||
# create JLink command file for resetting the board
|
||||
echo "r" >> $BINDIR/reset.seg
|
||||
echo "g" >> $BINDIR/reset.seg
|
||||
echo "exit" >> $BINDIR/reset.seg
|
||||
|
||||
# reset the board
|
||||
JLinkExe -device CC2538SF53 < $BINDIR/reset.seg
|
||||
echo ""
|
||||
30
boards/common/cc2538/Makefile.include
Normal file
30
boards/common/cc2538/Makefile.include
Normal file
@ -0,0 +1,30 @@
|
||||
# define the default flash-tool
|
||||
PROGRAMMER ?= cc2538-bsl
|
||||
|
||||
# setup serial terminal
|
||||
include $(RIOTMAKE)/tools/serial.inc.mk
|
||||
|
||||
# For backward compatibility
|
||||
ifneq (,$(PORT_BSL))
|
||||
$(warning Warning! PORT_BSL is deprecated use PROG_DEV)
|
||||
PROG_DEV ?= $(PORT_BSL)
|
||||
endif
|
||||
|
||||
ifeq ($(PROGRAMMER),cc2538-bsl)
|
||||
PROG_BAUD ?= 460800
|
||||
include $(RIOTMAKE)/tools/cc2538-bsl.inc.mk
|
||||
else ifeq ($(PROGRAMMER),jlink)
|
||||
# Special flashing and reset scripts are required due to board hardware
|
||||
FLASH_ADDR = 0x200000
|
||||
JLINK_DEVICE = CC2538SF53
|
||||
JLINK_IF = JTAG
|
||||
JLINK_RESET_FILE = $(RIOTBOARD)/common/cc2538/dist/hw_reset.seg
|
||||
include $(RIOTMAKE)/tools/jlink.inc.mk
|
||||
endif
|
||||
|
||||
OFLAGS = --gap-fill 0xff
|
||||
FLASHFILE ?= $(BINFILE)
|
||||
OBJDUMPFLAGS += --disassemble --source --disassembler-options=force-thumb
|
||||
|
||||
# include common cc2538 includes
|
||||
INCLUDES += -I$(RIOTBOARD)/common/cc2538/include
|
||||
3
boards/common/cc2538/dist/hw_reset.seg
vendored
Normal file
3
boards/common/cc2538/dist/hw_reset.seg
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
r
|
||||
g
|
||||
exit
|
||||
@ -1,34 +1,4 @@
|
||||
# define the default flash-tool
|
||||
PROGRAMMER ?= cc2538-bsl
|
||||
|
||||
# setup serial terminal
|
||||
include $(RIOTMAKE)/tools/serial.inc.mk
|
||||
|
||||
# For backward compatibility
|
||||
ifneq (,$(PORT_BSL))
|
||||
$(warning Warning! PORT_BSL is deprecated use PROG_DEV)
|
||||
PROG_DEV ?= $(PORT_BSL)
|
||||
endif
|
||||
|
||||
ifeq ($(PROGRAMMER),cc2538-bsl)
|
||||
PROG_BAUD ?= 115200
|
||||
include $(RIOTMAKE)/tools/cc2538-bsl.inc.mk
|
||||
else ifeq ($(PROGRAMMER),jlink)
|
||||
FLASHER = $(RIOTBOARD)/common/remote/dist/flash.sh
|
||||
FFLAGS = $(BINDIR) $(FLASHFILE)
|
||||
DEBUGGER = $(RIOTBOARD)/common/remote/dist/debug.sh
|
||||
DEBUGSERVER = JLinkGDBServer -device CC2538SF53
|
||||
RESET ?= $(RIOTBOARD)/common/remote/dist/reset.sh
|
||||
RESET_FLAGS ?= $(BINDIR)
|
||||
endif
|
||||
|
||||
OFLAGS = --gap-fill 0xff
|
||||
FLASHFILE ?= $(BINFILE)
|
||||
DEBUGGER_FLAGS = $(BINDIR) $(ELFFILE)
|
||||
OBJDUMPFLAGS += --disassemble --source --disassembler-options=force-thumb
|
||||
|
||||
# include common cc2538 includes
|
||||
INCLUDES += -I$(RIOTBOARD)/common/cc2538/include
|
||||
|
||||
# include common remote includes
|
||||
INCLUDES += -I$(RIOTBOARD)/common/remote/include
|
||||
|
||||
include $(RIOTBOARD)/common/cc2538/Makefile.include
|
||||
|
||||
17
boards/common/remote/dist/debug.sh
vendored
17
boards/common/remote/dist/debug.sh
vendored
@ -1,17 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Start in-circuit debugging on this board: this script starts up the GDB
|
||||
# client and connects to a GDB server.
|
||||
#
|
||||
# Start the GDB server first using the 'make debugserver' target
|
||||
|
||||
# @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
||||
|
||||
BINDIR=$1
|
||||
ELFFILE=$2
|
||||
|
||||
# write GDB config file
|
||||
echo "target extended-remote 127.0.0.1:2331" > $BINDIR/gdb.cfg
|
||||
|
||||
# run GDB
|
||||
arm-none-eabi-gdb -tui -command=$BINDIR/gdb.cfg $ELFFILE
|
||||
23
boards/common/remote/dist/flash.sh
vendored
23
boards/common/remote/dist/flash.sh
vendored
@ -1,23 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# This flash script dynamically generates a file with a set of commands which
|
||||
# have to be handed to the flashing script of SEGGER (JLinkExe >4.84).
|
||||
# After that, JLinkExe will be executed with that set of commands to flash the
|
||||
# latest .bin file to the board.
|
||||
|
||||
# @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
||||
|
||||
BINDIR=$1
|
||||
BINFILE=$2
|
||||
FLASHADDR=200000
|
||||
|
||||
# setup JLink command file
|
||||
echo "speed 1000" > $BINDIR/burn.seg
|
||||
echo "loadbin $BINFILE $FLASHADDR" >> $BINDIR/burn.seg
|
||||
echo "r" >> $BINDIR/burn.seg
|
||||
echo "g" >> $BINDIR/burn.seg
|
||||
echo "exit" >> $BINDIR/burn.seg
|
||||
|
||||
# flash new binary to the board
|
||||
JLinkExe -device CC2538SF53 < $BINDIR/burn.seg
|
||||
echo ""
|
||||
17
boards/common/remote/dist/reset.sh
vendored
17
boards/common/remote/dist/reset.sh
vendored
@ -1,17 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
# This script resets a CC2538SF53 target using JLink called
|
||||
# with a pre-defined reset sequence.
|
||||
|
||||
# @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
||||
|
||||
BINDIR=$1
|
||||
|
||||
# create JLink command file for resetting the board
|
||||
echo "r" >> $BINDIR/reset.seg
|
||||
echo "g" >> $BINDIR/reset.seg
|
||||
echo "exit" >> $BINDIR/reset.seg
|
||||
|
||||
# reset the board
|
||||
JLinkExe -device CC2538SF53 < $BINDIR/reset.seg
|
||||
echo ""
|
||||
@ -2,4 +2,4 @@
|
||||
PORT_LINUX ?= /dev/ttyUSB0
|
||||
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*)))
|
||||
|
||||
include $(RIOTBOARD)/common/remote/Makefile.include
|
||||
include $(RIOTBOARD)/common/cc2538/Makefile.include
|
||||
|
||||
@ -2,33 +2,11 @@
|
||||
PORT_LINUX ?= /dev/ttyUSB1
|
||||
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbserial*)))
|
||||
|
||||
# setup serial terminal
|
||||
include $(RIOTMAKE)/tools/serial.inc.mk
|
||||
|
||||
# Set default flash tool
|
||||
PROGRAMMER ?= cc2538-bsl
|
||||
|
||||
# For backward compatibility
|
||||
ifneq (,$(PORT_BSL))
|
||||
$(warning Warning! PORT_BSL is deprecated use PROG_DEV)
|
||||
PROG_DEV ?= $(PORT_BSL)
|
||||
endif
|
||||
|
||||
ifeq ($(PROGRAMMER),cc2538-bsl)
|
||||
FLASHFILE ?= $(HEXFILE)
|
||||
FFLAGS_OPTS ?= --bootloader-invert-lines
|
||||
PROG_BAUD ?= 460800
|
||||
include $(RIOTMAKE)/tools/cc2538-bsl.inc.mk
|
||||
else ifeq ($(PROGRAMMER),jlink)
|
||||
# Special flashing and reset scripts are required due to board hardware
|
||||
FLASH_ADDR = 0x200000
|
||||
JLINK_DEVICE = CC2538SF53
|
||||
JLINK_IF = JTAG
|
||||
JLINK_RESET_FILE = $(RIOTBOARD)/openmote-b/dist/hw_reset.seg
|
||||
include $(RIOTMAKE)/tools/jlink.inc.mk
|
||||
endif
|
||||
|
||||
OBJDUMPFLAGS += --disassemble --source --disassembler-options=force-thumb
|
||||
|
||||
# include common cc2538 includes
|
||||
INCLUDES += -I$(RIOTBOARD)/common/cc2538/include
|
||||
include $(RIOTBOARD)/common/cc2538/Makefile.include
|
||||
|
||||
4
boards/openmote-b/dist/hw_reset.seg
vendored
4
boards/openmote-b/dist/hw_reset.seg
vendored
@ -1,4 +0,0 @@
|
||||
r0
|
||||
sleep 100
|
||||
r1
|
||||
exit
|
||||
@ -2,22 +2,10 @@
|
||||
PORT_LINUX ?= /dev/ttyUSB0
|
||||
PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbserial*)))
|
||||
|
||||
# setup serial terminal
|
||||
include $(RIOTMAKE)/tools/serial.inc.mk
|
||||
# Set default flash tool
|
||||
PROGRAMMER ?= cc2538-bsl
|
||||
|
||||
ifeq ($(PROGRAMMER),jlink)
|
||||
# setup JLink for flashing
|
||||
JLINK_DEVICE = cc2538sf53
|
||||
FLASH_ADDR = 0x200000
|
||||
JLINK_IF = JTAG
|
||||
export TUI := 1
|
||||
include $(RIOTMAKE)/tools/jlink.inc.mk
|
||||
else ifeq ($(PROGRAMMER),cc2538-bsl)
|
||||
PROG_BAUD ?= 460800
|
||||
include $(RIOTMAKE)/tools/cc2538-bsl.inc.mk
|
||||
ifeq ($(PROGRAMMER),cc2538-bsl)
|
||||
FLASHFILE ?= $(HEXFILE)
|
||||
endif
|
||||
|
||||
# include common cc2538 includes
|
||||
INCLUDES += -I$(RIOTBOARD)/common/cc2538/include
|
||||
include $(RIOTBOARD)/common/cc2538/Makefile.include
|
||||
|
||||
@ -4,7 +4,7 @@ FFLAGS_OPTS ?=
|
||||
PROG_BAUD ?= 500000 # default value in cc2538-bsl
|
||||
FFLAGS = -p "$(PROG_DEV)" $(FFLAGS_OPTS) -e -w -v -b $(PROG_BAUD) $(FLASHFILE)
|
||||
|
||||
RESET ?= $(FLASHER) -p "$(PROG_DEV)" $(FFLAGS_OPTS)
|
||||
RESET ?= $(FLASHER) -p "$(PROG_DEV)" $(FFLAGS_OPTS) -b $(PROG_BAUD)
|
||||
|
||||
ifeq ($(RIOTTOOLS)/cc2538-bsl/cc2538-bsl.py,$(FLASHER))
|
||||
FLASHDEPS += $(FLASHER)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user