nrf5: Updating port with new content. SPI, SDcard (trough sdcard.py), Pin, and machine module. Also adding some basic modules depending on SDK and bluetooth stack from nordic semiconductor. NUS is module copied from original port by tralamazza, and new basic module for 6lowpan over BLE which can be used by modnetwork and modusocket. Basic BLE module to enable bluetooth stack and start a eddystone advertisment is kept, and still works without SDK, even if in the SDK folder (its placed there as it needs bluetooth stack from an SDK).

crypto-aes
Glenn Ruben Bakke 6 years ago
parent 227998f9cd
commit d7dc0b789d

@ -5,66 +5,89 @@ ifeq ($(wildcard boards/$(BOARD)/.),)
$(error Invalid BOARD specified)
endif
check_defined = \
$(strip $(foreach 1,$1, \
$(call __check_defined,$1,$(strip $(value 2)))))
__check_defined = \
$(if $(value $1),, \
$(error Undefined $1$(if $2, ($2))))
# If SoftDevice is selected, try to use that one.
SD ?= none
SD ?=
SD_LOWER = $(shell echo $(SD) | tr '[:upper:]' '[:lower:]')
# TODO: Verify that it is a valid target.
ifeq ($(SD), none)
ifeq ($(SD), )
# If the build directory is not given, make it reflect the board name.
BUILD ?= build-$(BOARD)
include ../py/mkenv.mk
include boards/$(BOARD)/mpconfigboard.mk
else
$(call check_defined, SDK_ROOT, path to SDK containing softdevice)
# If the build directory is not given, make it reflect the board name.
BUILD ?= build-$(BOARD)-$(SD_LOWER)
include ../py/mkenv.mk
include boards/$(BOARD)/mpconfigboard_$(SD_LOWER).mk
include sdk/sdk_common.mk
endif
# qstr definitions (must come before including py.mk)
QSTR_DEFS = qstrdefsport.h
QSTR_DEFS = qstrdefsport.h $(BUILD)/pins_qstr.h
FROZEN_MPY_DIR = modules
# include py core make definitions
include ../py/py.mk
FATFS_DIR = lib/fatfs
MPY_CROSS = ../mpy-cross/mpy-cross
MPY_TOOL = ../tools/mpy-tool.py
CROSS_COMPILE = arm-none-eabi-
MCU_VARIANT_LOWER = $(shell echo $(MCU_VARIANT) | tr '[:upper:]' '[:lower:]')
MCU_VARIANT_UPPER = $(shell echo $(MCU_VARIANT) | tr '[:lower:]' '[:upper:]')
INC = -I.
INC += -I.
INC += -I..
INC += -I$(BUILD)
INC += -I./device
INC += -I./../lib/cmsis/inc
INC += -I./device
INC += -I./device/$(MCU_VARIANT_LOWER)
INC += -I./device/$(MCU_VARIANT)
INC += -I./hal
INC += -I./hal/$(MCU_VARIANT_LOWER)
INC += -I./hal/$(MCU_VARIANT)
INC += -I./drivers
INC += -I../lib/mp-readline
NRF_DEFINES = -D$(MCU_VARIANT)
NRF_DEFINES = -D$(MCU_VARIANT_UPPER)
NRF_DEFINES += -DCONFIG_GPIO_AS_PINRESET
CFLAGS_CORTEX_M = -mthumb -mabi=aapcs -fsingle-precision-constant -Wdouble-promotion
CFLAGS_MCU_m4 = $(CFLAGS_CORTEX_M) -mtune=cortex-m4 -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard
CFLAGS_MCU_m4 = $(CFLAGS_CORTEX_M) -mtune=cortex-m4 -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -ffunction-sections -fdata-sections
CFLAGS_MCU_m0 = $(CFLAGS_CORTEX_M) --short-enums -mtune=cortex-m0 -mcpu=cortex-m0 -mfloat-abi=soft -fno-builtin
CFLAGS += $(CFLAGS_MCU_$(MCU_SERIES))
CFLAGS += $(INC) -Wall -Werror -ansi -std=gnu99 -nostdlib $(COPT) $(NRF_DEFINES)
CFLAGS += -fno-strict-aliasing
CFLAGS += -Iboards/$(BOARD)
CFLAGS += -DNRF5_HAL_H='<$(MCU_VARIANT)_hal.h>'
CFLAGS += -DMICROPY_QSTR_EXTRA_POOL=mp_qstr_frozen_const_pool
CFLAGS += -DMICROPY_MODULE_FROZEN_MPY
LDFLAGS = $(CFLAGS)
LDFLAGS += -Xlinker -Map=$(@:.elf=.map)
LDFLAGS += -mthumb -mabi=aapcs -T $(LD_FILE)
LDFLAGS += -mthumb -mabi=aapcs -T $(LD_FILE) -L boards/
#Debugging/Optimization
ifeq ($(DEBUG), 1)
#ASMFLAGS += -g -gtabs+
CFLAGS += -O0 -ggdb
LDFLAGS += -O0
else
@ -72,46 +95,132 @@ CFLAGS += -Os -DNDEBUG
LDFLAGS += -Os
endif
LIBS =
LIBS += \
SRC_LIB = $(addprefix lib/,\
libc/string0.c \
mp-readline/readline.c \
utils/pyexec.c \
utils/pyhelp.c \
utils/pyhelp.c \
timeutils/timeutils.c \
fatfs/ff.c \
fatfs/option/ccsbcs.c \
netutils/netutils.c \
)
SRC_HAL = $(addprefix hal/,\
hal_uart.c \
hal_uarte.c \
hal_spi.c \
hal_spie.c \
hal_time.c \
)
SRC_C += \
main.c \
device/$(MCU_VARIANT_LOWER)/system_$(MCU_VARIANT_LOWER).c \
modpyb.c \
led.c \
mphalport.c \
uart.c \
spi.c \
help.c \
gccollect.c \
pin_named_pins.c \
modmachine.c \
pin.c \
modutime.c \
moduos.c \
fatfs_port.c \
builtin_open.c \
lexerfatfs.c \
modusocket.c \
modnetwork.c \
#ifeq ($(SD), )
SRC_C += \
device/$(MCU_VARIANT)/system_$(MCU_VARIANT).c \
SRC_S = \
device/$(MCU_VARIANT_LOWER)/startup_$(MCU_VARIANT_LOWER).s \
device/$(MCU_VARIANT)/startup_$(MCU_VARIANT).s \
#endif
FROZEN_MPY_PY_FILES := $(shell find -L $(FROZEN_MPY_DIR) -type f -name '*.py')
FROZEN_MPY_MPY_FILES := $(addprefix $(BUILD)/,$(FROZEN_MPY_PY_FILES:.py=.mpy))
OBJ = $(PY_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o) $(SRC_S:.s=.o))
OBJ += $(PY_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o) $(SRC_S:.s=.o))
OBJ += $(addprefix $(BUILD)/, $(SRC_LIB:.c=.o))
OBJ += $(addprefix $(BUILD)/, $(SRC_HAL:.c=.o))
OBJ += $(BUILD)/pins_gen.o
OBJ += $(BUILD)/$(BUILD)/frozen_mpy.o
.phony: all flash
$(BUILD)/$(FATFS_DIR)/ff.o: COPT += -Os
$(filter $(PY_BUILD)/../extmod/vfs_fat_%.o, $(PY_O)): COPT += -Os
.phony: all flash sd
all: $(BUILD)/firmware.elf binary hex
flash: $(BUILD)/firmware.elf
nrfjprog --program $(BUILD)/firmware.hex --sectorerase -f $(MCU_VARIANT_LOWER)
nrfjprog --pinreset -f $(MCU_VARIANT_LOWER)
nrfjprog --program $(BUILD)/firmware.hex --sectorerase -f $(MCU_VARIANT)
nrfjprog --pinreset -f $(MCU_VARIANT)
sd:
nrfjprog --eraseall -f $(MCU_VARIANT)
nrfjprog --program $(SOFTDEV_HEX) -f $(MCU_VARIANT)
nrfjprog --program $(BUILD)/firmware.hex --sectorerase -f $(MCU_VARIANT)
nrfjprog --pinreset -f $(MCU_VARIANT)
$(BUILD)/firmware.elf: $(OBJ)
$(ECHO) "LINK $@"
$(Q)$(CC) $(LDFLAGS) -o $@ $(OBJ) $(LIBS)
$(Q)$(SIZE) $@
# List of sources for qstr extraction
SRC_QSTR += $(SRC_C) $(SRC_MOD) $(SRC_LIB)
# Append any auto-generated sources that are needed by sources listed in
# SRC_QSTR
SRC_QSTR_AUTO_DEPS +=
# Making OBJ use an order-only depenedency on the generated pins.h file
# has the side effect of making the pins.h file before we actually compile
# any of the objects. The normal dependency generation will deal with the
# case when pins.h is modified. But when it doesn't exist, we don't know
# which source files might need it.
$(OBJ): | $(HEADER_BUILD)/pins.h
# Use a pattern rule here so that make will only call make-pins.py once to make
# both pins_$(BOARD).c and pins.h
$(BUILD)/%_$(BOARD).c $(HEADER_BUILD)/%.h $(HEADER_BUILD)/%_af_const.h $(BUILD)/%_qstr.h: boards/$(BOARD)/%.csv $(MAKE_PINS) $(AF_FILE) $(PREFIX_FILE) | $(HEADER_BUILD)
$(ECHO) "Create $@"
$(Q)$(PYTHON) $(MAKE_PINS) --board $(BOARD_PINS) --af $(AF_FILE) --prefix $(PREFIX_FILE) --hdr $(GEN_PINS_HDR) --qstr $(GEN_PINS_QSTR) --af-const $(GEN_PINS_AF_CONST) --af-py $(GEN_PINS_AF_PY) > $(GEN_PINS_SRC)
$(BUILD)/pins_gen.o: $(BUILD)/pins_gen.c
$(call compile_c)
MAKE_PINS = boards/make-pins.py
BOARD_PINS = boards/$(BOARD)/pins.csv
AF_FILE = $(MCU_VARIANT)_af.csv
PREFIX_FILE = boards/$(MCU_VARIANT)_prefix.c
GEN_PINS_SRC = $(BUILD)/pins_gen.c
GEN_PINS_HDR = $(HEADER_BUILD)/pins.h
GEN_PINS_QSTR = $(BUILD)/pins_qstr.h
GEN_PINS_AF_CONST = $(HEADER_BUILD)/pins_af_const.h
GEN_PINS_AF_PY = $(BUILD)/pins_af.py
# to build .mpy files from .py files
$(BUILD)/$(FROZEN_MPY_DIR)/%.mpy: $(FROZEN_MPY_DIR)/%.py
@$(ECHO) "MPY $<"
$(Q)$(MKDIR) -p $(dir $@)
$(Q)$(MPY_CROSS) -o $@ -s $(^:$(FROZEN_MPY_DIR)/%=%) $^
# to build frozen_mpy.c from all .mpy files
$(BUILD)/frozen_mpy.c: $(FROZEN_MPY_MPY_FILES) $(BUILD)/genhdr/qstrdefs.generated.h
@$(ECHO) "Creating $@"
$(Q)$(PYTHON) $(MPY_TOOL) -f -q $(BUILD)/genhdr/qstrdefs.preprocessed.h -mlongint-impl mpz $(FROZEN_MPY_MPY_FILES) > $@
include ../py/mkrules.mk
include mkrules.mk

