mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-08-15 00:29:02 +00:00
Now you can build targets with or without the reserved ROM var space.
This commit is contained in:
parent
d5b20ddce5
commit
0187cfbf93
@ -11,9 +11,12 @@ include $(MC1322X)/board/Makefile.board
|
|||||||
|
|
||||||
include $(LIBMC1322X)/Makefile.lib
|
include $(LIBMC1322X)/Makefile.lib
|
||||||
|
|
||||||
|
|
||||||
CFLAGS += -I$(MC1322X)/src -I.
|
CFLAGS += -I$(MC1322X)/src -I.
|
||||||
|
|
||||||
|
ifdef USE_ROM_VARS
|
||||||
|
START = $(MC1322X)/src/start-romvars.o
|
||||||
|
endif
|
||||||
|
|
||||||
# default start and isr
|
# default start and isr
|
||||||
ifndef START
|
ifndef START
|
||||||
START = $(MC1322X)/src/start.o
|
START = $(MC1322X)/src/start.o
|
||||||
@ -43,9 +46,10 @@ sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
|
|||||||
rm -f $(@:.o=.$$$$)
|
rm -f $(@:.o=.$$$$)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
|
|
||||||
$(START): $(START:.o=.s)
|
$(START): $(START:.o=.s)
|
||||||
$(CC) $(AFLAGS) -c -o $@ $<
|
$(CC) $(AFLAGS) -c -o $@ $<
|
||||||
|
$(MC1322X)/src/start-romvars.s: $(MC1322X)/src/start.S
|
||||||
|
$(CPP) $(AFLAGS) -DUSE_ROM_VARS -o $@ $<
|
||||||
|
|
||||||
$(ISR): $(ISR:.o=.c)
|
$(ISR): $(ISR:.o=.c)
|
||||||
$(CC) $(CFLAGS) $(ARM_FLAGS) -MMD $< -c -o $@
|
$(CC) $(CFLAGS) $(ARM_FLAGS) -MMD $< -c -o $@
|
||||||
@ -67,6 +71,11 @@ $(ISR): $(ISR:.o=.c)
|
|||||||
%.dis: %.elf
|
%.dis: %.elf
|
||||||
$(OBJDUMP) -SD $< > $@
|
$(OBJDUMP) -SD $< > $@
|
||||||
|
|
||||||
|
%.s: %.S
|
||||||
|
$(CPP) $(AFLAGS) -o $@ $<
|
||||||
|
%.o: %.S
|
||||||
|
$(CC) $(AFLAGS) -MMD -c -o $@ $<
|
||||||
|
@$(FINALIZE_DEPENDENCY)
|
||||||
%.o: %.c
|
%.o: %.c
|
||||||
$(CC) $(CFLAGS) $(THUMB_FLAGS) -MMD -c -o $@ $<
|
$(CC) $(CFLAGS) $(THUMB_FLAGS) -MMD -c -o $@ $<
|
||||||
@$(FINALIZE_DEPENDENCY)
|
@$(FINALIZE_DEPENDENCY)
|
||||||
@ -108,6 +117,7 @@ endif
|
|||||||
|
|
||||||
all: $(OBJDIR)/board.h
|
all: $(OBJDIR)/board.h
|
||||||
for target in $(TARGETS); do make $$target\_$(BOARD).bin; done
|
for target in $(TARGETS); do make $$target\_$(BOARD).bin; done
|
||||||
|
for target in $(TARGETS_WITH_ROM_VARS); do make USE_ROM_VARS=1 $$target\_$(BOARD).bin; done
|
||||||
|
|
||||||
allboards:
|
allboards:
|
||||||
for board in $(BOARDS); do make BOARD=$$board all; done
|
for board in $(BOARDS); do make BOARD=$$board all; done
|
||||||
|
@ -18,7 +18,7 @@ HEAP_SIZE = 1024;
|
|||||||
PROVIDE (__executable_start = 0x00400000); . = 0x00400000;
|
PROVIDE (__executable_start = 0x00400000); . = 0x00400000;
|
||||||
.text :
|
.text :
|
||||||
{
|
{
|
||||||
*start.o (.text)
|
*start*.o (.text)
|
||||||
*(.irq)
|
*(.irq)
|
||||||
*(.text .stub .text.* .gnu.linkonce.t.*)
|
*(.text .stub .text.* .gnu.linkonce.t.*)
|
||||||
/* .gnu.warning sections are handled specially by elf32.em. */
|
/* .gnu.warning sections are handled specially by elf32.em. */
|
||||||
|
@ -86,10 +86,13 @@ _RPTV_2_START:
|
|||||||
_RPTV_3_START:
|
_RPTV_3_START:
|
||||||
bx lr /* do nothing */
|
bx lr /* do nothing */
|
||||||
|
|
||||||
|
#ifdef USE_ROM_VARS
|
||||||
.org 0x120
|
.org 0x120
|
||||||
ROM_var_start: .word 0
|
ROM_var_start: .word 0
|
||||||
.org 0x7ff
|
.org 0x7ff
|
||||||
ROM_var_end: .word 0
|
ROM_var_end: .word 0
|
||||||
|
#endif
|
||||||
|
|
||||||
.code 32
|
.code 32
|
||||||
.align
|
.align
|
||||||
_begin:
|
_begin:
|
||||||
@ -117,7 +120,9 @@ _begin:
|
|||||||
|
|
||||||
// msr cpsr_c,#(USR_MODE | I_BIT | F_BIT)
|
// msr cpsr_c,#(USR_MODE | I_BIT | F_BIT)
|
||||||
|
|
||||||
|
#ifdef USE_ROM_VARS
|
||||||
bl _rom_data_init+.-base
|
bl _rom_data_init+.-base
|
||||||
|
#endif
|
||||||
msr cpsr_c,#(SVC_MODE) // turn on interrupts --- for debug only
|
msr cpsr_c,#(SVC_MODE) // turn on interrupts --- for debug only
|
||||||
// msr cpsr_c,#(USR_MODE) // turn on interrupts --- for debug only
|
// msr cpsr_c,#(USR_MODE) // turn on interrupts --- for debug only
|
||||||
// add r1,r1,#usr_stack_size
|
// add r1,r1,#usr_stack_size
|
||||||
|
@ -6,7 +6,7 @@ MC1322X := ..
|
|||||||
COBJS := tests.o
|
COBJS := tests.o
|
||||||
|
|
||||||
# all of the target programs to build
|
# all of the target programs to build
|
||||||
TARGETS := blink-red blink-green blink-blue blink-white blink-allio \
|
TARGETS := blink-green blink-blue blink-white blink-allio \
|
||||||
uart1-loopback \
|
uart1-loopback \
|
||||||
nvm-read nvm-write romimg flasher \
|
nvm-read nvm-write romimg flasher \
|
||||||
tmr tmr-ints \
|
tmr tmr-ints \
|
||||||
@ -14,6 +14,9 @@ TARGETS := blink-red blink-green blink-blue blink-white blink-allio \
|
|||||||
rftest-rx rftest-tx \
|
rftest-rx rftest-tx \
|
||||||
printf
|
printf
|
||||||
|
|
||||||
|
# these targets are built with space reserved for variables needed by ROM services
|
||||||
|
# this space is initialized with a rom call to rom_data_init
|
||||||
|
TARGETS_WITH_ROM_VARS := blink-red
|
||||||
|
|
||||||
include $(MC1322X)/Makefile.include
|
include $(MC1322X)/Makefile.include
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user