Merge branch release-4.2 back into develop
This commit is contained in:
commit
4ea5d41d52
2
.gitignore
vendored
2
.gitignore
vendored
@ -12,7 +12,7 @@
|
|||||||
*.ihex
|
*.ihex
|
||||||
*.pyc
|
*.pyc
|
||||||
*~
|
*~
|
||||||
obj_*
|
build/*
|
||||||
Makefile.target
|
Makefile.target
|
||||||
Makefile.*.defines
|
Makefile.*.defines
|
||||||
tools/doxygen/html
|
tools/doxygen/html
|
||||||
|
17
.travis.yml
17
.travis.yml
@ -34,12 +34,22 @@ before_install:
|
|||||||
- if [ ${BUILD_COOJA:-false} = true ] ; then
|
- if [ ${BUILD_COOJA:-false} = true ] ; then
|
||||||
ant -q -f $CNG_HOST_PATH/tools/cooja/build.xml jar ;
|
ant -q -f $CNG_HOST_PATH/tools/cooja/build.xml jar ;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Create a directory for out of tree tests and clone the test repo therein
|
||||||
|
# The directory will need created unconditionally so we can always chgrp and
|
||||||
|
# mount it, even if empty. Checkout a pre-defined version.
|
||||||
|
- mkdir -p $OUT_OF_TREE_TEST_PATH
|
||||||
|
- if [ ${TEST_NAME} = "out-of-tree-build" ] ; then
|
||||||
|
git clone --depth 1 https://github.com/contiki-ng/out-of-tree-tests $OUT_OF_TREE_TEST_PATH &&
|
||||||
|
cd $OUT_OF_TREE_TEST_PATH &&
|
||||||
|
git checkout $OUT_OF_TREE_TEST_VER ;
|
||||||
|
fi
|
||||||
# Set permissions for Docker mount
|
# Set permissions for Docker mount
|
||||||
- sudo chgrp -hR 1000 $CNG_HOST_PATH
|
- sudo chgrp -hR 1000 $CNG_HOST_PATH $OUT_OF_TREE_TEST_PATH
|
||||||
|
|
||||||
# The test script for each build
|
# The test script for each build
|
||||||
script:
|
script:
|
||||||
- docker run --privileged -v $CNG_HOST_PATH:/home/user/contiki-ng -ti $DOCKER_IMG bash --login -c "make -C tests/??-$TEST_NAME";
|
- docker run --privileged -v $OUT_OF_TREE_TEST_PATH:/home/user/out-of-tree-tests -v $CNG_HOST_PATH:/home/user/contiki-ng -ti $DOCKER_IMG bash --login -c "make -C tests/??-$TEST_NAME";
|
||||||
# Check outcome of the test
|
# Check outcome of the test
|
||||||
- $CNG_HOST_PATH/tests/check-test.sh $CNG_HOST_PATH/tests/??-$TEST_NAME; exit $?;
|
- $CNG_HOST_PATH/tests/check-test.sh $CNG_HOST_PATH/tests/??-$TEST_NAME; exit $?;
|
||||||
|
|
||||||
@ -49,6 +59,8 @@ env:
|
|||||||
global:
|
global:
|
||||||
- DOCKER_IMG='contiker/contiki-ng'
|
- DOCKER_IMG='contiker/contiki-ng'
|
||||||
- CNG_HOST_PATH=`pwd`
|
- CNG_HOST_PATH=`pwd`
|
||||||
|
- OUT_OF_TREE_TEST_PATH=$HOME/out-of-tree-tests
|
||||||
|
- OUT_OF_TREE_TEST_VER=2869ae7
|
||||||
# Encrypted environment variables.
|
# Encrypted environment variables.
|
||||||
# Only available on builds of contiki-ng/contiki-ng branches, not PRs or forks.
|
# Only available on builds of contiki-ng/contiki-ng branches, not PRs or forks.
|
||||||
- secure: 0nrV5yjpT2kE19Hlm7t619Qbmyjx/G7bSUI1c+U3kZbyuxnRlASjVcDN5uPBoimIfGiBRI0nRq690BogAJt4EKwbC1Dy8kC1XD8mRtQ2AIZ6PHaUoG9iS5sBhFBQK0XkB83bwh6omRn/04O0uuX74ooSWT7fDrWxi/y5+0ysXK6gRtOhdrJ3FU5OkNVewX8NeCdx3pOWhMOtXWdFkMIi1XRdDnvMM5/hHlHMkdXXtaZQX9UsK3Q3DSjPRLZjKRiOlcx9MIg2ebh9ITmd2Du2p2q/LKtoutJckvhbKQPWcZi/B+1ZTSff0FHBIg+EYxf6TeFuia7XSTWH7sr2CDCCtcvSR9bB5yW6jdmGfa8Af8I1TCBuqoSUo0Re50BZBZF7COleEh+IojbjXn2CIDMg5rT4Sh3qcMGvFn9OW1cz5h5UNSOk7EIAXXPcI7Aloxh2sBo4/DrvvbfIsKrvxV9Fx4bdyNtR7dZ7xsoOw6L0zttC3K9naf3VAOeBAyjBiRwm0tWxJC/buhTsKlYrthhyUrwLtYAFL4UHcazvz57hY/cEzR2X6F//9Hp7HFoNtn1E36doX3ZfeI22yxHMo9SYW7O69C45wbhJ29lAA9XXbYVyGBKFkY8C1NCZ0Xckt9H8/Ow5Sz8HmW/NNBJCn0Fsx+jezdGc4ED5naugNbLAyNg=
|
- secure: 0nrV5yjpT2kE19Hlm7t619Qbmyjx/G7bSUI1c+U3kZbyuxnRlASjVcDN5uPBoimIfGiBRI0nRq690BogAJt4EKwbC1Dy8kC1XD8mRtQ2AIZ6PHaUoG9iS5sBhFBQK0XkB83bwh6omRn/04O0uuX74ooSWT7fDrWxi/y5+0ysXK6gRtOhdrJ3FU5OkNVewX8NeCdx3pOWhMOtXWdFkMIi1XRdDnvMM5/hHlHMkdXXtaZQX9UsK3Q3DSjPRLZjKRiOlcx9MIg2ebh9ITmd2Du2p2q/LKtoutJckvhbKQPWcZi/B+1ZTSff0FHBIg+EYxf6TeFuia7XSTWH7sr2CDCCtcvSR9bB5yW6jdmGfa8Af8I1TCBuqoSUo0Re50BZBZF7COleEh+IojbjXn2CIDMg5rT4Sh3qcMGvFn9OW1cz5h5UNSOk7EIAXXPcI7Aloxh2sBo4/DrvvbfIsKrvxV9Fx4bdyNtR7dZ7xsoOw6L0zttC3K9naf3VAOeBAyjBiRwm0tWxJC/buhTsKlYrthhyUrwLtYAFL4UHcazvz57hY/cEzR2X6F//9Hp7HFoNtn1E36doX3ZfeI22yxHMo9SYW7O69C45wbhJ29lAA9XXbYVyGBKFkY8C1NCZ0Xckt9H8/Ow5Sz8HmW/NNBJCn0Fsx+jezdGc4ED5naugNbLAyNg=
|
||||||
@ -69,3 +81,4 @@ env:
|
|||||||
- TEST_NAME='native-runs'
|
- TEST_NAME='native-runs'
|
||||||
- TEST_NAME='ipv6' BUILD_COOJA=true
|
- TEST_NAME='ipv6' BUILD_COOJA=true
|
||||||
- TEST_NAME='ipv6-nbr' BUILD_COOJA=true
|
- TEST_NAME='ipv6-nbr' BUILD_COOJA=true
|
||||||
|
- TEST_NAME='out-of-tree-build'
|
||||||
|
@ -13,8 +13,6 @@ include $(CONTIKI)/Makefile.identify-target
|
|||||||
### Include Makefile.tools to pull in targets that allow us to build tools dir
|
### Include Makefile.tools to pull in targets that allow us to build tools dir
|
||||||
include $(CONTIKI)/Makefile.tools
|
include $(CONTIKI)/Makefile.tools
|
||||||
|
|
||||||
CONTIKI_NG_TARGET_LIB = contiki-ng-$(TARGET).a
|
|
||||||
|
|
||||||
ifeq ($(DEFINES),)
|
ifeq ($(DEFINES),)
|
||||||
-include Makefile.$(TARGET).defines
|
-include Makefile.$(TARGET).defines
|
||||||
ifneq ($(DEFINES),)
|
ifneq ($(DEFINES),)
|
||||||
@ -39,7 +37,12 @@ ifdef CI
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
OBJECTDIR = obj_$(TARGET)
|
BUILD_DIR = build
|
||||||
|
BUILD_DIR_TARGET = $(BUILD_DIR)/$(TARGET)
|
||||||
|
BUILD_DIR_BOARD = $(BUILD_DIR_TARGET)/$(BOARD)/$(BUILD_DIR_CONFIG)
|
||||||
|
OBJECTDIR = $(BUILD_DIR_BOARD)/obj
|
||||||
|
|
||||||
|
CONTIKI_NG_TARGET_LIB = $(BUILD_DIR_BOARD)/contiki-ng-$(TARGET).a
|
||||||
|
|
||||||
LOWERCASE = -abcdefghijklmnopqrstuvwxyz/
|
LOWERCASE = -abcdefghijklmnopqrstuvwxyz/
|
||||||
UPPERCASE = _ABCDEFGHIJKLMNOPQRSTUVWXYZ_
|
UPPERCASE = _ABCDEFGHIJKLMNOPQRSTUVWXYZ_
|
||||||
@ -75,10 +78,6 @@ endef
|
|||||||
CONTIKI_OBJECTFILES = ${addprefix $(OBJECTDIR)/,${call oname, $(CONTIKI_SOURCEFILES)}}
|
CONTIKI_OBJECTFILES = ${addprefix $(OBJECTDIR)/,${call oname, $(CONTIKI_SOURCEFILES)}}
|
||||||
PROJECT_OBJECTFILES = ${addprefix $(OBJECTDIR)/,${call oname, $(PROJECT_SOURCEFILES)}}
|
PROJECT_OBJECTFILES = ${addprefix $(OBJECTDIR)/,${call oname, $(PROJECT_SOURCEFILES)}}
|
||||||
|
|
||||||
# Provide way to create $(OBJECTDIR) if it has been removed by make clean
|
|
||||||
$(OBJECTDIR):
|
|
||||||
mkdir $@
|
|
||||||
|
|
||||||
uniq = $(if $1,$(firstword $1) $(call uniq,$(filter-out $(firstword $1),$1)))
|
uniq = $(if $1,$(firstword $1) $(call uniq,$(filter-out $(firstword $1),$1)))
|
||||||
|
|
||||||
### Include target makefile (TODO Unsafe?)
|
### Include target makefile (TODO Unsafe?)
|
||||||
@ -124,6 +123,11 @@ endif # $(BOARD) not empty
|
|||||||
|
|
||||||
PLATFORM_ACTION ?= build
|
PLATFORM_ACTION ?= build
|
||||||
|
|
||||||
|
# Provide way to create $(OBJECTDIR) if it has been removed by make clean
|
||||||
|
$(OBJECTDIR):
|
||||||
|
$(TRACE_MKDIR)
|
||||||
|
$(Q)mkdir -p $@
|
||||||
|
|
||||||
ifneq ($(BOARD),)
|
ifneq ($(BOARD),)
|
||||||
TARGET_BOARD_UPPERCASE := ${strip ${shell echo $(BOARD) | sed y!$(LOWERCASE)!$(UPPERCASE)!}}
|
TARGET_BOARD_UPPERCASE := ${strip ${shell echo $(BOARD) | sed y!$(LOWERCASE)!$(UPPERCASE)!}}
|
||||||
CFLAGS += -DCONTIKI_BOARD_$(TARGET_BOARD_UPPERCASE)=1
|
CFLAGS += -DCONTIKI_BOARD_$(TARGET_BOARD_UPPERCASE)=1
|
||||||
@ -241,12 +245,20 @@ ifeq ($(V),1)
|
|||||||
TRACE_LD =
|
TRACE_LD =
|
||||||
TRACE_AR =
|
TRACE_AR =
|
||||||
TRACE_AS =
|
TRACE_AS =
|
||||||
|
TRACE_OBJCOPY =
|
||||||
|
TRACE_OBJDUMP =
|
||||||
|
TRACE_MKDIR =
|
||||||
|
TRACE_CP =
|
||||||
Q=
|
Q=
|
||||||
else
|
else
|
||||||
TRACE_CC = @echo " CC " $<
|
TRACE_CC = @echo " CC " $<
|
||||||
TRACE_LD = @echo " LD " $@
|
TRACE_LD = @echo " LD " $@
|
||||||
TRACE_AR = @echo " AR " $@
|
TRACE_AR = @echo " AR " $@
|
||||||
TRACE_AS = @echo " AS " $<
|
TRACE_AS = @echo " AS " $<
|
||||||
|
TRACE_OBJCOPY = @echo " OBJCOPY " $< "-->" $@
|
||||||
|
TRACE_OBJDUMP = @echo " OBJDUMP " $< "-->" $@
|
||||||
|
TRACE_MKDIR = @echo " MKDIR " $@
|
||||||
|
TRACE_CP = @echo " CP " $< "-->" $@
|
||||||
Q=@
|
Q=@
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -303,14 +315,13 @@ endef
|
|||||||
|
|
||||||
### Harmonize filename of a .map file, if the platform's build system wants
|
### Harmonize filename of a .map file, if the platform's build system wants
|
||||||
### to create one
|
### to create one
|
||||||
CONTIKI_NG_PROJECT_MAP = $(addsuffix -$(TARGET).map, $(basename $@))
|
CONTIKI_NG_PROJECT_MAP = $(BUILD_DIR_BOARD)/$(basename $(notdir $@)).map
|
||||||
|
|
||||||
.PHONY: clean distclean usage help targets boards savetarget savedefines viewconf
|
.PHONY: clean distclean usage help targets boards savetarget savedefines viewconf
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
-$(Q)rm -f *.d *.e *.o $(CONTIKI_NG_TARGET_LIB) $(CLEAN)
|
-$(Q)rm -f *.d *.e *.o $(CLEAN)
|
||||||
-$(Q)rm -rf $(OBJECTDIR)
|
-$(Q)rm -rf $(BUILD_DIR_TARGET)
|
||||||
-$(Q)rm -f $(addsuffix -$(TARGET).map, $(CONTIKI_PROJECT))
|
|
||||||
-$(Q)rm -f $(addsuffix .$(TARGET), $(CONTIKI_PROJECT))
|
-$(Q)rm -f $(addsuffix .$(TARGET), $(CONTIKI_PROJECT))
|
||||||
@echo Target $(TARGET) cleaned
|
@echo Target $(TARGET) cleaned
|
||||||
|
|
||||||
@ -319,6 +330,7 @@ distclean:
|
|||||||
echo Running: $(MAKE) TARGET=$$TARG clean; \
|
echo Running: $(MAKE) TARGET=$$TARG clean; \
|
||||||
$(MAKE) TARGET=$$TARG clean; \
|
$(MAKE) TARGET=$$TARG clean; \
|
||||||
done
|
done
|
||||||
|
-$(Q)rm -rf $(BUILD_DIR)
|
||||||
|
|
||||||
-include $(CONTIKI)/arch/platform/$(TARGET)/Makefile.customrules-$(TARGET)
|
-include $(CONTIKI)/arch/platform/$(TARGET)/Makefile.customrules-$(TARGET)
|
||||||
|
|
||||||
@ -383,12 +395,16 @@ ifndef LD
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifndef CUSTOM_RULE_LINK
|
ifndef CUSTOM_RULE_LINK
|
||||||
%.$(TARGET): %.o $(PROJECT_OBJECTFILES) $(PROJECT_LIBRARIES) $(CONTIKI_NG_TARGET_LIB)
|
$(BUILD_DIR_BOARD)/%.$(TARGET): %.o $(PROJECT_OBJECTFILES) $(PROJECT_LIBRARIES) $(CONTIKI_NG_TARGET_LIB)
|
||||||
$(TRACE_LD)
|
$(TRACE_LD)
|
||||||
$(Q)$(LD) $(LDFLAGS) $(TARGET_STARTFILES) ${filter-out %.a,$^} \
|
$(Q)$(LD) $(LDFLAGS) $(TARGET_STARTFILES) ${filter-out %.a,$^} \
|
||||||
${filter %.a,$^} $(TARGET_LIBFILES) -o $@
|
${filter %.a,$^} $(TARGET_LIBFILES) -o $@
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
%.$(TARGET): $(BUILD_DIR_BOARD)/%.$(TARGET)
|
||||||
|
$(TRACE_CP)
|
||||||
|
$(Q)cp $< $@
|
||||||
|
|
||||||
%.ramprof: %.$(TARGET)
|
%.ramprof: %.$(TARGET)
|
||||||
$(NM) -S -td --size-sort $< | grep -i " [abdrw] " | cut -d' ' -f2,4
|
$(NM) -S -td --size-sort $< | grep -i " [abdrw] " | cut -d' ' -f2,4
|
||||||
|
|
||||||
@ -446,9 +462,9 @@ ifeq ($(findstring $(TARGET),native cooja),)
|
|||||||
include $(CONTIKI)/Makefile.embedded
|
include $(CONTIKI)/Makefile.embedded
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Don't treat %.$(TARGET) as an intermediate file because it is
|
# Don't treat $(BUILD_DIR_BOARD)/%.$(TARGET) and $(TARGET) as intermediate
|
||||||
# in fact the primary target.
|
# files because for many platforms they are in fact the primary target.
|
||||||
.PRECIOUS: %.$(TARGET)
|
.PRECIOUS: $(BUILD_DIR_BOARD)/%.$(TARGET) %.$(TARGET)
|
||||||
|
|
||||||
# Cancel the predefined implict rule for compiling and linking
|
# Cancel the predefined implict rule for compiling and linking
|
||||||
# a single C source into a binary to force GNU make to consider
|
# a single C source into a binary to force GNU make to consider
|
||||||
|
@ -1,3 +1,11 @@
|
|||||||
|
### Verbosity control. Use make V=1 to get verbose builds.
|
||||||
|
### Extends what we already have in the top-level Makefile
|
||||||
|
ifeq ($(V),1)
|
||||||
|
TRACE_SREC_CAT =
|
||||||
|
else
|
||||||
|
TRACE_SREC_CAT = @echo " SREC_CAT " $< "-->" $@
|
||||||
|
endif
|
||||||
|
|
||||||
CC = arm-none-eabi-gcc
|
CC = arm-none-eabi-gcc
|
||||||
CPP = arm-none-eabi-cpp
|
CPP = arm-none-eabi-cpp
|
||||||
LD = arm-none-eabi-gcc
|
LD = arm-none-eabi-gcc
|
||||||
@ -43,22 +51,32 @@ endif
|
|||||||
### CPU-dependent cleanup files
|
### CPU-dependent cleanup files
|
||||||
CLEAN += *.elf *.bin *.lst *.hex *.i16hex
|
CLEAN += *.elf *.bin *.lst *.hex *.i16hex
|
||||||
|
|
||||||
|
OUT_HEX = $(BUILD_DIR_BOARD)/%.hex
|
||||||
|
OUT_I16HEX = $(BUILD_DIR_BOARD)/%.i16hex
|
||||||
|
OUT_BIN = $(BUILD_DIR_BOARD)/%.bin
|
||||||
|
OUT_LST = $(BUILD_DIR_BOARD)/%.lst
|
||||||
|
|
||||||
### Don't treat the following files as intermediate
|
### Don't treat the following files as intermediate
|
||||||
.PRECIOUS: %.elf %.hex %.bin
|
.PRECIOUS: $(OUT_ELF) $(OUT_HEX) $(OUT_BIN)
|
||||||
|
|
||||||
%.i16hex: %.elf
|
$(OUT_I16HEX): $(OUT_ELF)
|
||||||
$(OBJCOPY) -O ihex $< $@
|
$(TRACE_OBJCOPY)
|
||||||
|
$(Q)$(OBJCOPY) -O ihex $< $@
|
||||||
|
|
||||||
%.hex: %.i16hex
|
$(OUT_HEX): $(OUT_I16HEX)
|
||||||
$(SREC_CAT) $< -intel -o $@ -intel
|
$(TRACE_SREC_CAT)
|
||||||
|
$(Q)$(SREC_CAT) $< -intel -o $@ -intel
|
||||||
|
|
||||||
%.bin: %.elf
|
$(OUT_BIN): $(OUT_ELF)
|
||||||
$(OBJCOPY) -O binary $(OBJCOPY_FLAGS) $< $@
|
$(TRACE_OBJCOPY)
|
||||||
|
$(Q)$(OBJCOPY) -O binary $(OBJCOPY_FLAGS) $< $@
|
||||||
|
|
||||||
%.lst: %.elf
|
$(OUT_LST): $(OUT_ELF)
|
||||||
$(OBJDUMP) $(OBJDUMP_FLAGS) $< > $@
|
$(TRACE_OBJDUMP)
|
||||||
|
$(Q)$(OBJDUMP) $(OBJDUMP_FLAGS) $< > $@
|
||||||
|
|
||||||
### We don't really need the .hex and .bin for the .$(TARGET) but let's make
|
### We don't really need the .hex and .bin for the .$(TARGET) but let's make
|
||||||
### sure they get built
|
### sure they get built
|
||||||
%.$(TARGET): %.elf %.hex %.bin
|
$(BUILD_DIR_BOARD)/%.$(TARGET): $(OUT_ELF) $(OUT_HEX) $(OUT_BIN)
|
||||||
cp $< $@
|
$(TRACE_CP)
|
||||||
|
$(Q)cp $< $@
|
||||||
|
@ -3,11 +3,25 @@ CONTIKI_ARM_DIRS += cortex-m cortex-m/CMSIS
|
|||||||
### Build syscalls for newlib
|
### Build syscalls for newlib
|
||||||
MODULES += os/lib/newlib
|
MODULES += os/lib/newlib
|
||||||
|
|
||||||
|
LDFLAGS += -T $(LDSCRIPT)
|
||||||
|
LDFLAGS += -Wl,--gc-sections,--sort-section=alignment
|
||||||
|
LDFLAGS += -Wl,-Map=$(CONTIKI_NG_PROJECT_MAP),--cref,--no-warn-mismatch
|
||||||
|
|
||||||
|
OBJCOPY_FLAGS += --gap-fill 0xff
|
||||||
|
|
||||||
|
CPU_STARTFILES = ${addprefix $(OBJECTDIR)/,${call oname, $(CPU_START_SOURCEFILES)}}
|
||||||
|
|
||||||
|
### Resolve any potential circular dependencies between the linked libraries
|
||||||
|
### See: https://stackoverflow.com/questions/5651869/gcc-what-are-the-start-group-and-end-group-command-line-options/5651895
|
||||||
|
TARGET_LIBFLAGS := -Wl,--start-group $(TARGET_LIBFILES) -Wl,--end-group
|
||||||
|
|
||||||
CUSTOM_RULE_LINK = 1
|
CUSTOM_RULE_LINK = 1
|
||||||
|
|
||||||
|
OUT_ELF = $(BUILD_DIR_BOARD)/%.elf
|
||||||
|
|
||||||
.SECONDEXPANSION:
|
.SECONDEXPANSION:
|
||||||
|
|
||||||
%.elf: $(CPU_STARTFILES) $$(CONTIKI_OBJECTFILES) %.o $(PROJECT_OBJECTFILES) $(PROJECT_LIBRARIES) $(LDSCRIPT) $(TARGET_LIBS)
|
$(OUT_ELF): $(CPU_STARTFILES) $$(CONTIKI_OBJECTFILES) %.o $(PROJECT_OBJECTFILES) $(PROJECT_LIBRARIES) $(LDSCRIPT) $(TARGET_LIBS)
|
||||||
$(TRACE_LD)
|
$(TRACE_LD)
|
||||||
$(Q)$(LD) $(LDFLAGS) ${filter-out $(LDSCRIPT) %.a,$^} ${filter %.a,$^} $(TARGET_LIBFLAGS) -o $@
|
$(Q)$(LD) $(LDFLAGS) ${filter-out $(LDSCRIPT) %.a,$^} ${filter %.a,$^} $(TARGET_LIBFLAGS) -o $@
|
||||||
|
|
||||||
|
@ -3,16 +3,7 @@ CONTIKI_ARM_DIRS += cortex-m/cm3
|
|||||||
CFLAGS += -mcpu=cortex-m3
|
CFLAGS += -mcpu=cortex-m3
|
||||||
|
|
||||||
LDFLAGS += -mcpu=cortex-m3 -nostartfiles
|
LDFLAGS += -mcpu=cortex-m3 -nostartfiles
|
||||||
LDFLAGS += -T $(LDSCRIPT)
|
|
||||||
LDFLAGS += -Wl,--gc-sections,--sort-section=alignment
|
|
||||||
LDFLAGS += -Wl,-Map=$(CONTIKI_NG_PROJECT_MAP),--cref,--no-warn-mismatch
|
|
||||||
|
|
||||||
OBJCOPY_FLAGS += --gap-fill 0xff
|
TARGET_LIBFILES += -lm
|
||||||
|
|
||||||
CPU_STARTFILES = ${addprefix $(OBJECTDIR)/,${call oname, $(CPU_START_SOURCEFILES)}}
|
|
||||||
|
|
||||||
### Resolve any potential circular dependencies between the linked libraries
|
|
||||||
### See: https://stackoverflow.com/questions/5651869/gcc-what-are-the-start-group-and-end-group-command-line-options/5651895
|
|
||||||
TARGET_LIBFLAGS := -Wl,--start-group $(TARGET_LIBFILES) -lm -Wl,--end-group
|
|
||||||
|
|
||||||
include $(CONTIKI)/arch/cpu/arm/cortex-m/Makefile.cortex-m
|
include $(CONTIKI)/arch/cpu/arm/cortex-m/Makefile.cortex-m
|
||||||
|
@ -3,16 +3,5 @@ CONTIKI_ARM_DIRS += cortex-m/cm4
|
|||||||
CFLAGS += -mcpu=cortex-m4
|
CFLAGS += -mcpu=cortex-m4
|
||||||
|
|
||||||
LDFLAGS += -mcpu=cortex-m4
|
LDFLAGS += -mcpu=cortex-m4
|
||||||
LDFLAGS += -T $(LDSCRIPT)
|
|
||||||
LDFLAGS += -Wl,--gc-sections,--sort-section=alignment
|
|
||||||
LDFLAGS += -Wl,-Map=$(CONTIKI_NG_PROJECT_MAP),--cref,--no-warn-mismatch
|
|
||||||
|
|
||||||
OBJCOPY_FLAGS += --gap-fill 0xff
|
|
||||||
|
|
||||||
CPU_STARTFILES = ${addprefix $(OBJECTDIR)/,${call oname, $(CPU_START_SOURCEFILES)}}
|
|
||||||
|
|
||||||
### Resolve any potential circular dependencies between the linked libraries
|
|
||||||
### See: https://stackoverflow.com/questions/5651869/gcc-what-are-the-start-group-and-end-group-command-line-options/5651895
|
|
||||||
TARGET_LIBFLAGS := -Wl,--start-group $(TARGET_LIBFILES) -Wl,--end-group
|
|
||||||
|
|
||||||
include $(CONTIKI)/arch/cpu/arm/cortex-m/Makefile.cortex-m
|
include $(CONTIKI)/arch/cpu/arm/cortex-m/Makefile.cortex-m
|
||||||
|
@ -81,8 +81,10 @@ STACK_SIZE = 0
|
|||||||
@$(SIZE) -A $< | egrep "data|bss" | awk '{s+=$$2} END {s=s+$(STACK_SIZE); f=$(RAM_SIZE)-s; printf "[RAM] used %6d, free %6d\n",s,f;}'
|
@$(SIZE) -A $< | egrep "data|bss" | awk '{s+=$$2} END {s=s+$(STACK_SIZE); f=$(RAM_SIZE)-s; printf "[RAM] used %6d, free %6d\n",s,f;}'
|
||||||
@$(SIZE) -A $< | egrep "text|isr_vector" | awk '{s+=$$2} END {f=$(FLASH_SIZE)-s; printf "[Flash] used %6d, free %6d\n",s,f;}'
|
@$(SIZE) -A $< | egrep "text|isr_vector" | awk '{s+=$$2} END {f=$(FLASH_SIZE)-s; printf "[Flash] used %6d, free %6d\n",s,f;}'
|
||||||
|
|
||||||
|
include $(CONTIKI)/arch/cpu/arm/cortex-m/cm3/Makefile.cm3
|
||||||
|
|
||||||
ifeq ($(BOARD_SUPPORTS_BSL),1)
|
ifeq ($(BOARD_SUPPORTS_BSL),1)
|
||||||
%.upload: %.bin
|
%.upload: $(OUT_BIN)
|
||||||
ifeq ($(wildcard $(BSL)), )
|
ifeq ($(wildcard $(BSL)), )
|
||||||
@echo "ERROR: Could not find the cc2538-bsl script. Did you run 'git submodule update --init' ?"
|
@echo "ERROR: Could not find the cc2538-bsl script. Did you run 'git submodule update --init' ?"
|
||||||
else
|
else
|
||||||
@ -95,5 +97,3 @@ endif
|
|||||||
|
|
||||||
### For the login etc targets
|
### For the login etc targets
|
||||||
BAUDRATE = 115200
|
BAUDRATE = 115200
|
||||||
|
|
||||||
include $(CONTIKI)/arch/cpu/arm/cortex-m/cm3/Makefile.cm3
|
|
||||||
|
@ -172,11 +172,11 @@ vpath %.s $(ASM_PATHS)
|
|||||||
|
|
||||||
OBJECTS = $(C_OBJECTS) $(ASM_OBJECTS)
|
OBJECTS = $(C_OBJECTS) $(ASM_OBJECTS)
|
||||||
|
|
||||||
CLEAN += nrf52832.a
|
NRFLIB = $(BUILD_DIR_BOARD)/nrf52832.a
|
||||||
|
|
||||||
TARGET_LIBS = nrf52832.a $(NRF52_SDK_ROOT)/components/iot/ble_6lowpan/lib/ble_6lowpan.a
|
TARGET_LIBS = $(NRFLIB) $(NRF52_SDK_ROOT)/components/iot/ble_6lowpan/lib/ble_6lowpan.a
|
||||||
|
|
||||||
nrf52832.a: $(OBJECTS)
|
$(NRFLIB): $(OBJECTS)
|
||||||
$(TRACE_AR)
|
$(TRACE_AR)
|
||||||
$(Q)$(AR) $(AROPTS) $@ $^
|
$(Q)$(AR) $(AROPTS) $@ $^
|
||||||
|
|
||||||
|
@ -28,11 +28,12 @@ endif
|
|||||||
|
|
||||||
BSL = $(CONTIKI)/tools/cc2538-bsl/cc2538-bsl.py
|
BSL = $(CONTIKI)/tools/cc2538-bsl/cc2538-bsl.py
|
||||||
|
|
||||||
%.upload: %.bin %.elf
|
%.upload: $(OUT_BIN) $(OUT_ELF)
|
||||||
ifeq ($(wildcard $(BSL)), )
|
ifeq ($(wildcard $(BSL)), )
|
||||||
@echo "ERROR: Could not find the cc2538-bsl script. Did you run 'git submodule update --init' ?"
|
@echo "ERROR: Could not find the cc2538-bsl script. Did you run 'git submodule update --init' ?"
|
||||||
else
|
else
|
||||||
$(eval BSL_ADDRESS_ARG := -a $(shell $(OBJDUMP) -h $*.elf | grep -B1 LOAD | \
|
$(eval BSL_ADDRESS_ARG := -a $(shell $(OBJDUMP) -h \
|
||||||
|
$(BUILD_DIR_BOARD)/$*.elf | grep -B1 LOAD | \
|
||||||
grep -Ev 'LOAD|\-\-' | awk '{print "0x" $$5}' | \
|
grep -Ev 'LOAD|\-\-' | awk '{print "0x" $$5}' | \
|
||||||
sort -g | head -1))
|
sort -g | head -1))
|
||||||
$(PYTHON) $(BSL) $(BSL_FLAGS) $(BSL_ADDRESS_ARG) $<
|
$(PYTHON) $(BSL) $(BSL_FLAGS) $(BSL_ADDRESS_ARG) $<
|
||||||
|
@ -34,10 +34,10 @@ endif
|
|||||||
|
|
||||||
endif ## QUICKSTART
|
endif ## QUICKSTART
|
||||||
|
|
||||||
#MAIN_SRC = $(OBJECTDIR)/$(LIBNAME).c
|
#MAIN_SRC = $(BUILD_DIR_BOARD)/$(LIBNAME).c
|
||||||
MAIN_OBJ = $(OBJECTDIR)/$(LIBNAME).o
|
MAIN_OBJ = $(BUILD_DIR_BOARD)/$(LIBNAME).o
|
||||||
ARCHIVE = $(OBJECTDIR)/$(LIBNAME).a
|
ARCHIVE = $(BUILD_DIR_BOARD)/$(LIBNAME).a
|
||||||
JNILIB = $(OBJECTDIR)/$(LIBNAME).$(TARGET)
|
JNILIB = $(BUILD_DIR_BOARD)/$(LIBNAME).$(TARGET)
|
||||||
CONTIKI_APP_OBJ = $(CONTIKI_APP).o
|
CONTIKI_APP_OBJ = $(CONTIKI_APP).o
|
||||||
|
|
||||||
### COOJA platform sources
|
### COOJA platform sources
|
||||||
|
@ -10,11 +10,11 @@ CUSTOM_RULE_LINK=1
|
|||||||
|
|
||||||
REDEF_PRINTF=1 # Redefine functions to enable printf()s inside Cooja
|
REDEF_PRINTF=1 # Redefine functions to enable printf()s inside Cooja
|
||||||
|
|
||||||
# NB: Assumes ARCHIVE was not overridden and is in $(OBJECTDIR)
|
# NB: Assumes ARCHIVE was not overridden and is in $(BUILD_DIR_BOARD)
|
||||||
$(ARCHIVE): $(CONTIKI_OBJECTFILES) | $(OBJECTDIR)
|
$(ARCHIVE): $(CONTIKI_OBJECTFILES) | $(OBJECTDIR)
|
||||||
$(AR_COMMAND_1) $^ $(AR_COMMAND_2)
|
$(AR_COMMAND_1) $^ $(AR_COMMAND_2)
|
||||||
|
|
||||||
# NB: Assumes JNILIB was not overridden and is in $(OBJECTDIR)
|
# NB: Assumes JNILIB was not overridden and is in $(BUILD_DIR_BOARD)
|
||||||
$(JNILIB): $(CONTIKI_APP_OBJ) $(MAIN_OBJ) $(PROJECT_OBJECTFILES) $(ARCHIVE) | $(OBJECTDIR)
|
$(JNILIB): $(CONTIKI_APP_OBJ) $(MAIN_OBJ) $(PROJECT_OBJECTFILES) $(ARCHIVE) | $(OBJECTDIR)
|
||||||
|
|
||||||
ifdef REDEF_PRINTF
|
ifdef REDEF_PRINTF
|
||||||
|
@ -229,30 +229,34 @@ ALLLIBS = $(addprefix -l,$(LDLIBS)) $(addprefix -l,$(LDSTACKLIBS)) $(addprefix -
|
|||||||
ABS_APPLIBS = $(addsuffix _$(JENNIC_CHIP_FAMILY).a,$(addprefix $(COMPONENTS_BASE_DIR)/Library/lib,$(APPLIBS)))
|
ABS_APPLIBS = $(addsuffix _$(JENNIC_CHIP_FAMILY).a,$(addprefix $(COMPONENTS_BASE_DIR)/Library/lib,$(APPLIBS)))
|
||||||
|
|
||||||
ifneq ($(wildcard $(SDK_BASE_DIR)/Components/Library/*),)
|
ifneq ($(wildcard $(SDK_BASE_DIR)/Components/Library/*),)
|
||||||
# The SDK is fully installed, proceed to linking and objcopy to ready-to-upload .jn516x.bin file
|
# The SDK is fully installed, proceed to linking
|
||||||
%.$(TARGET): %.o $(PROJECT_OBJECTFILES) $(PROJECT_LIBRARIES) $(CONTIKI_NG_TARGET_LIB) $(ABS_APPLIBS)
|
$(BUILD_DIR_BOARD)/%.$(TARGET): %.o $(PROJECT_OBJECTFILES) $(PROJECT_LIBRARIES) $(CONTIKI_NG_TARGET_LIB) $(ABS_APPLIBS)
|
||||||
echo ${filter %.a,$^}
|
@echo ${filter %.a,$^}
|
||||||
$(Q)$(CC) -Wl,--gc-sections $(LDFLAGS) -T$(LINKCMD) -o $@ -Wl,--start-group \
|
$(Q)$(CC) -Wl,--gc-sections $(LDFLAGS) -T$(LINKCMD) -o $@ -Wl,--start-group \
|
||||||
$(patsubst /cygdrive/c/%,c:/%,${filter-out %.a,$^}) \
|
$(patsubst /cygdrive/c/%,c:/%,${filter-out %.a,$^}) \
|
||||||
$(patsubst /cygdrive/c/%,c:/%,${filter %.a,$^}) \
|
$(patsubst /cygdrive/c/%,c:/%,${filter %.a,$^}) \
|
||||||
$(ALLLIBS) -Wl,--end-group -Wl,-Map,$(CONTIKI_NG_PROJECT_MAP)
|
$(ALLLIBS) -Wl,--end-group -Wl,-Map,$(CONTIKI_NG_PROJECT_MAP)
|
||||||
$(OBJCOPY) -S -O binary $@ $@.bin
|
|
||||||
else
|
else
|
||||||
# The SDK does not include libraries, only build objects and libraries, skip linking
|
# The SDK does not include libraries, only build objects and libraries, skip linking
|
||||||
%.$(TARGET): %.o $(PROJECT_OBJECTFILES) $(PROJECT_LIBRARIES) $(CONTIKI_NG_TARGET_LIB)
|
$(BUILD_DIR_BOARD)/%.$(TARGET): %.o $(PROJECT_OBJECTFILES) $(PROJECT_LIBRARIES) $(CONTIKI_NG_TARGET_LIB)
|
||||||
echo Creating empty $@
|
@echo Creating empty $@
|
||||||
touch $@
|
touch $@
|
||||||
endif
|
endif
|
||||||
|
|
||||||
%.$(TARGET).bin: %.$(TARGET)
|
$(BUILD_DIR_BOARD)/%.$(TARGET).bin: $(BUILD_DIR_BOARD)/%.$(TARGET)
|
||||||
|
$(TRACE_OBJCOPY)
|
||||||
$(Q)$(OBJCOPY) -S -O binary $< $@
|
$(Q)$(OBJCOPY) -S -O binary $< $@
|
||||||
|
|
||||||
|
%.$(TARGET).bin: $(BUILD_DIR_BOARD)/%.$(TARGET).bin
|
||||||
|
$(TRACE_CP)
|
||||||
|
$(Q)$(CP) $< $@
|
||||||
|
|
||||||
### Upload target to one jn516x mote specified by MOTE=portNumber
|
### Upload target to one jn516x mote specified by MOTE=portNumber
|
||||||
ifeq ($(HOST_OS),Windows)
|
ifeq ($(HOST_OS),Windows)
|
||||||
%.upload: %.$(TARGET).bin
|
%.upload: $(BUILD_DIR_BOARD)/%.$(TARGET).bin
|
||||||
${FLASH_PROGRAMMER} -a -c $(DEV_PORT) -B 1000000 -s -w -f $<
|
${FLASH_PROGRAMMER} -a -c $(DEV_PORT) -B 1000000 -s -w -f $<
|
||||||
else
|
else
|
||||||
%.upload: %.$(TARGET).bin
|
%.upload: $(BUILD_DIR_BOARD)/%.$(TARGET).bin
|
||||||
${FLASH_PROGRAMMER} -V 10 -v -s $(DEV_PORT) -I 38400 -P 1000000 -f $<
|
${FLASH_PROGRAMMER} -V 10 -v -s $(DEV_PORT) -I 38400 -P 1000000 -f $<
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -276,7 +280,7 @@ motelistinfo:
|
|||||||
$(Q)$(MOTELIST) ${FLASH_PROGRAMMER} \?
|
$(Q)$(MOTELIST) ${FLASH_PROGRAMMER} \?
|
||||||
|
|
||||||
### Upload target to all connected jn516x motes
|
### Upload target to all connected jn516x motes
|
||||||
%.uploadall: %.$(TARGET).bin
|
%.uploadall: $(BUILD_DIR_BOARD)/%.$(TARGET).bin
|
||||||
$(Q)$(MOTELIST) ${FLASH_PROGRAMMER} $<
|
$(Q)$(MOTELIST) ${FLASH_PROGRAMMER} $<
|
||||||
|
|
||||||
### Flash the given file to all connected jn516x motes
|
### Flash the given file to all connected jn516x motes
|
||||||
|
@ -35,11 +35,12 @@ endif
|
|||||||
|
|
||||||
BSL = $(CONTIKI)/tools/cc2538-bsl/cc2538-bsl.py
|
BSL = $(CONTIKI)/tools/cc2538-bsl/cc2538-bsl.py
|
||||||
|
|
||||||
%.upload: %.bin %.elf
|
%.upload: $(OUT_BIN) $(OUT_ELF)
|
||||||
ifeq ($(wildcard $(BSL)), )
|
ifeq ($(wildcard $(BSL)), )
|
||||||
@echo "ERROR: Could not find the cc2538-bsl script. Did you run 'git submodule update --init' ?"
|
@echo "ERROR: Could not find the cc2538-bsl script. Did you run 'git submodule update --init' ?"
|
||||||
else
|
else
|
||||||
$(eval BSL_ADDRESS_ARG := -a $(shell $(OBJDUMP) -h $*.elf | grep -B1 LOAD | \
|
$(eval BSL_ADDRESS_ARG := -a $(shell $(OBJDUMP) -h \
|
||||||
|
$(BUILD_DIR_BOARD)/$*.elf | grep -B1 LOAD | \
|
||||||
grep -Ev 'LOAD|\-\-' | awk '{print "0x" $$5}' | \
|
grep -Ev 'LOAD|\-\-' | awk '{print "0x" $$5}' | \
|
||||||
sort -g | head -1))
|
sort -g | head -1))
|
||||||
$(PYTHON) $(BSL) $(BSL_FLAGS) $(BSL_ADDRESS_ARG) $<
|
$(PYTHON) $(BSL) $(BSL_FLAGS) $(BSL_ADDRESS_ARG) $<
|
||||||
|
@ -69,9 +69,9 @@ endif
|
|||||||
### $$$$ Double escapes $s that need to be passed to the shell - once for when
|
### $$$$ Double escapes $s that need to be passed to the shell - once for when
|
||||||
### make parses UPLOAD_RULE, and once for when the expanded rule is parsed by make.
|
### make parses UPLOAD_RULE, and once for when the expanded rule is parsed by make.
|
||||||
define UPLOAD_RULE
|
define UPLOAD_RULE
|
||||||
%.$(MOTE): %.bin %.elf
|
%.$(MOTE): $(OUT_BIN) $(OUT_ELF)
|
||||||
@echo "Flashing $(MOTE)"
|
@echo "Flashing $(MOTE)"
|
||||||
@BSL_ADDRESS=`$(OBJDUMP) -h $$*.elf | grep -B1 LOAD | \
|
@BSL_ADDRESS=`$(OBJDUMP) -h $(BUILD_DIR_BOARD)/$$*.elf | grep -B1 LOAD | \
|
||||||
grep -Ev 'LOAD|\-\-' | awk '{print "0x" $$$$5}' | \
|
grep -Ev 'LOAD|\-\-' | awk '{print "0x" $$$$5}' | \
|
||||||
sort -g | head -1`; \
|
sort -g | head -1`; \
|
||||||
$(PYTHON) $(BSL) $(BSL_FLAGS) -b $(BSL_SPEED) -a $$$${BSL_ADDRESS} -p $(MOTE) $$<
|
$(PYTHON) $(BSL) $(BSL_FLAGS) -b $(BSL_SPEED) -a $$$${BSL_ADDRESS} -p $(MOTE) $$<
|
||||||
|
@ -1 +1 @@
|
|||||||
TARGET = srf06-cc26xx
|
TARGET = cc26x0-cc13x0
|
||||||
|
@ -1 +1 @@
|
|||||||
TARGET = srf06-cc26xx
|
TARGET = cc26x0-cc13x0
|
||||||
|
@ -1 +1 @@
|
|||||||
TARGET = srf06-cc26xx
|
TARGET = cc26x0-cc13x0
|
||||||
|
@ -32,34 +32,42 @@
|
|||||||
#include "jsonparse.h"
|
#include "jsonparse.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <stdbool.h>
|
||||||
|
|
||||||
/*--------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------*/
|
||||||
static int
|
static bool
|
||||||
push(struct jsonparse_state *state, char c)
|
push(struct jsonparse_state *state, char c)
|
||||||
{
|
{
|
||||||
|
if(state->depth < JSONPARSE_MAX_DEPTH) {
|
||||||
state->stack[state->depth] = c;
|
state->stack[state->depth] = c;
|
||||||
state->depth++;
|
state->depth++;
|
||||||
state->vtype = 0;
|
state->vtype = 0;
|
||||||
return state->depth < JSONPARSE_MAX_DEPTH;
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/*--------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------*/
|
||||||
static void
|
static bool
|
||||||
modify(struct jsonparse_state *state, char c)
|
modify(struct jsonparse_state *state, char c)
|
||||||
{
|
{
|
||||||
if(state->depth > 0) {
|
if(state->depth > 0) {
|
||||||
state->stack[state->depth - 1] = c;
|
state->stack[state->depth - 1] = c;
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*--------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------*/
|
||||||
static char
|
static bool
|
||||||
pop(struct jsonparse_state *state)
|
pop(struct jsonparse_state *state)
|
||||||
{
|
{
|
||||||
if(state->depth == 0) {
|
if(state->depth == 0) {
|
||||||
return JSON_TYPE_ERROR;
|
return false;
|
||||||
}
|
}
|
||||||
state->depth--;
|
state->depth--;
|
||||||
state->vtype = state->stack[state->depth];
|
state->vtype = state->stack[state->depth];
|
||||||
return state->stack[state->depth];
|
return true;
|
||||||
}
|
}
|
||||||
/*--------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------*/
|
||||||
/* will pass by the value and store the start and length of the value for
|
/* will pass by the value and store the start and length of the value for
|
||||||
@ -134,15 +142,11 @@ skip_ws(struct jsonparse_state *state)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*--------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------*/
|
||||||
static int
|
static bool
|
||||||
is_atomic(struct jsonparse_state *state)
|
is_atomic(struct jsonparse_state *state)
|
||||||
{
|
{
|
||||||
char v = state->vtype;
|
char v = state->vtype;
|
||||||
if(v == 'N' || v == '"' || v == '0' || v == 'n' || v == 't' || v == 'f') {
|
return v == 'N' || v == '"' || v == '0' || v == 'n' || v == 't' || v == 'f';
|
||||||
return 1;
|
|
||||||
} else {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/*--------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------*/
|
||||||
void
|
void
|
||||||
@ -163,6 +167,7 @@ jsonparse_next(struct jsonparse_state *state)
|
|||||||
char c;
|
char c;
|
||||||
char s;
|
char s;
|
||||||
char v;
|
char v;
|
||||||
|
bool ret;
|
||||||
|
|
||||||
skip_ws(state);
|
skip_ws(state);
|
||||||
c = state->json[state->pos];
|
c = state->json[state->pos];
|
||||||
@ -173,48 +178,51 @@ jsonparse_next(struct jsonparse_state *state)
|
|||||||
switch(c) {
|
switch(c) {
|
||||||
case '{':
|
case '{':
|
||||||
if((s == 0 && v == 0) || s == '[' || s == ':') {
|
if((s == 0 && v == 0) || s == '[' || s == ':') {
|
||||||
push(state, c);
|
if(push(state, c)) {
|
||||||
} else {
|
return c;
|
||||||
|
}
|
||||||
|
}
|
||||||
state->error = JSON_ERROR_UNEXPECTED_OBJECT;
|
state->error = JSON_ERROR_UNEXPECTED_OBJECT;
|
||||||
return JSON_TYPE_ERROR;
|
return JSON_TYPE_ERROR;
|
||||||
}
|
|
||||||
return c;
|
|
||||||
case '}':
|
case '}':
|
||||||
if((s == ':' && v != ',' && v != 0 ) || (s == '{' && v == 0)) {
|
if((s == ':' && v != ',' && v != 0 ) || (s == '{' && v == 0)) {
|
||||||
pop(state);
|
if(pop(state)) {
|
||||||
} else {
|
return c;
|
||||||
|
}
|
||||||
|
}
|
||||||
state->error = JSON_ERROR_UNEXPECTED_END_OF_OBJECT;
|
state->error = JSON_ERROR_UNEXPECTED_END_OF_OBJECT;
|
||||||
return JSON_TYPE_ERROR;
|
return JSON_TYPE_ERROR;
|
||||||
}
|
|
||||||
return c;
|
|
||||||
case ']':
|
case ']':
|
||||||
if(s == '[' && v != ',') {
|
if(s == '[' && v != ',') {
|
||||||
pop(state);
|
if(pop(state)) {
|
||||||
} else {
|
return c;
|
||||||
|
}
|
||||||
|
}
|
||||||
state->error = JSON_ERROR_UNEXPECTED_END_OF_ARRAY;
|
state->error = JSON_ERROR_UNEXPECTED_END_OF_ARRAY;
|
||||||
return JSON_TYPE_ERROR;
|
return JSON_TYPE_ERROR;
|
||||||
}
|
|
||||||
return c;
|
|
||||||
case ':':
|
case ':':
|
||||||
if(s == '{' && v == 'N') {
|
if(s == '{' && v == 'N') {
|
||||||
modify(state, ':');
|
ret = modify(state, ':');
|
||||||
state->vtype = 0;
|
state->vtype = 0;
|
||||||
} else {
|
if(ret) {
|
||||||
|
return jsonparse_next(state);
|
||||||
|
}
|
||||||
|
}
|
||||||
state->error = JSON_ERROR_SYNTAX;
|
state->error = JSON_ERROR_SYNTAX;
|
||||||
return JSON_TYPE_ERROR;
|
return JSON_TYPE_ERROR;
|
||||||
}
|
|
||||||
return jsonparse_next(state);
|
|
||||||
case ',':
|
case ',':
|
||||||
if(s == ':' && v != 0) {
|
if(s == ':' && v != 0) {
|
||||||
modify(state, '{');
|
ret = modify(state, '{');
|
||||||
state->vtype = c;
|
state->vtype = c;
|
||||||
|
if(ret) {
|
||||||
|
return c;
|
||||||
|
}
|
||||||
} else if(s == '[') {
|
} else if(s == '[') {
|
||||||
state->vtype = c;
|
state->vtype = c;
|
||||||
} else {
|
return c;
|
||||||
|
}
|
||||||
state->error = JSON_ERROR_SYNTAX;
|
state->error = JSON_ERROR_SYNTAX;
|
||||||
return JSON_TYPE_ERROR;
|
return JSON_TYPE_ERROR;
|
||||||
}
|
|
||||||
return c;
|
|
||||||
case '"':
|
case '"':
|
||||||
if((s == 0 && v == 0) || s == '{' || s == '[' || s == ':') {
|
if((s == 0 && v == 0) || s == '{' || s == '[' || s == ':') {
|
||||||
return atomic(state, c = (s == '{' ? JSON_TYPE_PAIR_NAME : c));
|
return atomic(state, c = (s == '{' ? JSON_TYPE_PAIR_NAME : c));
|
||||||
@ -225,12 +233,12 @@ jsonparse_next(struct jsonparse_state *state)
|
|||||||
return c;
|
return c;
|
||||||
case '[':
|
case '[':
|
||||||
if((s == 0 && v == 0) || s == '[' || s == ':') {
|
if((s == 0 && v == 0) || s == '[' || s == ':') {
|
||||||
push(state, c);
|
if(push(state, c)) {
|
||||||
} else {
|
return c;
|
||||||
|
}
|
||||||
|
}
|
||||||
state->error = JSON_ERROR_UNEXPECTED_ARRAY;
|
state->error = JSON_ERROR_UNEXPECTED_ARRAY;
|
||||||
return JSON_TYPE_ERROR;
|
return JSON_TYPE_ERROR;
|
||||||
}
|
|
||||||
return c;
|
|
||||||
case 0:
|
case 0:
|
||||||
if(v == 0 || state->depth > 0) {
|
if(v == 0 || state->depth > 0) {
|
||||||
state->error = JSON_ERROR_SYNTAX;
|
state->error = JSON_ERROR_SYNTAX;
|
||||||
|
@ -198,7 +198,10 @@ jsontree_print_next(struct jsontree_context *js_ctx)
|
|||||||
} else {
|
} else {
|
||||||
ov = o->values[index];
|
ov = o->values[index];
|
||||||
}
|
}
|
||||||
/* TODO check max depth */
|
if(js_ctx->depth >= JSONTREE_MAX_DEPTH - 1) {
|
||||||
|
/* Too deep: return 0 */
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
js_ctx->depth++; /* step down to value... */
|
js_ctx->depth++; /* step down to value... */
|
||||||
js_ctx->index[js_ctx->depth] = 0; /* and init index */
|
js_ctx->index[js_ctx->depth] = 0; /* and init index */
|
||||||
js_ctx->values[js_ctx->depth] = ov;
|
js_ctx->values[js_ctx->depth] = ov;
|
||||||
@ -299,7 +302,10 @@ find_next(struct jsontree_context *js_ctx)
|
|||||||
} else {
|
} else {
|
||||||
ov = o->values[index];
|
ov = o->values[index];
|
||||||
}
|
}
|
||||||
/* TODO check max depth */
|
if(js_ctx->depth >= JSONTREE_MAX_DEPTH - 1) {
|
||||||
|
/* Too deep: return NULL */
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
js_ctx->depth++; /* step down to value... */
|
js_ctx->depth++; /* step down to value... */
|
||||||
js_ctx->index[js_ctx->depth] = 0; /* and init index */
|
js_ctx->index[js_ctx->depth] = 0; /* and init index */
|
||||||
js_ctx->values[js_ctx->depth] = ov;
|
js_ctx->values[js_ctx->depth] = ov;
|
||||||
|
@ -562,7 +562,7 @@ slip_init(void)
|
|||||||
slip_send(slipfd, SLIP_END);
|
slip_send(slipfd, SLIP_END);
|
||||||
inslip = fdopen(slipfd, "r");
|
inslip = fdopen(slipfd, "r");
|
||||||
if(inslip == NULL) {
|
if(inslip == NULL) {
|
||||||
err(1, "main: fdopen");
|
err(1, "slip_init: fdopen");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*---------------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------------*/
|
||||||
|
@ -210,7 +210,7 @@ tun_init()
|
|||||||
tunfd = tun_alloc(slip_config_tundev);
|
tunfd = tun_alloc(slip_config_tundev);
|
||||||
|
|
||||||
if(tunfd == -1) {
|
if(tunfd == -1) {
|
||||||
err(1, "main: open");
|
err(1, "tun_init: open");
|
||||||
}
|
}
|
||||||
|
|
||||||
select_set_callback(tunfd, &tun_select_callback);
|
select_set_callback(tunfd, &tun_select_callback);
|
||||||
|
20
tests/19-out-of-tree-build/Makefile
Normal file
20
tests/19-out-of-tree-build/Makefile
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
EXAMPLESDIR=$(HOME)/out-of-tree-tests
|
||||||
|
TOOLSDIR=$(HOME)/contiki-ng/tools
|
||||||
|
|
||||||
|
EXAMPLES = \
|
||||||
|
hello-world/native \
|
||||||
|
hello-world/native:MAKE_NET=MAKE_NET_NULLNET \
|
||||||
|
hello-world/native:MAKE_ROUTING=MAKE_ROUTING_RPL_CLASSIC \
|
||||||
|
hello-world/sky \
|
||||||
|
hello-world/nrf52dk \
|
||||||
|
hello-world/cc2538dk \
|
||||||
|
hello-world/zoul \
|
||||||
|
hello-world/openmote-cc2538 \
|
||||||
|
hello-world/cc26x0-cc13x0 \
|
||||||
|
hello-world/jn516x \
|
||||||
|
hello-world/simplelink:BOARD=launchpad/cc26x2r1 \
|
||||||
|
hello-world/simplelink:BOARD=sensortag/cc2650 \
|
||||||
|
|
||||||
|
TOOLS=
|
||||||
|
|
||||||
|
include ../Makefile.compile-test
|
@ -1 +1 @@
|
|||||||
Subproject commit a5904b98366478bb9e7f7fe9f0bb78fc064914c5
|
Subproject commit 63538bbb882ba06a7b8cf97c11ce2fe4d22e4f88
|
@ -1,29 +1,58 @@
|
|||||||
FROM 32bit/ubuntu:16.04
|
FROM 32bit/ubuntu:16.04
|
||||||
|
|
||||||
|
ENV DEBIAN_FRONTEND noninteractive
|
||||||
|
|
||||||
# Tools
|
# Tools
|
||||||
RUN apt-get update && \
|
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF && \
|
||||||
apt-get install -y --no-install-recommends \
|
echo "deb http://download.mono-project.com/repo/ubuntu xenial main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list && \
|
||||||
build-essential doxygen git wget unzip python-serial python-pip \
|
apt-get -qq update && \
|
||||||
default-jdk ant srecord iputils-tracepath rlwrap \
|
apt-get -qq -y --no-install-recommends install \
|
||||||
mosquitto mosquitto-clients gdb \
|
ant \
|
||||||
&& apt-get clean
|
build-essential \
|
||||||
|
default-jdk \
|
||||||
|
doxygen \
|
||||||
|
gdb \
|
||||||
|
git \
|
||||||
|
gksu \
|
||||||
|
gtk-sharp2 \
|
||||||
|
iputils-tracepath \
|
||||||
|
libcanberra-gtk-module:i386 \
|
||||||
|
libgtk2.0-0 \
|
||||||
|
mono-complete \
|
||||||
|
mosquitto \
|
||||||
|
mosquitto-clients \
|
||||||
|
npm \
|
||||||
|
python-pip \
|
||||||
|
python-serial \
|
||||||
|
rlwrap \
|
||||||
|
screen \
|
||||||
|
srecord \
|
||||||
|
uml-utilities \
|
||||||
|
unzip \
|
||||||
|
wget \
|
||||||
|
> /dev/null \
|
||||||
|
&& apt-get -qq clean
|
||||||
|
|
||||||
|
# Install coap-cli
|
||||||
|
RUN npm -q install coap-cli -g \
|
||||||
|
&& sudo ln -s /usr/bin/nodejs /usr/bin/node
|
||||||
|
|
||||||
# Install ARM toolchain
|
# Install ARM toolchain
|
||||||
RUN wget https://launchpad.net/gcc-arm-embedded/5.0/5-2015-q4-major/+download/gcc-arm-none-eabi-5_2-2015q4-20151219-linux.tar.bz2 && \
|
RUN wget -nv https://launchpad.net/gcc-arm-embedded/5.0/5-2015-q4-major/+download/gcc-arm-none-eabi-5_2-2015q4-20151219-linux.tar.bz2 && \
|
||||||
tar xjf gcc-arm-none-eabi-5_2-2015q4-20151219-linux.tar.bz2 -C /tmp/ && \
|
tar xjf gcc-arm-none-eabi-5_2-2015q4-20151219-linux.tar.bz2 -C /tmp/ && \
|
||||||
cp -f -r /tmp/gcc-arm-none-eabi-5_2-2015q4/* /usr/local/ && \
|
cp -f -r /tmp/gcc-arm-none-eabi-5_2-2015q4/* /usr/local/ && \
|
||||||
rm -rf /tmp/gcc-arm-none-eabi-* gcc-arm-none-eabi-*-linux.tar.bz2
|
rm -rf /tmp/gcc-arm-none-eabi-* gcc-arm-none-eabi-*-linux.tar.bz2
|
||||||
|
|
||||||
# Install msp430 toolchain
|
# Install msp430 toolchain
|
||||||
RUN wget http://simonduq.github.io/resources/mspgcc-4.7.2-compiled.tar.bz2 && \
|
RUN wget -nv http://simonduq.github.io/resources/mspgcc-4.7.2-compiled.tar.bz2 && \
|
||||||
tar xjf mspgcc*.tar.bz2 -C /tmp/ && \
|
tar xjf mspgcc*.tar.bz2 -C /tmp/ && \
|
||||||
cp -f -r /tmp/msp430/* /usr/local/ && \
|
cp -f -r /tmp/msp430/* /usr/local/ && \
|
||||||
rm -rf /tmp/msp430 mspgcc*.tar.bz2
|
rm -rf /tmp/msp430 mspgcc*.tar.bz2
|
||||||
|
|
||||||
# Install NXP toolchain (partial, with binaries excluded. Download from nxp.com)
|
# Install NXP toolchain (partial, with binaries excluded. Download from nxp.com)
|
||||||
RUN wget http://simonduq.github.io/resources/ba-elf-gcc-4.7.4-part1.tar.bz2 && \
|
RUN wget -nv http://simonduq.github.io/resources/ba-elf-gcc-4.7.4-part1.tar.bz2 && \
|
||||||
wget http://simonduq.github.io/resources/ba-elf-gcc-4.7.4-part2.tar.bz2 && \
|
wget -nv http://simonduq.github.io/resources/ba-elf-gcc-4.7.4-part2.tar.bz2 && \
|
||||||
wget http://simonduq.github.io/resources/jn516x-sdk-4163-1416.tar.bz2 && \
|
wget -nv http://simonduq.github.io/resources/jn516x-sdk-4163-1416.tar.bz2 && \
|
||||||
mkdir /tmp/jn516x-sdk /tmp/ba-elf-gcc && \
|
mkdir /tmp/jn516x-sdk /tmp/ba-elf-gcc && \
|
||||||
tar xjf jn516x-sdk-*.tar.bz2 -C /tmp/jn516x-sdk && \
|
tar xjf jn516x-sdk-*.tar.bz2 -C /tmp/jn516x-sdk && \
|
||||||
tar xjf ba-elf-gcc-*part1.tar.bz2 -C /tmp/ba-elf-gcc && \
|
tar xjf ba-elf-gcc-*part1.tar.bz2 -C /tmp/ba-elf-gcc && \
|
||||||
@ -35,18 +64,17 @@ RUN wget http://simonduq.github.io/resources/ba-elf-gcc-4.7.4-part1.tar.bz2 && \
|
|||||||
ENV PATH="/usr/ba-elf-gcc/bin:${PATH}"
|
ENV PATH="/usr/ba-elf-gcc/bin:${PATH}"
|
||||||
|
|
||||||
## Install nRF52 SDK
|
## Install nRF52 SDK
|
||||||
RUN wget https://developer.nordicsemi.com/nRF5_IoT_SDK/nRF5_IoT_SDK_v0.9.x/nrf5_iot_sdk_3288530.zip && \
|
RUN wget -nv https://developer.nordicsemi.com/nRF5_IoT_SDK/nRF5_IoT_SDK_v0.9.x/nrf5_iot_sdk_3288530.zip && \
|
||||||
mkdir /usr/nrf52-sdk && \
|
mkdir /usr/nrf52-sdk && \
|
||||||
unzip nrf5_iot_sdk_3288530.zip -d /usr/nrf52-sdk && \
|
unzip -q nrf5_iot_sdk_3288530.zip -d /usr/nrf52-sdk && \
|
||||||
rm nrf5_iot_sdk_3288530.zip
|
rm nrf5_iot_sdk_3288530.zip
|
||||||
|
|
||||||
ENV NRF52_SDK_ROOT /usr/nrf52-sdk
|
ENV NRF52_SDK_ROOT /usr/nrf52-sdk
|
||||||
|
|
||||||
# Install sphinx and sphinx_rtd_theme, required for building and testing the
|
# Install sphinx and sphinx_rtd_theme, required for building and testing the
|
||||||
# readthedocs API documentation
|
# readthedocs API documentation
|
||||||
RUN pip install --upgrade pip
|
RUN pip -q install --upgrade pip
|
||||||
RUN pip install setuptools
|
RUN pip -q install setuptools && pip -q install sphinx_rtd_theme sphinx
|
||||||
RUN pip install sphinx_rtd_theme sphinx
|
|
||||||
|
|
||||||
# Create user, enable X forwarding, add to group dialout
|
# Create user, enable X forwarding, add to group dialout
|
||||||
# -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix
|
# -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix
|
||||||
@ -74,21 +102,8 @@ WORKDIR ${HOME}
|
|||||||
RUN echo "#!/bin/bash\nant -Dbasedir=${COOJA} -f ${COOJA}/build.xml run" > ${HOME}/cooja && \
|
RUN echo "#!/bin/bash\nant -Dbasedir=${COOJA} -f ${COOJA}/build.xml run" > ${HOME}/cooja && \
|
||||||
chmod +x ${HOME}/cooja
|
chmod +x ${HOME}/cooja
|
||||||
|
|
||||||
# Install coap-cli
|
|
||||||
RUN sudo apt-get install -y npm \
|
|
||||||
&& sudo apt-get clean \
|
|
||||||
&& sudo npm install coap-cli -g \
|
|
||||||
&& sudo ln -s /usr/bin/nodejs /usr/bin/node
|
|
||||||
|
|
||||||
# Install Mono and libcanberra-gtk:i386 (for Renode)
|
|
||||||
RUN sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF \
|
|
||||||
&& echo "deb http://download.mono-project.com/repo/ubuntu xenial main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list \
|
|
||||||
&& sudo apt-get update \
|
|
||||||
&& sudo apt-get install -y mono-complete gksu libgtk2.0-0 screen uml-utilities gtk-sharp2 libcanberra-gtk-module:i386 \
|
|
||||||
&& sudo apt-get clean
|
|
||||||
|
|
||||||
# Download, build and install Renode
|
# Download, build and install Renode
|
||||||
RUN git clone https://github.com/renode/renode.git \
|
RUN git clone --quiet https://github.com/renode/renode.git \
|
||||||
&& cd ${HOME}/renode \
|
&& cd ${HOME}/renode \
|
||||||
&& git checkout v1.3 \
|
&& git checkout v1.3 \
|
||||||
&& ./build.sh
|
&& ./build.sh
|
||||||
|
Loading…
Reference in New Issue
Block a user