Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[nrf51822][gcc_arm]: fix makefile templates and nrf_svc.h's 'impossible constraint in asm' error #468

Merged
merged 2 commits into from
Sep 5, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
{ \
__asm( \
"svc %0\n" \
"bx r14" : : "I" (number) : "r0" \
"bx r14" : : "I" ((uint32_t)number) : "r0" \
); \
}
#elif defined (__ICCARM__)
Expand Down
8 changes: 4 additions & 4 deletions workspace_tools/export/gcc_arm_arch_ble.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ INCLUDE_PATHS = {% for p in include_paths %}-I{{p}} {% endfor %}
LIBRARY_PATHS = {% for p in library_paths %}-L{{p}} {% endfor %}
LIBRARIES = {% for lib in libraries %}-l{{lib}} {% endfor %}
LINKER_SCRIPT = {{linker_script}}
SOFTDEVICE = mbed/TARGET_NRF51822/TARGET_NORDIC/TARGET_NRF51822/Lib/s110_nrf51822_6_0_0/s110_nrf51822_6.0.0_softdevice.hex
SOFTDEVICE = mbed/TARGET_ARCH_BLE/TARGET_NORDIC/TARGET_MCU_NRF51822/Lib/s110_nrf51822_7_0_0/s110_nrf51822_7.0.0_softdevice.hex

###############################################################################
AS = $(GCC_BIN)arm-none-eabi-as
Expand All @@ -23,7 +23,7 @@ CPU = -mcpu=cortex-m0 -mthumb
CC_FLAGS = $(CPU) -c -g -fno-common -fmessage-length=0 -Wall -fno-exceptions -ffunction-sections -fdata-sections
CC_SYMBOLS = {% for s in symbols %}-D{{s}} {% endfor %}

LD_FLAGS = -mcpu=cortex-m0 -mthumb -Wl,--gc-sections --specs=nano.specs -u _printf_float -u _scanf_float
LD_FLAGS = -mcpu=cortex-m0 -mthumb -Wl,--gc-sections -Wl,--wrap=main --specs=nano.specs -u _printf_float -u _scanf_float
LD_SYS_LIBS = -lstdc++ -lsupc++ -lm -lc -lgcc -lnosys

ifeq ($(DEBUG), 1)
Expand All @@ -32,7 +32,7 @@ else
CC_FLAGS += -DNDEBUG -Os
endif

all: $(PROJECT).hex merge
all: $(PROJECT).hex

clean:
rm -f $(PROJECT).hex $(PROJECT).elf $(OBJECTS)
Expand All @@ -54,4 +54,4 @@ $(PROJECT).hex: $(PROJECT).elf
$(OBJCOPY) -O ihex $< $@

merge:
$(SREC_CAT) $(SOFTDEVICE) -intel $(PROJECT).hex -binary --offset 0x14000 -o combined.hex -intel --line-length=46
$(SREC_CAT) $(SOFTDEVICE) -intel $(PROJECT).hex -intel -o combined.hex -intel --line-length=44
6 changes: 3 additions & 3 deletions workspace_tools/export/gcc_arm_nrf51822.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ INCLUDE_PATHS = {% for p in include_paths %}-I{{p}} {% endfor %}
LIBRARY_PATHS = {% for p in library_paths %}-L{{p}} {% endfor %}
LIBRARIES = {% for lib in libraries %}-l{{lib}} {% endfor %}
LINKER_SCRIPT = {{linker_script}}
SOFTDEVICE = mbed/TARGET_NRF51822/TARGET_NORDIC/TARGET_NRF51822/Lib/s110_nrf51822_7_0_0/s110_nrf51822_7.0.0_softdevice.hex
SOFTDEVICE = mbed/TARGET_NRF51822/TARGET_NORDIC/TARGET_MCU_NRF51822/Lib/s110_nrf51822_7_0_0/s110_nrf51822_7.0.0_softdevice.hex

###############################################################################
AS = $(GCC_BIN)arm-none-eabi-as
Expand All @@ -32,7 +32,7 @@ else
CC_FLAGS += -DNDEBUG -Os
endif

all: $(PROJECT).hex merge
all: $(PROJECT).hex

clean:
rm -f $(PROJECT).hex $(PROJECT).elf $(OBJECTS)
Expand All @@ -54,4 +54,4 @@ $(PROJECT).hex: $(PROJECT).elf
$(OBJCOPY) -O ihex $< $@

merge:
$(SREC_CAT) $(SOFTDEVICE) -intel $(PROJECT).hex -intel --offset 0x16000 -o combined.hex -intel --line-length=46
$(SREC_CAT) $(SOFTDEVICE) -intel $(PROJECT).hex -intel -o combined.hex -intel --line-length=44
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, why did you change the line length?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be consistent with the length of uvision's hex file