@ -40,13 +40,13 @@ SECTIONS
*/
/* used by the startup to initialize data */
_sidata = LOADADDR(.data);
_sidata = .;
/* This is the initialized data section
The program executes knowing that the data is in the RAM
but the loader puts the initial values in the FLASH (inidata).
It is one task of the startup to copy the initial values from FLASH to RAM. */
.data :
.data : AT (_sidata)
{
. = ALIGN(4);
_sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */
@ -56,7 +56,7 @@ SECTIONS
. = ALIGN(4);
_edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */
} >RAM AT> FLASH_TEXT
} >RAM
/* Uninitialized data section */
.bss :

@ -0,0 +1,398 @@
#!/usr/bin/env python
"""Creates the pin file for the nRF5."""
from __future__ import print_function
import argparse
import sys
import csv
SUPPORTED_FN = {
'UART' : ['RX', 'TX', 'CTS', 'RTS']
}
def parse_port_pin(name_str):
"""Parses a string and returns a (port-num, pin-num) tuple."""
if len(name_str) < 3:
raise ValueError("Expecting pin name to be at least 4 charcters.")
if name_str[0] != 'P':
raise ValueError("Expecting pin name to start with P")
if name_str[1] not in ('A'):
raise ValueError("Expecting pin port to be in A")
port = ord(name_str[1]) - ord('A')
pin_str = name_str[2:].split('/')[0]
if not pin_str.isdigit():
raise ValueError("Expecting numeric pin number.")
return (port, int(pin_str))
def split_name_num(name_num):
num = None
for num_idx in range(len(name_num) - 1, -1, -1):
if not name_num[num_idx].isdigit():
name = name_num[0:num_idx + 1]
num_str = name_num[num_idx + 1:]
if len(num_str) > 0:
num = int(num_str)
break
return name, num
class AlternateFunction(object):
"""Holds the information associated with a pins alternate function."""
def __init__(self, idx, af_str):
self.idx = idx
self.af_str = af_str
self.func = ''
self.fn_num = None
self.pin_type = ''
self.supported = False
af_words = af_str.split('_', 1)
self.func, self.fn_num = split_name_num(af_words[0])
if len(af_words) > 1:
self.pin_type = af_words[1]
if self.func in SUPPORTED_FN:
pin_types = SUPPORTED_FN[self.func]
if self.pin_type in pin_types:
self.supported = True
def is_supported(self):
return self.supported
def ptr(self):
"""Returns the numbered function (i.e. USART6) for this AF."""
if self.fn_num is None:
return self.func
return '{:s}{:d}'.format(self.func, self.fn_num)
def mux_name(self):
return 'AF{:d}_{:s}'.format(self.idx, self.ptr())
def print(self):
"""Prints the C representation of this AF."""
if self.supported:
print(' AF', end='')
else:
print(' //', end='')
fn_num = self.fn_num
if fn_num is None:
fn_num = 0
print('({:2d}, {:8s}, {:2d}, {:10s}, {:8s}), // {:s}'.format(self.idx,
self.func, fn_num, self.pin_type, self.ptr(), self.af_str))
def qstr_list(self):
return [self.mux_name()]
class Pin(object):
"""Holds the information associated with a pin."""
def __init__(self, port, pin):
self.port = port
self.pin = pin
self.alt_fn = []
self.alt_fn_count = 0
self.adc_num = 0
self.adc_channel = 0
self.board_pin = False
def port_letter(self):
return chr(self.port + ord('A'))
def cpu_pin_name(self):
return '{:s}{:d}'.format(self.port_letter(), self.pin)
def is_board_pin(self):
return self.board_pin
def set_is_board_pin(self):
self.board_pin = True
def parse_adc(self, adc_str):
if (adc_str[:3] != 'ADC'):
return
(adc,channel) = adc_str.split('_')
for idx in range(3, len(adc)):
adc_num = int(adc[idx]) # 1, 2, or 3
self.adc_num |= (1 << (adc_num - 1))
self.adc_channel = int(channel[2:])
def parse_af(self, af_idx, af_strs_in):
if len(af_strs_in) == 0:
return
# If there is a slash, then the slash separates 2 aliases for the
# same alternate function.
af_strs = af_strs_in.split('/')
for af_str in af_strs:
alt_fn = AlternateFunction(af_idx, af_str)
self.alt_fn.append(alt_fn)
if alt_fn.is_supported():
self.alt_fn_count += 1
def alt_fn_name(self, null_if_0=False):
if null_if_0 and self.alt_fn_count == 0:
return 'NULL'
return 'pin_{:s}_af'.format(self.cpu_pin_name())
def adc_num_str(self):
str = ''
for adc_num in range(1,4):
if self.adc_num & (1 << (adc_num - 1)):
if len(str) > 0:
str += ' | '
str += 'PIN_ADC'
str += chr(ord('0') + adc_num)
if len(str) == 0:
str = '0'
return str
def print(self):
if self.alt_fn_count == 0:
print("// ", end='')
print('const pin_af_obj_t {:s}[] = {{'.format(self.alt_fn_name()))
for alt_fn in self.alt_fn:
alt_fn.print()
if self.alt_fn_count == 0:
print("// ", end='')
print('};')
print('')
print('const pin_obj_t pin_{:s} = PIN({:s}, {:d}, {:s}, {:s}, {:d});'.format(
self.cpu_pin_name(), self.port_letter(), self.pin,
self.alt_fn_name(null_if_0=True),
self.adc_num_str(), self.adc_channel))
print('')
def print_header(self, hdr_file):
hdr_file.write('extern const pin_obj_t pin_{:s};\n'.
format(self.cpu_pin_name()))
if self.alt_fn_count > 0:
hdr_file.write('extern const pin_af_obj_t pin_{:s}_af[];\n'.
format(self.cpu_pin_name()))
def qstr_list(self):
result = []
for alt_fn in self.alt_fn:
if alt_fn.is_supported():
result += alt_fn.qstr_list()
return result
class NamedPin(object):
def __init__(self, name, pin):
self._name = name
self._pin = pin
def pin(self):
return self._pin
def name(self):
return self._name
class Pins(object):
def __init__(self):
self.cpu_pins = [] # list of NamedPin objects
self.board_pins = [] # list of NamedPin objects
def find_pin(self, port_num, pin_num):
for named_pin in self.cpu_pins:
pin = named_pin.pin()
if pin.port == port_num and pin.pin == pin_num:
return pin
def parse_af_file(self, filename, pinname_col, af_col):
with open(filename, 'r') as csvfile:
rows = csv.reader(csvfile)
for row in rows:
try:
(port_num, pin_num) = parse_port_pin(row[pinname_col])
except:
continue
pin = Pin(port_num, pin_num)
for af_idx in range(af_col, len(row)):
if af_idx >= af_col:
pin.parse_af(af_idx - af_col, row[af_idx])
self.cpu_pins.append(NamedPin(pin.cpu_pin_name(), pin))
def parse_board_file(self, filename):
with open(filename, 'r') as csvfile:
rows = csv.reader(csvfile)
for row in rows:
try:
(port_num, pin_num) = parse_port_pin(row[1])
except:
continue
pin = self.find_pin(port_num, pin_num)
if pin:
pin.set_is_board_pin()
self.board_pins.append(NamedPin(row[0], pin))
def print_named(self, label, named_pins):
print('STATIC const mp_map_elem_t pin_{:s}_pins_locals_dict_table[] = {{'.format(label))
for named_pin in named_pins:
pin = named_pin.pin()
if pin.is_board_pin():
print(' {{ MP_OBJ_NEW_QSTR(MP_QSTR_{:s}), (mp_obj_t)&pin_{:s} }},'.format(named_pin.name(), pin.cpu_pin_name()))
print('};')
print('MP_DEFINE_CONST_DICT(pin_{:s}_pins_locals_dict, pin_{:s}_pins_locals_dict_table);'.format(label, label));
def print(self):
for named_pin in self.cpu_pins:
pin = named_pin.pin()
if pin.is_board_pin():
pin.print()
self.print_named('cpu', self.cpu_pins)
print('')
self.print_named('board', self.board_pins)
def print_adc(self, adc_num):
print('');
print('const pin_obj_t * const pin_adc{:d}[] = {{'.format(adc_num))
for channel in range(16):
adc_found = False
for named_pin in self.cpu_pins:
pin = named_pin.pin()
if (pin.is_board_pin() and
(pin.adc_num & (1 << (adc_num - 1))) and (pin.adc_channel == channel)):
print(' &pin_{:s}, // {:d}'.format(pin.cpu_pin_name(), channel))
adc_found = True
break
if not adc_found:
print(' NULL, // {:d}'.format(channel))
print('};')
def print_header(self, hdr_filename):
with open(hdr_filename, 'wt') as hdr_file:
for named_pin in self.cpu_pins:
pin = named_pin.pin()
if pin.is_board_pin():
pin.print_header(hdr_file)
hdr_file.write('extern const pin_obj_t * const pin_adc1[];\n')
hdr_file.write('extern const pin_obj_t * const pin_adc2[];\n')
hdr_file.write('extern const pin_obj_t * const pin_adc3[];\n')
def print_qstr(self, qstr_filename):
with open(qstr_filename, 'wt') as qstr_file:
qstr_set = set([])
for named_pin in self.cpu_pins:
pin = named_pin.pin()
if pin.is_board_pin():
qstr_set |= set(pin.qstr_list())
qstr_set |= set([named_pin.name()])
for named_pin in self.board_pins:
qstr_set |= set([named_pin.name()])
for qstr in sorted(qstr_set):
print('Q({})'.format(qstr), file=qstr_file)
def print_af_hdr(self, af_const_filename):
with open(af_const_filename, 'wt') as af_const_file:
af_hdr_set = set([])
mux_name_width = 0
for named_pin in self.cpu_pins:
pin = named_pin.pin()
if pin.is_board_pin():
for af in pin.alt_fn:
if af.is_supported():
mux_name = af.mux_name()
af_hdr_set |= set([mux_name])
if len(mux_name) > mux_name_width:
mux_name_width = len(mux_name)
for mux_name in sorted(af_hdr_set):
key = 'MP_OBJ_NEW_QSTR(MP_QSTR_{}),'.format(mux_name)
val = 'MP_OBJ_NEW_SMALL_INT(GPIO_{})'.format(mux_name)
print(' { %-*s %s },' % (mux_name_width + 26, key, val),
file=af_const_file)
def print_af_py(self, af_py_filename):
with open(af_py_filename, 'wt') as af_py_file:
print('PINS_AF = (', file=af_py_file);
for named_pin in self.board_pins:
print(" ('%s', " % named_pin.name(), end='', file=af_py_file)
for af in named_pin.pin().alt_fn:
if af.is_supported():
print("(%d, '%s'), " % (af.idx, af.af_str), end='', file=af_py_file)
print('),', file=af_py_file)
print(')', file=af_py_file)
def main():
parser = argparse.ArgumentParser(
prog="make-pins.py",
usage="%(prog)s [options] [command]",
description="Generate board specific pin file"
)
parser.add_argument(
"-a", "--af",
dest="af_filename",
help="Specifies the alternate function file for the chip",
default="nrf.csv"
)
parser.add_argument(
"--af-const",
dest="af_const_filename",
help="Specifies header file for alternate function constants.",
default="build/pins_af_const.h"
)
parser.add_argument(
"--af-py",
dest="af_py_filename",
help="Specifies the filename for the python alternate function mappings.",
default="build/pins_af.py"
)
parser.add_argument(
"-b", "--board",
dest="board_filename",
help="Specifies the board file",
)
parser.add_argument(
"-p", "--prefix",
dest="prefix_filename",
help="Specifies beginning portion of generated pins file",
default="nrf52_prefix.c"
)
parser.add_argument(
"-q", "--qstr",
dest="qstr_filename",
help="Specifies name of generated qstr header file",
default="build/pins_qstr.h"
)
parser.add_argument(
"-r", "--hdr",
dest="hdr_filename",
help="Specifies name of generated pin header file",
default="build/pins.h"
)
args = parser.parse_args(sys.argv[1:])
pins = Pins()
print('// This file was automatically generated by make-pins.py')
print('//')
if args.af_filename:
print('// --af {:s}'.format(args.af_filename))
pins.parse_af_file(args.af_filename, 1, 2)
if args.board_filename:
print('// --board {:s}'.format(args.board_filename))
pins.parse_board_file(args.board_filename)
if args.prefix_filename:
print('// --prefix {:s}'.format(args.prefix_filename))
print('')
with open(args.prefix_filename, 'r') as prefix_file:
print(prefix_file.read())
pins.print()
pins.print_header(args.hdr_filename)
pins.print_qstr(args.qstr_filename)
pins.print_af_hdr(args.af_const_filename)
pins.print_af_py(args.af_py_filename)
if __name__ == "__main__":
main()

