summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorhathach <[email protected]>2019-01-29 20:13:17 +0700
committerGitHub <[email protected]>2019-01-29 20:13:17 +0700
commit29b49199beb8e9b5fead83e5cd36105f8746f1d7 (patch)
tree5fec0508a84fd7b75b21b16b13ef6181d97eaaa5 /examples
parentbd5325612620209e7964f10817a57f916d3bc13f (diff)
parent1a84f5da5496e7ea410e9023253b30933c207159 (diff)
Merge pull request #34 from hathach/develop
add tusb_inited(), better compatible with nrf SD
Diffstat (limited to 'examples')
-rw-r--r--examples/device/cdc_msc_hid/Makefile20
-rw-r--r--examples/device/cdc_msc_hid/ses/nrf5x/nRF52840_xxAA_s140v6_MemoryMap.xml5
-rw-r--r--examples/device/cdc_msc_hid/ses/nrf5x/nrf5x.emProject17
3 files changed, 37 insertions, 5 deletions
diff --git a/examples/device/cdc_msc_hid/Makefile b/examples/device/cdc_msc_hid/Makefile
index 11c05ad26..983365fc4 100644
--- a/examples/device/cdc_msc_hid/Makefile
+++ b/examples/device/cdc_msc_hid/Makefile
@@ -20,6 +20,7 @@ CC = $(CROSS_COMPILE)gcc
CXX = $(CROSS_COMPILE)g++
LD = $(CROSS_COMPILE)ld
OBJCOPY = $(CROSS_COMPILE)objcopy
+SIZE = $(CROSS_COMPILE)size
MKDIR = mkdir
SED = sed
CP = cp
@@ -84,10 +85,10 @@ LIB_SOURCE += \
SRC_C += $(LIB_SOURCE)
-OBJ = $(addprefix $(BUILD)/obj/, $(SRC_C:.c=.o))
-OBJ += $(addprefix $(BUILD)/obj/, $(SRC_S:.s=.o))
+OBJ += $(addprefix $(BUILD)/obj/, $(SRC_C:.c=.o))
+OBJ += $(addprefix $(BUILD)/obj/, $(SRC_S:.S=.o))
-all: $(BUILD)/$(BOARD)-firmware.bin
+all: $(BUILD)/$(BOARD)-firmware.bin size
OBJ_DIRS = $(sort $(dir $(OBJ)))
$(OBJ): | $(OBJ_DIRS)
@@ -107,7 +108,7 @@ $(BUILD)/$(BOARD)-firmware.bin: $(BUILD)/$(BOARD)-firmware.elf
# to be used to compile all .c files.
vpath %.c . $(TOP)
$(BUILD)/obj/%.o: %.c
- @echo CC $@
+ @echo CC $(notdir $@)
@$(CC) $(CFLAGS) -c -MD -o $@ $<
@# The following fixes the dependency file.
@# See http://make.paulandlesley.org/autodep.html for details.
@@ -117,5 +118,16 @@ $(BUILD)/obj/%.o: %.c
-e '/^$$/ d' -e 's/$$/ :/' < $(@:.o=.d) >> $(@:.o=.P); \
$(RM) $(@:.o=.d)
+# ASM sources
+vpath %.S . $(TOP)
+$(BUILD)/obj/%.o: %.S
+ @echo AS $(notdir $@)
+ @$(CC) -x assembler-with-cpp $(ASFLAGS) -c -o $@ $<
+
+size: $(BUILD)/$(BOARD)-firmware.elf
+ -@echo ''
+ @$(SIZE) $<
+ -@echo ''
+
clean:
rm -rf build-$(BOARD)
diff --git a/examples/device/cdc_msc_hid/ses/nrf5x/nRF52840_xxAA_s140v6_MemoryMap.xml b/examples/device/cdc_msc_hid/ses/nrf5x/nRF52840_xxAA_s140v6_MemoryMap.xml
new file mode 100644
index 000000000..48aad06af
--- /dev/null
+++ b/examples/device/cdc_msc_hid/ses/nrf5x/nRF52840_xxAA_s140v6_MemoryMap.xml
@@ -0,0 +1,5 @@
+<!DOCTYPE Board_Memory_Definition_File>
+<root name="nRF52840_xxAA_s140v6">
+ <MemorySegment name="FLASH" start="0x00026000" size="0x000C7000" access="ReadOnly" />
+ <MemorySegment name="RAM" start="0x20004000" size="0x0003C000" access="Read/Write" />
+</root>
diff --git a/examples/device/cdc_msc_hid/ses/nrf5x/nrf5x.emProject b/examples/device/cdc_msc_hid/ses/nrf5x/nrf5x.emProject
index de2a6a78d..b94dac089 100644
--- a/examples/device/cdc_msc_hid/ses/nrf5x/nrf5x.emProject
+++ b/examples/device/cdc_msc_hid/ses/nrf5x/nrf5x.emProject
@@ -84,6 +84,9 @@
<file file_name="../../../../../hw/mcu/nordic/nrfx_glue.h" />
</folder>
</folder>
+ <configuration
+ Name="pca10056 s140v6"
+ build_treat_warnings_as_errors="No" />
</folder>
<configuration Name="Debug" build_treat_warnings_as_errors="Yes" />
<folder
@@ -98,6 +101,7 @@
<file file_name="nRF52840_xxAA_MemoryMap.xml" />
<file file_name="nRF_Target.js" />
<file file_name="thumb_crt0.s" />
+ <file file_name="nRF52840_xxAA_s140v6_MemoryMap.xml" />
</folder>
<folder
Name="segger_rtt"
@@ -105,7 +109,18 @@
filter="*.c;*.h"
path="../../../../../lib/segger_rtt"
recurse="No" />
- <configuration Name="pca10056" build_treat_warnings_as_errors="No" />
+ <configuration
+ Name="pca10056"
+ build_treat_warnings_as_errors="No"
+ linker_memory_map_file="nRF52840_xxAA_MemoryMap.xml" />
+ <configuration
+ Name="pca10056 s140v6"
+ build_treat_warnings_as_errors="No"
+ c_preprocessor_definitions="SOFTDEVICE_PRESENT;S140;NO_VTOR_CONFIG"
+ c_user_include_directories="$(nrfxDir)/../nrf5x/s140_nrf52_6.1.1_API/include;$(nrfxDir)/../nrf5x/s140_nrf52_6.1.1_API/include/nrf52"
+ debug_start_from_entry_point_symbol="No"
+ linker_memory_map_file="nRF52840_xxAA_s140v6_MemoryMap.xml" />
</project>
<configuration Name="pca10056" />
+ <configuration Name="pca10056 s140v6" />
</solution>