summaryrefslogtreecommitdiff
path: root/src/stm
diff options
context:
space:
mode:
Diffstat (limited to 'src/stm')
-rw-r--r--src/stm/Makefile-flash.defs11
-rw-r--r--src/stm/Makefile.defs15
-rw-r--r--src/stm/ao_arch_funcs.h3
3 files changed, 18 insertions, 11 deletions
diff --git a/src/stm/Makefile-flash.defs b/src/stm/Makefile-flash.defs
index 86f76d46..f429d9bd 100644
--- a/src/stm/Makefile-flash.defs
+++ b/src/stm/Makefile-flash.defs
@@ -6,14 +6,15 @@ vpath ao-make-product.5c $(TOPDIR)/util
.elf.ihx:
objcopy -O ihex $*.elf $@
-CC=/opt/cortex/bin/arm-none-eabi-gcc
-SAT=/opt/cortex
-SAT_CLIB=$(SAT)/lib/pdclib-cortex-m3.a
-SAT_CFLAGS=-I$(SAT)/include
-
ifndef VERSION
include $(TOPDIR)/Version
endif
+include $(TOPDIR)/Makedefs
+
+CC=$(ARM_CC)
+SAT=/opt/cortex
+SAT_CLIB=$(SAT)/lib/pdclib-cortex-m3.a
+SAT_CFLAGS=-I$(SAT)/include
AO_CFLAGS=-I. -I$(TOPDIR)/stm -I$(TOPDIR)/core -I$(TOPDIR)/drivers -I$(TOPDIR)/product -I$(TOPDIR)
STM_CFLAGS=-std=gnu99 -mlittle-endian -mcpu=cortex-m3 -mthumb -ffreestanding -nostdlib $(AO_CFLAGS) $(SAT_CFLAGS)
diff --git a/src/stm/Makefile.defs b/src/stm/Makefile.defs
index 8ef30521..ede75f80 100644
--- a/src/stm/Makefile.defs
+++ b/src/stm/Makefile.defs
@@ -12,14 +12,19 @@ vpath ao-make-product.5c ../util
.elf.ihx:
objcopy -O ihex $*.elf $@
-SAT=/opt/cortex
-CC=$(SAT)/bin/arm-none-eabi-gcc
-SAT_CLIB=$(SAT)/lib/pdclib-cortex-m3.a
-SAT_CFLAGS=-I$(SAT)/include
+ifndef TOPDIR
+TOPDIR=..
+endif
ifndef VERSION
-include ../Version
+include $(TOPDIR)/Version
endif
+include $(TOPDIR)/Makedefs
+
+CC=$(ARM_CC)
+SAT=/opt/cortex
+SAT_CLIB=$(SAT)/lib/pdclib-cortex-m3.a
+SAT_CFLAGS=-I$(SAT)/include
AO_CFLAGS=-I. -I../stm -I../core -I../drivers -I..
STM_CFLAGS=-std=gnu99 -mlittle-endian -mcpu=cortex-m3 -mthumb -ffreestanding -nostdlib $(AO_CFLAGS) $(SAT_CFLAGS)
diff --git a/src/stm/ao_arch_funcs.h b/src/stm/ao_arch_funcs.h
index 9bb2d7cd..b461cd3f 100644
--- a/src/stm/ao_arch_funcs.h
+++ b/src/stm/ao_arch_funcs.h
@@ -329,7 +329,7 @@ static inline void ao_arch_restore_stack(void) {
/* Restore APSR */
asm("pop {r0}");
- asm("msr apsr,r0");
+ asm("msr apsr_nczvq,r0");
/* Restore general registers */
asm("pop {r0-r12,lr}\n");
@@ -354,6 +354,7 @@ static inline void ao_arch_start_scheduler(void) {
asm("mrs %0,control" : "=&r" (control));
control |= (1 << 1);
asm("msr control,%0" : : "r" (control));
+ asm("isb");
}
#endif