@ -13,8 +13,8 @@ MEMORY
}
/* produce a link error if there is not this amount of RAM for these sections */
_minimum_stack_size = 2K;
_minimum_heap_size = 10K;
_minimum_stack_size = 4K;
_minimum_heap_size = 8K;
/* top end of the stack */
@ -23,6 +23,6 @@ _estack = ORIGIN(RAM) + LENGTH(RAM);
/* RAM extents for the garbage collector */
_ram_end = ORIGIN(RAM) + LENGTH(RAM);
_heap_end = 0x20001000; /* tunable */
_heap_end = 0x20002000; /* tunable */
INCLUDE "boards/common.ld"

@ -8,10 +8,10 @@ MEMORY
{
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x040000 /* entire flash, 256 KiB */
FLASH_ISR (rx) : ORIGIN = 0x00018000, LENGTH = 0x000400 /* sector 0, 1 KiB */
FLASH_TEXT (rx) : ORIGIN = 0x00018400, LENGTH = 0x027c00 /* 175 KiB */
RAM (xrw) : ORIGIN = 0x20002000, LENGTH = 0x002000 /* 9.89 KiB */
FLASH_TEXT (rx) : ORIGIN = 0x00018400, LENGTH = 0x027c00 /* 159 KiB */
RAM (xrw) : ORIGIN = 0x20002000, LENGTH = 0x002000 /* 8 KiB */
}
/* produce a link error if there is not this amount of RAM for these sections */
_minimum_stack_size = 2K;
_minimum_heap_size = 4K;

