This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Newbie having trouble getting started...

Hello, I just received my BMD-200 eval board today and cannot get any of the examples working. I started out trying to get blinky to work using GCC and the make files provided. I am able to successfully build the projects. The _build directory has the .hex files. It is not clear what the next step should be here. make soft_device seems to just load the Soft Device so how does the example get loaded in this paradigm? What dictates where in memory it gets loaded in the GCC paradigm? Is this important?

After many attempts, I gave up on the above method and tried using nrfGo Studio. I loaded the 110 Soft Device (I am on the latest SDK version 8), and then loaded several peripheral examples. None of them run.

I gave up on this method and downloaded the Keil tools. I followed the instructions in the manual by first using nrfGo Studio to load the 110 Soft Device, and then moved over to the Keil tool. Made all of the configuration modifcations, downloaded custom_board.h, and the project builds successfully. It even seems to download to Flash successfully but it won't run. blinky does not blink and none of the ble peripheral examples advertise, so I know its not working.

I'm not sure what to try next. Can you please let me know what I am doing wrong based on the above. I don't care which method I use; I just need one that works.

Any help would be greatly appreciated.

Thanks.

Ernest

Parents Reply Children
  • Yes I have downloaded SDK 7.0 and SDK 7.2 and am trying to use them now instead of 8. Unfortunately I am getting the following error now when I try to make -f makefile on blinky:

    Compiling file: system_nrf51.c
    The system cannot find the path specified
    make: *** [_build/system_nrf51.o] Error 1
    

    Not sure how to get past this one as I'm not sure whats causing it. The same makefile works fine in SDK 8 and the file structures/hierarchy seem identicle.

  • The file structures are different from SDK7 to SDK8. You need to base on the makefile of SDK7. There are many differences in both source path and include path.

  • Thanks for the advise. I have started with the SDK 7 Makefile but cant get past this error:

    make[1]: *** No rule to make target _build/V', needed bynrf51822_xxaa'. Stop.

    I'm sure its something simple, but I'm not very familiar with Makefile syntax. MAkefile below:

    PROJECT_NAME := blinky_s110_pca10028
    
    export OUTPUT_FILENAME
    #MAKEFILE_NAME := $(CURDIR)/$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
    MAKEFILE_NAME := $(MAKEFILE_LIST)
    MAKEFILE_DIR := $(dir $(MAKEFILE_NAME) ) 
    
    TEMPLATE_PATH = ../../../../../../components/toolchain/gcc
    ifeq ($(OS),Windows_NT)
    include $(TEMPLATE_PATH)/Makefile.windows
    else
    include $(TEMPLATE_PATH)/Makefile.posix
    endif
    
    MK := mkdir
    RM := rm -rf
    
    #echo suspend
    ifeq ("$(VERBOSE)","1")
    NO_ECHO := 
    else
    NO_ECHO := @
    endif
    
    # Toolchain commands
    CC       		:= "$(GNU_INSTALL_ROOT)/bin/$(GNU_PREFIX)-gcc"
    AS       		:= "$(GNU_INSTALL_ROOT)/bin/$(GNU_PREFIX)-as"
    AR       		:= "$(GNU_INSTALL_ROOT)/bin/$(GNU_PREFIX)-ar" -r
    LD       		:= "$(GNU_INSTALL_ROOT)/bin/$(GNU_PREFIX)-ld"
    NM       		:= "$(GNU_INSTALL_ROOT)/bin/$(GNU_PREFIX)-nm"
    OBJDUMP  		:= "$(GNU_INSTALL_ROOT)/bin/$(GNU_PREFIX)-objdump"
    OBJCOPY  		:= "$(GNU_INSTALL_ROOT)/bin/$(GNU_PREFIX)-objcopy"
    SIZE    		:= "$(GNU_INSTALL_ROOT)/bin/$(GNU_PREFIX)-size"
    
    #function for removing duplicates in a list
    remduplicates = $(strip $(if $1,$(firstword $1) $(call remduplicates,$(filter-out $(firstword $1),$1))))
    
    #source common to all targets
    C_SOURCE_FILES += \
    C:\Rigado\V 7.2.0\components\toolchain\system_nrf51.c \
    C:\Rigado\V 7.2.0\examples\peripheral\blinky\main.c \
    C:\Rigado\V 7.2.0\components\drivers_nrf\hal\nrf_delay.c \
    
    #../../../../../../components/toolchain/system_nrf51.c \
    #../../../main.c \
    #../../../../../../components/drivers_nrf/hal/nrf_delay.c \
    
    #assembly files common to all targets
    #ASM_SOURCE_FILES  = ../../../../../../components/toolchain/gcc/gcc_startup_nrf51.s
    
    ASM_SOURCE_FILES  = C:\Rigado\V 7.2.0\components\toolchain\gcc\gcc_startup_nrf51.s
    
    #includes common to all targets
    
    INC_PATHS  = -I.C:\Rigado\V 7.2.0\components\toolchain\gcc
    INC_PATHS += -IC:\Rigado\V 7.2.0\components\toolchain
    INC_PATHS += -IC:\Rigado\V 7.2.0\components\softdevice\s110/headers
    INC_PATHS += -I../../..
    INC_PATHS += -IC:\Rigado\V 7.2.0\examples\bsp
    INC_PATHS += -IC:\Rigado\V 7.2.0\components\device
    INC_PATHS += -IC:\Rigado\V 7.2.0\components\drivers_nrf\hal
    
    #INC_PATHS  = -I../../../../../../components/toolchain/gcc
    #INC_PATHS += -I../../../../../../components/toolchain
    #INC_PATHS += -I../../../../../../components/softdevice/s110/headers
    #INC_PATHS += -I../../..
    #INC_PATHS += -I../../../../../bsp
    #INC_PATHS += -I../../../../../../components/device
    #INC_PATHS += -I../../../../../../components/drivers_nrf/hal
    
    OBJECT_DIRECTORY = _build
    LISTING_DIRECTORY = $(OBJECT_DIRECTORY)
    OUTPUT_BINARY_DIRECTORY = $(OBJECT_DIRECTORY)
    
    # Sorting removes duplicates
    BUILD_DIRECTORIES := $(sort $(OBJECT_DIRECTORY) $(OUTPUT_BINARY_DIRECTORY) $(LISTING_DIRECTORY) )
    
    #flags common to all targets
    #CFLAGS  = -DBOARD_PCA10028
    
    CFLAGS  = -DBOARD_CUSTOM
    CFLAGS += -DSOFTDEVICE_PRESENT
    CFLAGS += -DNRF51
    CFLAGS += -DS110
    CFLAGS += -DBLE_STACK_SUPPORT_REQD
    CFLAGS += -DBSP_DEFINES_ONLY
    CFLAGS += -mcpu=cortex-m0
    CFLAGS += -mthumb -mabi=aapcs --std=gnu99
    CFLAGS += -Wall -Werror -O3
    CFLAGS += -mfloat-abi=soft
    # keep every function in separate section. This will allow linker to dump unused functions
    CFLAGS += -ffunction-sections -fdata-sections -fno-strict-aliasing
    CFLAGS += -fno-builtin --short-enums
    CFLAGS += -Wno-error
    
    # keep every function in separate section. This will allow linker to dump unused functions
    LDFLAGS += -Xlinker -Map=$(LISTING_DIRECTORY)/$(OUTPUT_FILENAME).map
    LDFLAGS += -mthumb -mabi=aapcs -L $(TEMPLATE_PATH) -T$(LINKER_SCRIPT)
    LDFLAGS += -mcpu=cortex-m0
    # let linker to dump unused sections
    LDFLAGS += -Wl,--gc-sections
    # use newlib in nano version
    LDFLAGS += --specs=nano.specs -lc -lnosys
    
    # Assembler flags
    ASMFLAGS += -x assembler-with-cpp
    #ASMFLAGS += -DBOARD_PCA10028
    
    ASMFLAGS += -DBOARD_CUSTOM
    
    ASMFLAGS += -DSOFTDEVICE_PRESENT
    ASMFLAGS += -DNRF51
    ASMFLAGS += -DS110
    ASMFLAGS += -DBLE_STACK_SUPPORT_REQD
    ASMFLAGS += -DBSP_DEFINES_ONLY
    #default target - first one defined
    default: clean nrf51822_xxaa
    
    #building all targets
    all: clean
    	$(NO_ECHO)$(MAKE) -f $(MAKEFILE_NAME) -C $(MAKEFILE_DIR) -e cleanobj
    	$(NO_ECHO)$(MAKE) -f $(MAKEFILE_NAME) -C $(MAKEFILE_DIR) -e nrf51822_xxaa 
    
    #target for printing all targets
    help:
    	@echo following targets are available:
    	@echo 	nrf51822_xxaa
    
    
    C_SOURCE_FILE_NAMES = $(notdir $(C_SOURCE_FILES))
    C_PATHS = $(call remduplicates, $(dir $(C_SOURCE_FILES) ) )
    C_OBJECTS = $(addprefix $(OBJECT_DIRECTORY)/, $(C_SOURCE_FILE_NAMES:.c=.o) )
    
    ASM_SOURCE_FILE_NAMES = $(notdir $(ASM_SOURCE_FILES))
    ASM_PATHS = $(call remduplicates, $(dir $(ASM_SOURCE_FILES) ))
    ASM_OBJECTS = $(addprefix $(OBJECT_DIRECTORY)/, $(ASM_SOURCE_FILE_NAMES:.s=.o) )
    
    vpath %.c $(C_PATHS)
    vpath %.s $(ASM_PATHS)
    
    OBJECTS = $(C_OBJECTS) $(ASM_OBJECTS)
    
    nrf51822_xxaa: OUTPUT_FILENAME := nrf51822_xxaa
    nrf51822_xxaa: LINKER_SCRIPT=blinky_gcc_nrf51.ld
    nrf51822_xxaa: $(BUILD_DIRECTORIES) $(OBJECTS)
    	@echo Linking target: $(OUTPUT_FILENAME).out
    	$(NO_ECHO)$(CC) $(LDFLAGS) $(OBJECTS) $(LIBS) -o $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).out
    	$(NO_ECHO)$(MAKE) -f $(MAKEFILE_NAME) -C $(MAKEFILE_DIR) -e finalize
    
    ## Create build directories
    $(BUILD_DIRECTORIES):
    	echo $(MAKEFILE_NAME)
    	$(MK) $@
    
    # Create objects from C SRC files
    $(OBJECT_DIRECTORY)/%.o: %.c
    	@echo Compiling file: $(notdir $<)
    	$(NO_ECHO)$(CC) $(CFLAGS) $(INC_PATHS) -c -o $@ $<
    
    # Assemble files
    $(OBJECT_DIRECTORY)/%.o: %.s
    	@echo Compiling file: $(notdir $<)
    	$(NO_ECHO)$(CC) $(ASMFLAGS) $(INC_PATHS) -c -o $@ $<
    
    
    # Link
    $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).out: $(BUILD_DIRECTORIES) $(OBJECTS)
    	@echo Linking target: $(OUTPUT_FILENAME).out
    	$(NO_ECHO)$(CC) $(LDFLAGS) $(OBJECTS) $(LIBS) -o $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).out
    
    
    ## Create binary .bin file from the .out file
    $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).bin: $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).out
    	@echo Preparing: $(OUTPUT_FILENAME).bin
    	$(NO_ECHO)$(OBJCOPY) -O binary $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).out $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).bin
    
    ## Create binary .hex file from the .out file
    $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).hex: $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).out
    	@echo Preparing: $(OUTPUT_FILENAME).hex
    	$(NO_ECHO)$(OBJCOPY) -O ihex $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).out $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).hex
    
    finalize: genbin genhex echosize
    
    genbin:
    	@echo Preparing: $(OUTPUT_FILENAME).bin
    	$(NO_ECHO)$(OBJCOPY) -O binary $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).out $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).bin
    
    ## Create binary .hex file from the .out file
    genhex: 
    	@echo Preparing: $(OUTPUT_FILENAME).hex
    	$(NO_ECHO)$(OBJCOPY) -O ihex $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).out $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).hex
    
    echosize:
    	-@echo ""
    	$(NO_ECHO)$(SIZE) $(OUTPUT_BINARY_DIRECTORY)/$(OUTPUT_FILENAME).out
    	-@echo ""
    
    clean:
    	-del $(BUILD_DIRECTORIES)
    
    cleanobj:
    	-del $(BUILD_DIRECTORIES)/*.o
    
    flash: $(MAKECMDGOALS)
    	@echo Flashing: $(OUTPUT_BINARY_DIRECTORY)/$<.hex
    	nrfjprog --reset --program $(OUTPUT_BINARY_DIRECTORY)/$<.hex
    
    ## Flash softdevice
    
  • Could it be related to the '' that you are using instead of '/' ?

  • Actually putting those absolute paths in fixed the first errors that I had. I'm on a windows machine so i think that should be ok.

Related