mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-25 14:33:52 +01:00
boards/pca10005: squash added Support for Nordic Dev Kit p2
This commit is contained in:
parent
c1993b1bf6
commit
5784a15cdd
2
boards/pca10000/dist/flash.sh
vendored
2
boards/pca10000/dist/flash.sh
vendored
@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
# This flash script dynamically generates a file with a set of commands which
|
||||
# have to be handed to the flashing script of SEGGER (JLinkExe).
|
||||
# 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.
|
||||
|
||||
|
||||
4
boards/pca10005/Makefile
Normal file
4
boards/pca10005/Makefile
Normal file
@ -0,0 +1,4 @@
|
||||
# tell the Makefile.base which module to build
|
||||
MODULE = $(BOARD)_base
|
||||
|
||||
include $(RIOTBASE)/Makefile.base
|
||||
46
boards/pca10005/Makefile.include
Normal file
46
boards/pca10005/Makefile.include
Normal file
@ -0,0 +1,46 @@
|
||||
# define the cpu used by the nRF51822 board pca10005
|
||||
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 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.py
|
||||
export FLASHER = $(RIOTBOARD)/$(BOARD)/dist/flash.sh $(BINDIR) $(RIOTBASE) $(APPLICATION) $(BOARD)
|
||||
export HEXFILE = $(ELFFILE:.elf=.bin)
|
||||
|
||||
# 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
|
||||
|
||||
# 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
|
||||
36
boards/pca10005/board.c
Normal file
36
boards/pca10005/board.c
Normal file
@ -0,0 +1,36 @@
|
||||
/*
|
||||
* 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_pca10005
|
||||
* @{
|
||||
*
|
||||
* @file board.c
|
||||
* @brief Board specific implementations for the nRF51822 evaluation board pca10005
|
||||
*
|
||||
* @author Christian Kühling <kuehling@zedat.fu-berlin.de>
|
||||
* @author Timo Ziegler <timo.ziegler@fu-berlin.de>
|
||||
*
|
||||
* @}
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "board.h"
|
||||
#include "cpu.h"
|
||||
#include "nrf51.h"
|
||||
#include "periph/uart.h"
|
||||
#include "periph/gpio.h"
|
||||
|
||||
extern void SystemInit(void);
|
||||
|
||||
void board_init(void)
|
||||
{
|
||||
/* initialize the CPU */
|
||||
cpu_init();
|
||||
}
|
||||
39
boards/pca10005/dist/flash.sh
vendored
Executable file
39
boards/pca10005/dist/flash.sh
vendored
Executable file
@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 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 Timo Ziegler <timo.ziegler@fu-berlin.de>
|
||||
|
||||
BINDIR=$1
|
||||
RIOTBASE=$2
|
||||
APPLICATION=$3
|
||||
BOARD=$4
|
||||
|
||||
if [[ $APPLICATION == test_* ]]
|
||||
then
|
||||
TYPE=tests
|
||||
else
|
||||
TYPE=examples
|
||||
fi
|
||||
|
||||
echo "log /dev/null" > $BINDIR/burn.seg
|
||||
echo "device nrf51822" >> $BINDIR/burn.seg
|
||||
echo "speed 1000" >> $BINDIR/burn.seg
|
||||
echo "w4 4001e504 1" >> $BINDIR/burn.seg
|
||||
echo "loadbin $RIOTBASE/$TYPE/$APPLICATION/bin/$BOARD/$APPLICATION.bin 0" >> $BINDIR/burn.seg
|
||||
echo "r" >> $BINDIR/burn.seg
|
||||
echo "g" >> $BINDIR/burn.seg
|
||||
echo "exit" >> $BINDIR/burn.seg
|
||||
echo "" >> $BINDIR/burn.seg
|
||||
JLinkExe < $BINDIR/burn.seg
|
||||
if [ -f JLink.log ]
|
||||
then
|
||||
rm JLink.log
|
||||
fi
|
||||
if [ -f ~/JLink.log ]
|
||||
then
|
||||
rm ~/JLink.log
|
||||
fi
|
||||
66
boards/pca10005/include/board.h
Normal file
66
boards/pca10005/include/board.h
Normal file
@ -0,0 +1,66 @@
|
||||
/*
|
||||
* 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_pca10005
|
||||
* @ingroup boards
|
||||
* @brief Board specific files for the nRF51822 board pca10005
|
||||
* @{
|
||||
*
|
||||
* @file board.h
|
||||
* @brief Board specific definitions for the nRF51822 evaluation board pca10005
|
||||
*
|
||||
* @author Christian Kühling <kuehling@zedat.fu-berlin.de>
|
||||
* @author Timo Ziegler <timo.ziegler@fu-berlin.de>
|
||||
*/
|
||||
|
||||
#ifndef __BOARD_H
|
||||
#define __BOARD_H
|
||||
|
||||
#include "cpu.h"
|
||||
|
||||
/**
|
||||
* @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)
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @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);
|
||||
|
||||
#endif /** __BOARD_H */
|
||||
/** @} */
|
||||
116
boards/pca10005/include/periph_conf.h
Normal file
116
boards/pca10005/include/periph_conf.h
Normal file
@ -0,0 +1,116 @@
|
||||
/*
|
||||
* 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_pca10005
|
||||
* @{
|
||||
*
|
||||
* @file periph_conf.h
|
||||
* @brief Peripheral MCU configuration for the nRF51822 board pca10005
|
||||
*
|
||||
* @author Christian Kühling <kuehling@zedat.fu-berlin.de>
|
||||
* @author Timo Ziegler <timo.ziegler@fu-berlin.de>
|
||||
*/
|
||||
|
||||
#ifndef __PERIPH_CONF_H
|
||||
#define __PERIPH_CONF_H
|
||||
|
||||
/**
|
||||
* @name Timer configuration
|
||||
* @{
|
||||
*/
|
||||
#define TIMER_NUMOF (1U)
|
||||
#define TIMER_0_EN 1
|
||||
/* timers 1 and 2 are not supported yet */
|
||||
#define TIMER_1_EN 0
|
||||
#define TIMER_2_EN 0
|
||||
#define TIMER_IRQ_PRIO 1
|
||||
|
||||
/* Timer 0 configuration */
|
||||
#define TIMER_0_DEV NRF_TIMER0
|
||||
#define TIMER_0_CHANNELS 3
|
||||
#define TIMER_0_MAX_VALUE (0xffffffff)
|
||||
#define TIMER_0_ISR isr_timer0
|
||||
#define TIMER_0_IRQ TIMER0_IRQn
|
||||
|
||||
/* Timer 1 configuration */
|
||||
#define TIMER_1_DEV NRF_TIMER1
|
||||
#define TIMER_1_CHANNELS 3
|
||||
#define TIMER_1_MAX_VALUE (0xffff)
|
||||
#define TIMER_1_ISR isr_timer1
|
||||
#define TIMER_1_IRQ TIMER1_IRQn
|
||||
|
||||
/* Timer 2 configuration */
|
||||
#define TIMER_2_DEV NRF_TIMER2
|
||||
#define TIMER_2_CHANNELS 3
|
||||
#define TIMER_2_MAX_VALUE (0xffff)
|
||||
#define TIMER_2_ISR isr_timer2
|
||||
#define TIMER_2_IRQ TIMER2_IRQn
|
||||
/** @} */
|
||||
|
||||
|
||||
/**
|
||||
* @name UART configuration
|
||||
* @{
|
||||
*/
|
||||
#define UART_NUMOF (1U)
|
||||
#define UART_0_EN 1
|
||||
#define UART_1_EN 0
|
||||
#define UART_IRQ_PRIO 1
|
||||
#define UART_CLK 14000000
|
||||
|
||||
/* UART 0 device configuration */
|
||||
#define UART_0_DEV NRF_UART0
|
||||
#define UART_0_PIN_RX 11
|
||||
#define UART_0_PIN_TX 9
|
||||
/** @} */
|
||||
|
||||
|
||||
/**
|
||||
* @name GPIO configuration
|
||||
* @{
|
||||
*/
|
||||
#define GPIO_NUMOF 16
|
||||
#define GPIO_0_EN 1
|
||||
#define GPIO_1_EN 1
|
||||
#define GPIO_2_EN 1
|
||||
#define GPIO_3_EN 1
|
||||
#define GPIO_4_EN 1
|
||||
#define GPIO_5_EN 1
|
||||
#define GPIO_6_EN 1
|
||||
#define GPIO_7_EN 1
|
||||
#define GPIO_8_EN 1
|
||||
#define GPIO_9_EN 1
|
||||
#define GPIO_10_EN 1
|
||||
#define GPIO_11_EN 1
|
||||
#define GPIO_12_EN 1
|
||||
#define GPIO_13_EN 1
|
||||
#define GPIO_14_EN 1
|
||||
#define GPIO_15_EN 1
|
||||
#define GPIO_IRQ_PRIO 1
|
||||
|
||||
/* GPIO pin configuration */
|
||||
#define GPIO_0_PIN 0
|
||||
#define GPIO_1_PIN 1
|
||||
#define GPIO_2_PIN 2
|
||||
#define GPIO_3_PIN 3
|
||||
#define GPIO_4_PIN 4
|
||||
#define GPIO_5_PIN 5
|
||||
#define GPIO_6_PIN 6
|
||||
#define GPIO_7_PIN 7
|
||||
#define GPIO_8_PIN 8
|
||||
#define GPIO_9_PIN 9
|
||||
#define GPIO_10_PIN 10
|
||||
#define GPIO_11_PIN 11
|
||||
#define GPIO_12_PIN 12
|
||||
#define GPIO_13_PIN 13
|
||||
#define GPIO_14_PIN 14
|
||||
#define GPIO_15_PIN 15
|
||||
/** @} */
|
||||
|
||||
#endif /* __PERIPH_CONF_H */
|
||||
Loading…
x
Reference in New Issue
Block a user