@ -8,8 +8,8 @@ MEMORY
{
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x040000 /* entire flash, 256 KiB */
FLASH_ISR (rx) : ORIGIN = 0x00018000, LENGTH = 0x000400 /* sector 0, 1 KiB */
FLASH_TEXT (rx) : ORIGIN = 0x00018400, LENGTH = 0x027c00 /* 175 KiB */
RAM (xrw) : ORIGIN = 0x20002000, LENGTH = 0x006000 /* 9.89 KiB */
FLASH_TEXT (rx) : ORIGIN = 0x00018400, LENGTH = 0x027c00 /* 159 KiB */
RAM (xrw) : ORIGIN = 0x20002000, LENGTH = 0x006000 /* 24 KiB */
}
/* produce a link error if there is not this amount of RAM for these sections */

@ -8,7 +8,7 @@ MEMORY
{
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x040000 /* entire flash, 256 KiB */
FLASH_ISR (rx) : ORIGIN = 0x0001D000, LENGTH = 0x000400 /* sector 0, 1 KiB */
FLASH_TEXT (rx) : ORIGIN = 0x0001D400, LENGTH = 0x027c00 /* 139 KiB */
FLASH_TEXT (rx) : ORIGIN = 0x0001D400, LENGTH = 0x022c00 /* 139 KiB */
RAM (xrw) : ORIGIN = 0x20002800, LENGTH = 0x005800 /* 22 KiB */
}

