-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding RFduino board support #2312
Closed
Closed
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
ad27a37
adding RFduino board support
rfswarm 7d67b34
Update board.c
rfswarm 3f474ea
Update board.h
rfswarm 49e09f6
Update openocd.cfg
rfswarm a893a1c
Update board.c
rfswarm c7a8c8f
Update periph_conf.h
rfswarm a8ccfde
Update board.h
rfswarm c912a77
Update periph_conf.h
rfswarm feeb83e
Update gdb.cfg
rfswarm File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# tell the Makefile.base which module to build | ||
MODULE = $(BOARD)_base | ||
|
||
include $(RIOTBASE)/Makefile.base |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
FEATURES_PROVIDED += cpp | ||
FEATURES_PROVIDED += periph_uart periph_gpio periph_random periph_rtt periph_cpuid | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# define the cpu used by the rfduino-nrf51822 board | ||
export CPU = nrf51822 | ||
export CPU_MODEL = nrf51822qfaa | ||
|
||
#define the default port depending on the host OS | ||
OS := $(shell uname) | ||
ifeq ($(OS),Linux) | ||
PORT ?= /dev/ttyUSB0 | ||
else ifeq ($(OS),Darwin) | ||
PORT ?= $(shell ls -1 /dev/tty.SLAB_USBtoUART* | head -n 1) | ||
else | ||
$(info CAUTION: No flash tool for your host system found!) | ||
# TODO: add support for windows as host platform | ||
endif | ||
export PORT | ||
|
||
# define tools used for building the project | ||
export PREFIX = arm-none-eabi- | ||
export CC = $(PREFIX)gcc | ||
export CXX = $(PREFIX)g++ | ||
export AR = $(PREFIX)ar | ||
export AS = $(PREFIX)as | ||
export LINK = $(PREFIX)gcc | ||
export SIZE = $(PREFIX)size | ||
export OBJCOPY = $(PREFIX)objcopy | ||
export TERMPROG = $(RIOTBASE)/dist/tools/pyterm/pyterm | ||
export FLASHER = $(RIOTBOARD)/$(BOARD)/dist/flash.sh | ||
export DEBUGGER = $(RIOTBOARD)/$(BOARD)/dist/debug.sh | ||
export DEBUGSERVER = $(RIOTBOARD)/$(BOARD)/dist/debug-server.sh | ||
export RESET = $(RIOTBOARD)/$(BOARD)/dist/reset.sh | ||
|
||
# define build specific options | ||
CPU_USAGE = -mcpu=cortex-m0 | ||
FPU_USAGE = | ||
export CFLAGS += -ggdb -g3 -std=gnu99 -Os -Wall -Wstrict-prototypes $(CPU_USAGE) $(FPU_USAGE) -mlittle-endian -mthumb -mthumb-interwork -nostartfiles | ||
export CFLAGS += -ffunction-sections -fdata-sections -fno-builtin | ||
export ASFLAGS += -ggdb -g3 $(CPU_USAGE) $(FPU_USAGE) -mlittle-endian | ||
export LINKFLAGS += -g3 -ggdb -std=gnu99 $(CPU_USAGE) $(FPU_USAGE) -mlittle-endian -static -lgcc -mthumb -mthumb-interwork -nostartfiles | ||
# $(LINKERSCRIPT) is specified in cpu/Makefile.include | ||
export LINKFLAGS += -T$(LINKERSCRIPT) | ||
export OFLAGS = -O binary | ||
export HEXFILE = $(ELFFILE:.elf=.bin) | ||
export TERMFLAGS += -p "$(PORT)" | ||
export FFLAGS = $(HEXFILE) | ||
export DEBUGGER_FLAGS = $(ELFFILE) | ||
|
||
# unwanted (CXXUWFLAGS) and extra (CXXEXFLAGS) flags for c++ | ||
export CXXUWFLAGS += | ||
export CXXEXFLAGS += | ||
|
||
# use the nano-specs of the NewLib when available | ||
ifeq ($(shell $(LINK) -specs=nano.specs -E - 2>/dev/null >/dev/null </dev/null ; echo $$?),0) | ||
export LINKFLAGS += -specs=nano.specs -lc -lnosys | ||
endif | ||
|
||
# export board specific includes to the global includes-listing | ||
export INCLUDES += -I$(RIOTBOARD)/$(BOARD)/include |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
/** | ||
* @ingroup board_rfduino-nrf51822 | ||
* @{ | ||
* | ||
* @file board.c | ||
* @brief Board specific implementations for the RFduino NRF51822 board | ||
* | ||
* @author Hauke Petersen <[email protected]> | ||
* @author Jan Wagner <[email protected]> | ||
* | ||
* @} | ||
*/ | ||
|
||
#include "board.h" | ||
#include "cpu.h" | ||
|
||
void board_init(void) | ||
{ | ||
/* initialize the CPU */ | ||
cpu_init(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/sh | ||
|
||
if [ -L "$0" ]; then | ||
FILE=$(readlink "$0") | ||
else | ||
FILE="$0" | ||
fi | ||
|
||
BIN_FOLDER=$(dirname "${FILE}") | ||
|
||
echo "##" | ||
echo "## Starting debug server" | ||
echo "##" | ||
openocd -f "${BIN_FOLDER}/openocd.cfg" \ | ||
-c "init" \ | ||
-c "targets" \ | ||
-c "reset halt" \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/sh | ||
|
||
if [ ! -f "$1" ]; then | ||
echo "ELF-file $1 does not exist" | ||
exit 1 | ||
fi | ||
|
||
if [ -L "$0" ]; then | ||
FILE=$(readlink "$0") | ||
else | ||
FILE="$0" | ||
fi | ||
|
||
BIN_FOLDER=$(dirname "${FILE}") | ||
|
||
echo "##" | ||
echo "## Debugging $1" | ||
echo "##" | ||
arm-none-eabi-gdb -tui -command="${BIN_FOLDER}/gdb.cfg" $1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/sh | ||
|
||
if [ ! -f "$1" ]; then | ||
echo "Binary file $1 does not exist" | ||
exit 1 | ||
fi | ||
|
||
if [ -L "$0" ]; then | ||
FILE=$(readlink "$0") | ||
else | ||
FILE="$0" | ||
fi | ||
|
||
BIN_FOLDER=$(dirname "${FILE}") | ||
|
||
echo "##" | ||
echo "## Flashing $1" | ||
echo "##" | ||
openocd -f "${BIN_FOLDER}/openocd.cfg" \ | ||
-c "init" \ | ||
-c "targets" \ | ||
-c "flash banks" \ | ||
-c "reset halt" \ | ||
-c "flash write_image erase $1 0" \ | ||
-c "verify_image $1" \ | ||
-c "reset run"\ | ||
-c "shutdown" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
target extended-remote :3333 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# nRF51822 Target | ||
source [find interface/stlink-v2.cfg] | ||
|
||
transport select hla_swd | ||
|
||
set WORKAREASIZE 0x4000 | ||
source [find target/nrf51.cfg] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/sh | ||
|
||
if [ -L "$0" ]; then | ||
FILE=$(readlink "$0") | ||
else | ||
FILE="$0" | ||
fi | ||
|
||
BIN_FOLDER=$(dirname "${FILE}") | ||
|
||
echo "##" | ||
echo "## Resetting $BOARD" | ||
echo "##" | ||
openocd -f "${BIN_FOLDER}/openocd.cfg" \ | ||
-c "init" \ | ||
-c "reset run" \ | ||
-c "shutdown" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
/** | ||
* @defgroup board_rfduino-nrf51822 RFduino NRF51822 | ||
* @ingroup boards | ||
* @brief Board specific files for the RFduino RF51822 board | ||
* @{ | ||
* | ||
* @file | ||
* @brief Board specific definitions for the RFduino RF51822 board | ||
* | ||
* @author Hauke Petersen <[email protected]> | ||
* @author Jan Wagner <[email protected]> | ||
*/ | ||
|
||
#ifndef __BOARD_H | ||
#define __BOARD_H | ||
|
||
#include "cpu.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/** | ||
* @name Define the nominal CPU core clock in this board | ||
*/ | ||
#define F_CPU (16000000UL) | ||
|
||
/** | ||
* @name Define the boards stdio | ||
* @{ | ||
*/ | ||
#define STDIO UART_0 | ||
#define STDIO_BAUDRATE (115200U) | ||
#define STDIO_RX_BUFSIZE (64U) | ||
/** @} */ | ||
|
||
/** | ||
* @name Assign the hardware timer | ||
*/ | ||
#define HW_TIMER TIMER_0 | ||
|
||
/** | ||
* @name Macros for controlling the on-board LEDs. | ||
* @{ | ||
*/ | ||
#define LED_RED_ON /* not available */ | ||
#define LED_RED_OFF /* not available */ | ||
#define LED_RED_TOGGLE /* not available */ | ||
#define LED_GREEN_ON /* not available */ | ||
#define LED_GREEN_OFF /* not available */ | ||
#define LED_GREEN_TOGGLE /* not available */ | ||
#define LED_BLUE_ON /* not available */ | ||
#define LED_BLUE_OFF /* not available */ | ||
#define LED_BLUE_TOGGLE /* not available */ | ||
/* @} */ | ||
|
||
/** | ||
* @brief Initialize board specific hardware, including clock, LEDs and std-IO | ||
*/ | ||
void board_init(void); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /** __BOARD_H */ | ||
/** @} */ |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove periph random in case it's not working
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm i dont have any edit rights anymore. I think moved the cloned riot-os from my own account. Hm well anyone with edit right feel free to edit :) " from unknown repository"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rfswarm Where/To whom did you move it? I don't have any rights for "unknown repository" neither. 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sh.. I think I removed and added the repository at my own git account. puh i am trying to fix it - maybe I can remove the 2312 pull and add a new one (with the same content and changes). I hope to google a solution today.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isaacs/github#168
yes this is my probem. i am new to this github thing. well
@thomaseichinger
thomas, I ll clone a new riot soon, copy the files and changes from this pull - and create a new pull ? - is this ok?