From cd998f6a2df67e33fb9252832451c12e96b074e8 Mon Sep 17 00:00:00 2001 From: Hauke Petersen Date: Tue, 4 Jun 2019 15:27:07 +0200 Subject: [PATCH 1/2] boards/microbit: use openocd as default programmer --- boards/microbit/Makefile.include | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/boards/microbit/Makefile.include b/boards/microbit/Makefile.include index 496edb3d1b..1ecc745974 100644 --- a/boards/microbit/Makefile.include +++ b/boards/microbit/Makefile.include @@ -5,21 +5,12 @@ export CPU_MODEL = nrf51x22xxab PORT_LINUX ?= /dev/ttyACM0 PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.SLAB_USBtoUART*))) -# this board supports flashing through plain fscopy, using JLink or using -# openocd. Default programmer is fscopy -PROGRAMMER ?= fscopy +# for this board we support flashing via openocd or pyocd +PROGRAMMER ?= openocd -ifeq (fscopy,$(PROGRAMMER)) - FFLAGS = $(HEXFILE) - DEBUGGER_FLAGS = - - FLASHER = $(RIOTBOARD)/$(BOARD)/dist/flash.sh - DEBUGGER = - DEBUGSERVER = -else ifeq (openocd,$(PROGRAMMER)) - # this board uses a daplink adapter by default +ifeq (openocd,$(PROGRAMMER)) DEBUG_ADAPTER = dap -else ifeq (pyocd, $(PROGRAMMER)) +else ifeq (pyocd,$(PROGRAMMER)) include $(RIOTMAKE)/tools/pyocd.inc.mk endif From f1631624549688433d594b9841e4c4a06435190a Mon Sep 17 00:00:00 2001 From: Hauke Petersen Date: Tue, 4 Jun 2019 15:27:33 +0200 Subject: [PATCH 2/2] boards/microbit: remove fscopy shell script --- boards/microbit/dist/flash.sh | 67 ----------------------------------- 1 file changed, 67 deletions(-) delete mode 100755 boards/microbit/dist/flash.sh diff --git a/boards/microbit/dist/flash.sh b/boards/microbit/dist/flash.sh deleted file mode 100755 index 6f8d9e11c4..0000000000 --- a/boards/microbit/dist/flash.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/bin/sh - -# Copyright (C) 2014 Freie Universität Berlin -# -# 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. - -# The micro:bit can be flashed through accessing it as a mass storage device. To -# upload a new firmware, simply copy your binary onto this device. -# -# Under Ubuntu/Mint the default mount-point is /media/$(USER)/MICROBIT -# -# @author Hauke Petersen -# @author Oliver Hahm - -OS=`uname` -DID_MOUNT=false -NAME="MICROBIT" - -HEXFILE=$1 - -# set the mount path depending on the OS -if [ ${OS} = "Linux" ] -then - MOUNT=/media/${USER}/${NAME} -elif [ ${OS} = "Darwin" ] -then - MOUNT=/Volumes/${NAME} -else - echo "" - echo "ERROR: No mount point defined for your OS" - echo "Please copy the binary manually to your micro:bit" - echo "" - exit -fi - -# check if device was mounted -mount | grep ${MOUNT} > /dev/null -if [ $? -eq 1 ] -then - mount ${MOUNT} - if [ $? -eq 1 ] - then - echo "" - echo "ERROR: could not mount your micro:bit" - echo "" - exit - else - DID_MOUNT=true - fi -fi - -# copy new binary to device -cp ${HEXFILE} ${MOUNT} -# make sure hexfile was written -sync - -# unmount the device if we have manually mounted it before -if [ ${DID_MOUNT} = true ] -then - umount ${MOUNT} -fi - -echo "" -echo "UPLOAD SUCCESSFUL" -echo ""