@ -1,5 +1,5 @@
/*
GNU linker script for NRF51822 AC w/ S130 2.0.0 SoftDevice
GNU linker script for NRF51822 AC w/ S130 2.0.1 SoftDevice
*/
/* Specify the memory areas */
SEARCH_DIR(.)
@ -9,7 +9,7 @@ MEMORY
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x040000 /* entire flash, 256 KiB */
FLASH_ISR (rx) : ORIGIN = 0x0001b000, LENGTH = 0x000400 /* sector 0, 1 KiB */
FLASH_TEXT (rx) : ORIGIN = 0x0001b400, LENGTH = 0x024c00 /* 147 KiB */
RAM (xrw) : ORIGIN = 0x20001870, LENGTH = 0x002970 /* 9.89 KiB */
RAM (xrw) : ORIGIN = 0x200013c8, LENGTH = 0x006c38 /* 27 KiB */
}
/* produce a link error if there is not this amount of RAM for these sections */

@ -0,0 +1,32 @@
// nrf51_prefix.c becomes the initial portion of the generated pins file.
#include <stdio.h>
#include "py/obj.h"
#include "py/mphal.h"
#include "pin.h"
#define AF(af_idx, af_fn, af_unit, af_type, af_ptr) \
{ \
{ &pin_af_type }, \
.name = MP_QSTR_AF ## af_idx ## _ ## af_fn ## af_unit, \
.idx = (af_idx), \
.fn = AF_FN_ ## af_fn, \
.unit = (af_unit), \
.type = AF_PIN_TYPE_ ## af_fn ## _ ## af_type, \
.af_fn = (af_ptr) \
}
#define PIN(p_port, p_pin, p_af, p_adc_num, p_adc_channel) \
{ \
{ &pin_type }, \
.name = MP_QSTR_ ## p_port ## p_pin, \
.port = PORT_ ## p_port, \
.pin = (p_pin), \
.num_af = (sizeof(p_af) / sizeof(pin_af_obj_t)), \
.pin_mask = (1 << p_pin), \
.gpio = GPIO_BASE, \
.af = p_af, \
.adc_num = p_adc_num, \
.adc_channel = p_adc_channel, \
}

@ -8,7 +8,7 @@ MEMORY
FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x080000 /* entire flash, 512 KiB */
FLASH_ISR (rx) : ORIGIN = 0x0001f000, LENGTH = 0x001000 /* sector 0, 4 KiB */
FLASH_TEXT (rx) : ORIGIN = 0x00020000, LENGTH = 0x060000 /* 396 KiB */
RAM (xrw) : ORIGIN = 0x200039c0, LENGTH = 0x0c640 /* 57.89 KiB, give 8KiB headroom for softdevice */
RAM (xrw) : ORIGIN = 0x200039c0, LENGTH = 0x0c640 /* 49.5 KiB, give 8KiB headroom for softdevice */
}
/* produce a link error if there is not this amount of RAM for these sections */

@ -5,15 +5,15 @@
/* Specify the memory areas */
MEMORY
{
FLASH (rx) : ORIGIN = 0x0001F000, LENGTH = 0x61000
FLASH_ISR (rx) : ORIGIN = 0x0001F000, LENGTH = 0x00400
FLASH_TEXT (rx) : ORIGIN = 0x0001F400, LENGTH = 0x60c00
RAM (xrw) : ORIGIN = 0x20002800, LENGTH = 0x0D800
FLASH (rx) : ORIGIN = 0x0001F000, LENGTH = 0x061000 /* entire flash, 512 KiB */
FLASH_ISR (rx) : ORIGIN = 0x0001F000, LENGTH = 0x000400 /* sector 0, 4 KiB */
FLASH_TEXT (rx) : ORIGIN = 0x0001F400, LENGTH = 0x060c00 /* 396 KiB */
RAM (xrw) : ORIGIN = 0x20002800, LENGTH = 0x00D800 /* 54 KiB */
}
/* produce a link error if there is not this amount of RAM for these sections */
_minimum_stack_size = 6K;
_minimum_heap_size = 16K;
_minimum_stack_size = 16K;
_minimum_heap_size = 20K;
/* top end of the stack */
@ -22,108 +22,6 @@ _estack = ORIGIN(RAM) + LENGTH(RAM);
/* RAM extents for the garbage collector */
_ram_end = ORIGIN(RAM) + LENGTH(RAM);
_heap_end = 0x20005000; /* tunable */
_heap_end = 0x20008800; /* tunable */
/* define output sections */
SECTIONS
{
/* The startup code goes first into FLASH */
.isr_vector :
{
. = ALIGN(4);
KEEP(*(.isr_vector)) /* Startup code */
. = ALIGN(4);
} >FLASH_ISR
/* The program code and other data goes into FLASH */
.text :
{
. = ALIGN(4);
*(.text) /* .text sections (code) */
*(.text*) /* .text* sections (code) */
*(.rodata) /* .rodata sections (constants, strings, etc.) */
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
/* *(.glue_7) */ /* glue arm to thumb code */
/* *(.glue_7t) */ /* glue thumb to arm code */
. = ALIGN(4);
_etext = .; /* define a global symbol at end of code */
} >FLASH_TEXT
/*
.ARM.extab :
{
*(.ARM.extab* .gnu.linkonce.armextab.*)
} >FLASH
.ARM :
{
__exidx_start = .;
*(.ARM.exidx*)
__exidx_end = .;
} >FLASH
*/
/* used by the startup to initialize data */
_sidata = LOADADDR(.data);
/* This is the initialized data section
The program executes knowing that the data is in the RAM
but the loader puts the initial values in the FLASH (inidata).
It is one task of the startup to copy the initial values from FLASH to RAM. */
.data :
{
. = ALIGN(4);
_sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */
_ram_start = .; /* create a global symbol at ram start for garbage collector */
*(.data) /* .data sections */
*(.data*) /* .data* sections */
. = ALIGN(4);
_edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */
} >RAM AT> FLASH_TEXT
/* Uninitialized data section */
.bss :
{
. = ALIGN(4);
_sbss = .; /* define a global symbol at bss start; used by startup code */
*(.bss)
*(.bss*)
*(COMMON)
. = ALIGN(4);
_ebss = .; /* define a global symbol at bss end; used by startup code and GC */
} >RAM
/* this is to define the start of the heap, and make sure we have a minimum size */
.heap :
{
. = ALIGN(4);
PROVIDE ( end = . );
PROVIDE ( _end = . );
_heap_start = .; /* define a global symbol at heap start */
. = . + _minimum_heap_size;
} >RAM
/* this just checks there is enough RAM for the stack */
.stack :
{
. = ALIGN(4);
. = . + _minimum_stack_size;
. = ALIGN(4);
} >RAM
/* Remove information from the standard libraries */
/*
/DISCARD/ :
{
libc.a ( * )
libm.a ( * )
libgcc.a ( * )
}
*/
.ARM.attributes 0 : { *(.ARM.attributes) }
}
INCLUDE "boards/common.ld"

@ -0,0 +1,32 @@
// nrf52_prefix.c becomes the initial portion of the generated pins file.
#include <stdio.h>
#include "py/obj.h"
#include "py/mphal.h"
#include "pin.h"
#define AF(af_idx, af_fn, af_unit, af_type, af_ptr) \
{ \
{ &pin_af_type }, \
.name = MP_QSTR_AF ## af_idx ## _ ## af_fn ## af_unit, \
.idx = (af_idx), \
.fn = AF_FN_ ## af_fn, \
.unit = (af_unit), \
.type = AF_PIN_TYPE_ ## af_fn ## _ ## af_type, \
.af_fn = (af_ptr) \
}
#define PIN(p_port, p_pin, p_af, p_adc_num, p_adc_channel) \
{ \
{ &pin_type }, \
.name = MP_QSTR_ ## p_port ## p_pin, \
.port = PORT_ ## p_port, \
.pin = (p_pin), \
.num_af = (sizeof(p_af) / sizeof(pin_af_obj_t)), \
.pin_mask = (1 << p_pin), \
.gpio = GPIO_BASE, \
.af = p_af, \
.adc_num = p_adc_num, \
.adc_channel = p_adc_channel, \
}

@ -30,6 +30,8 @@
#define MICROPY_HW_MCU_NAME "NRF51822"
#define MICROPY_PY_SYS_PLATFORM "nrf51-dongle"
#define MICROPY_PY_MACHINE_SPI (0)
#define MICROPY_HW_HAS_SWITCH (0)
#define MICROPY_HW_HAS_FLASH (0)
#define MICROPY_HW_HAS_SDCARD (0)

@ -1,6 +1,4 @@
MCU_SERIES = m0
MCU_VARIANT = NRF51
MCU_VARIANT = nrf51
LD_FILE = boards/nrf51822_aa.ld
SRC_C += \
hal/hal_uart.c

@ -1,13 +1,3 @@
MCU_SERIES = m0
MCU_VARIANT = NRF51
MCU_VARIANT = nrf51
LD_FILE = boards/nrf51822_aa_s110.ld
SRC_C += \
hal/hal_uart.c \
softdevice/modble.c \
softdevice/softdevice.c
CFLAGS += -I./softdevice
CFLAGS += -I./softdevice/s110/headers
CFLAGS += -DBLUETOOTH_SD=110
CFLAGS += -DBLUETOOTH_SD_DEBUG=1

@ -0,0 +1,7 @@
#ifndef NRF51_HAL_CONF_H__
#define NRF51_HAL_CONF_H__
#define HAL_UART_MODULE_ENABLED
#define HAL_TIME_MODULE_ENABLED
#endif // NRF51_HAL_CONF_H__

@ -0,0 +1,7 @@
UART_RTS,PA8
UART_TX,PA9
UART_CTS,PA10
UART_RX,PA11
LED_RED,PA21
LED_GREEN,PA22
LED_BLUE,PA23
1 UART_RTS PA8
2 UART_TX PA9
3 UART_CTS PA10
4 UART_RX PA11
5 LED_RED PA21
6 LED_GREEN PA22
7 LED_BLUE PA23

@ -1,6 +1,3 @@
MCU_SERIES = m0
MCU_VARIANT = NRF51
MCU_VARIANT = nrf51
LD_FILE = boards/nrf51822_aa.ld
SRC_C += \
hal/hal_uart.c

@ -0,0 +1,3 @@
MCU_SERIES = m0
MCU_VARIANT = nrf51
LD_FILE = boards/nrf51822_aa_s110.ld

@ -0,0 +1,8 @@
#ifndef NRF51_HAL_CONF_H__
#define NRF51_HAL_CONF_H__
#define HAL_UART_MODULE_ENABLED
#define HAL_SPI_MODULE_ENABLED
#define HAL_TIME_MODULE_ENABLED
#endif // NRF51_HAL_CONF_H__

@ -0,0 +1,32 @@
PA0,PA0
PA1,PA1
PA2,PA2
PA3,PA3
PA4,PA4
PA5,PA5
PA6,PA6
PA7,PA7
UART_RTS,PA8
UART_TX,PA9
UART_CTS,PA10
UART_RX,PA11
PA12,PA12
PA13,PA13
PA14,PA14
PA15,PA15
PA16,PA16
PA17,PA17
PA18,PA18
PA19,PA19
PA20,PA20
PA21,PA21
PA22,PA22
PA23,PA23
PA24,PA24
PA25,PA25
PA26,PA26
PA27,PA27
PA28,PA28
PA29,PA29
PA30,PA30
PA31,PA31
1 PA0 PA0
2 PA1 PA1
3 PA2 PA2
4 PA3 PA3
5 PA4 PA4
6 PA5 PA5
7 PA6 PA6
8 PA7 PA7
9 UART_RTS PA8
10 UART_TX PA9
11 UART_CTS PA10
12 UART_RX PA11
13 PA12 PA12
14 PA13 PA13
15 PA14 PA14
16 PA15 PA15
17 PA16 PA16
18 PA17 PA17
19 PA18 PA18
20 PA19 PA19
21 PA20 PA20
22 PA21 PA21
23 PA22 PA22
24 PA23 PA23
25 PA24 PA24
26 PA25 PA25
27 PA26 PA26
28 PA27 PA27
29 PA28 PA28
30 PA29 PA29
31 PA30 PA30
32 PA31 PA31

@ -30,6 +30,9 @@
#define MICROPY_HW_MCU_NAME "NRF51822"
#define MICROPY_PY_SYS_PLATFORM "nrf51-DK"
#define MICROPY_PY_USOCKET (0)
#define MICROPY_PY_NETWORK (0)
#define MICROPY_HW_HAS_SWITCH (0)
#define MICROPY_HW_HAS_FLASH (0)
#define MICROPY_HW_HAS_SDCARD (0)
@ -57,4 +60,11 @@
#define MICROPY_HW_UART1_RTS (8)
#define MICROPY_HW_UART1_HWFC (0)
// SPI0 config
#define MICROPY_HW_SPI0_NAME "SPI0"
#define MICROPY_HW_SPI0_SCK (1) // A3
#define MICROPY_HW_SPI0_MOSI (2) // A2
#define MICROPY_HW_SPI0_MISO (3) // A1
#define MICROPY_HW_SPI0_NSS (4) // A4
#define HELP_TEXT_BOARD_LED "1,2,3,4"

@ -1,6 +1,4 @@
MCU_SERIES = m0
MCU_VARIANT = NRF51
MCU_VARIANT = nrf51
LD_FILE = boards/nrf51822_ac.ld
SRC_C += \
hal/hal_uart.c

@ -1,13 +1,4 @@
MCU_SERIES = m0
MCU_VARIANT = NRF51
MCU_VARIANT = nrf51
LD_FILE = boards/nrf51822_ac_s110.ld
SRC_C += \
hal/hal_uart.c \
softdevice/modble.c \
softdevice/softdevice.c
CFLAGS += -I./softdevice
CFLAGS += -I./softdevice/s110/headers
CFLAGS += -DBLUETOOTH_SD=110
CFLAGS += -DBLUETOOTH_SD_DEBUG=1

@ -1,13 +1,3 @@
MCU_SERIES = m0
MCU_VARIANT = NRF51
MCU_VARIANT = nrf51
LD_FILE = boards/nrf51822_ac_s120.ld
SRC_C += \
hal/hal_uart.c \
softdevice/modble.c \
softdevice/softdevice.c
CFLAGS += -I./softdevice
CFLAGS += -I./softdevice/s120/headers
CFLAGS += -DBLUETOOTH_SD=120
CFLAGS += -DBLUETOOTH_SD_DEBUG=1

@ -1,13 +1,4 @@
MCU_SERIES = m0
MCU_VARIANT = NRF51
MCU_VARIANT = nrf51
LD_FILE = boards/nrf51822_ac_s130.ld
SRC_C += \
hal/hal_uart.c \
softdevice/modble.c \
softdevice/softdevice.c
CFLAGS += -I./softdevice
CFLAGS += -I./softdevice/s130/headers
CFLAGS += -DBLUETOOTH_SD=130
CFLAGS += -DBLUETOOTH_SD_DEBUG=1

@ -0,0 +1,8 @@
#ifndef NRF51_HAL_CONF_H__
#define NRF51_HAL_CONF_H__
#define HAL_UART_MODULE_ENABLED
#define HAL_SPI_MODULE_ENABLED
#define HAL_TIME_MODULE_ENABLED
#endif // NRF51_HAL_CONF_H__

@ -0,0 +1,32 @@
PA0,PA0
PA1,PA1
PA2,PA2
PA3,PA3
PA4,PA4
PA5,PA5
PA6,PA6
PA7,PA7
UART_RTS,PA8
UART_TX,PA9
UART_CTS,PA10
UART_RX,PA11
PA12,PA12
PA13,PA13
PA14,PA14
PA15,PA15
PA16,PA16
PA17,PA17
PA18,PA18
PA19,PA19
PA20,PA20
PA21,PA21
PA22,PA22
PA23,PA23
PA24,PA24
PA25,PA25
PA26,PA26
PA27,PA27
PA28,PA28
PA29,PA29
PA30,PA30
PA31,PA31
1 PA0 PA0
2 PA1 PA1
3 PA2 PA2
4 PA3 PA3
5 PA4 PA4
6 PA5 PA5
7 PA6 PA6
8 PA7 PA7
9 UART_RTS PA8
10 UART_TX PA9
11 UART_CTS PA10
12 UART_RX PA11
13 PA12 PA12
14 PA13 PA13
15 PA14 PA14
16 PA15 PA15
17 PA16 PA16
18 PA17 PA17
19 PA18 PA18
20 PA19 PA19
21 PA20 PA20
22 PA21 PA21
23 PA22 PA22
24 PA23 PA23
25 PA24 PA24
26 PA25 PA25
27 PA26 PA26
28 PA27 PA27
29 PA28 PA28
30 PA29 PA29
31 PA30 PA30
32 PA31 PA31

@ -57,4 +57,12 @@
#define MICROPY_HW_UART1_RTS (8)
#define MICROPY_HW_UART1_HWFC (0)
// SPI0 config
#define MICROPY_HW_SPI0_NAME "SPI0"
#define MICROPY_HW_SPI0_SCK (15) // A15
#define MICROPY_HW_SPI0_MOSI (16) // A16
#define MICROPY_HW_SPI0_MISO (17) // A17
#define MICROPY_HW_SPI0_NSS (18) // A18
#define HELP_TEXT_BOARD_LED "1,2,3"

@ -1,6 +1,3 @@
MCU_SERIES = m0
MCU_VARIANT = NRF51
MCU_VARIANT = nrf51
LD_FILE = boards/nrf51822_ac.ld
SRC_C += \
hal/hal_uart.c

@ -1,13 +1,4 @@
MCU_SERIES = m0
MCU_VARIANT = NRF51
MCU_VARIANT = nrf51
LD_FILE = boards/nrf51822_ac_s110.ld
SRC_C += \
hal/hal_uart.c \
softdevice/modble.c \
softdevice/softdevice.c
CFLAGS += -I./softdevice
CFLAGS += -I./softdevice/s110/headers
CFLAGS += -DBLUETOOTH_SD=110
CFLAGS += -DBLUETOOTH_SD_DEBUG=1

@ -1,13 +1,4 @@
MCU_SERIES = m0
MCU_VARIANT = NRF51
MCU_VARIANT = nrf51
LD_FILE = boards/nrf51822_ac_s120.ld
SRC_C += \
hal/hal_uart.c \
softdevice/modble.c \
softdevice/softdevice.c
CFLAGS += -I./softdevice
CFLAGS += -I./softdevice/s120/headers
CFLAGS += -DBLUETOOTH_SD=120
CFLAGS += -DBLUETOOTH_SD_DEBUG=1

@ -1,13 +1,4 @@
MCU_SERIES = m0
MCU_VARIANT = NRF51
MCU_VARIANT = nrf51
LD_FILE = boards/nrf51822_ac_s130.ld
SRC_C += \
hal/hal_uart.c \
softdevice/modble.c \
softdevice/softdevice.c
CFLAGS += -I./softdevice
CFLAGS += -I./softdevice/s130/headers
CFLAGS += -DBLUETOOTH_SD=130
CFLAGS += -DBLUETOOTH_SD_DEBUG=1

@ -0,0 +1,8 @@
#ifndef NRF51_HAL_CONF_H__
#define NRF51_HAL_CONF_H__
#define HAL_UART_MODULE_ENABLED
#define HAL_SPI_MODULE_ENABLED
#define HAL_TIME_MODULE_ENABLED
#endif // NRF51_HAL_CONF_H__

@ -0,0 +1,13 @@
UART_RTS,PA8
UART_TX,PA9
UART_CTS,PA10
UART_RX,PA11
LED_RED,PA21
LED_GREEN,PA22
LED_BLUE,PA23
PA15,PA15
PA16,PA16
PA17,PA17
PA18,PA18
PA19,PA19
PA20,PA20
1 UART_RTS PA8
2 UART_TX PA9
3 UART_CTS PA10
4 UART_RX PA11
5 LED_RED PA21
6 LED_GREEN PA22
7 LED_BLUE PA23
8 PA15 PA15
9 PA16 PA16
10 PA17 PA17
11 PA18 PA18
12 PA19 PA19
13 PA20 PA20

@ -57,4 +57,12 @@
#define MICROPY_HW_UART1_RTS (5)
#define MICROPY_HW_UART1_HWFC (1)
// SPI0 config
#define MICROPY_HW_SPI0_NAME "SPI0"
#define MICROPY_HW_SPI0_SCK (25) // A25 (Arduino D13)
#define MICROPY_HW_SPI0_MOSI (23) // A23 (Arduino D11)
#define MICROPY_HW_SPI0_MISO (24) // A24 (Arduino D12)
#define MICROPY_HW_SPI0_NSS (22) // A22 (Arduino D10)
#define HELP_TEXT_BOARD_LED "1,2,3,4"

@ -1,6 +1,4 @@
MCU_SERIES = m4
MCU_VARIANT = NRF52
MCU_VARIANT = nrf52
LD_FILE = boards/nrf52832_aa.ld
SRC_C += \
hal/hal_uart.c

@ -1,14 +1,4 @@
MCU_SERIES = m4
MCU_VARIANT = NRF52
MCU_VARIANT = nrf52
LD_FILE = boards/nrf52832_aa_s132.ld
SRC_C += \
hal/hal_uarte.c \
softdevice/modble.c \
softdevice/softdevice.c
CFLAGS += -I./softdevice
CFLAGS += -I./softdevice/s132/headers
CFLAGS += -I./softdevice/s132/headers/nrf52
CFLAGS += -DBLUETOOTH_SD=132
CFLAGS += -DBLUETOOTH_SD_DEBUG=1

@ -1,14 +1,4 @@
MCU_SERIES = m4
MCU_VARIANT = NRF52
MCU_VARIANT = nrf52
LD_FILE = boards/nrf52832_aa_s1xx.ld
SRC_C += \
hal/hal_uarte.c \
softdevice/modble.c \
softdevice/softdevice.c
CFLAGS += -I./softdevice
CFLAGS += -I./softdevice/s1xx/headers
CFLAGS += -I./softdevice/s1xx/headers/nrf52
CFLAGS += -DBLUETOOTH_SD=100
CFLAGS += -DBLUETOOTH_SD_DEBUG=1

@ -0,0 +1,10 @@
#ifndef NRF52_HAL_CONF_H__
#define NRF52_HAL_CONF_H__
#define HAL_UART_MODULE_ENABLED
// #define HAL_UARTE_MODULE_ENABLED
#define HAL_SPI_MODULE_ENABLED
// #define HAL_SPIE_MODULE_ENABLED
#define HAL_TIME_MODULE_ENABLED
#endif // NRF52_HAL_CONF_H__

@ -0,0 +1,30 @@
PA2,PA2
PA3,PA3
PA4,PA4
PA5,PA5
PA6,PA6
PA7,PA7
PA8,PA8
PA9,PA9
PA10,PA10
PA11,PA11
PA12,PA12
PA13,PA13
PA14,PA14
PA15,PA15
PA16,PA16
PA17,PA17
PA18,PA18