From 23ba75c3c2ddde65dc543b52cd87b8a1433c5024 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 23 Jan 2013 19:03:26 -0800 Subject: altos/fox: Add fox1ihu bringup firmware Firmware capable of testing fox1ihu hardware Signed-off-by: Keith Packard --- src/fox1ihu/Makefile | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 src/fox1ihu/Makefile (limited to 'src/fox1ihu/Makefile') diff --git a/src/fox1ihu/Makefile b/src/fox1ihu/Makefile new file mode 100644 index 00000000..f76633aa --- /dev/null +++ b/src/fox1ihu/Makefile @@ -0,0 +1,76 @@ +# +# AltOS build +# +# + +include ../stm/Makefile.defs + +INC = \ + ao.h \ + ao_arch.h \ + ao_arch_funcs.h \ + ao_pins.h \ + ao_product.h \ + ao_task.h \ + stm32l.h \ + Makefile + +#PROFILE=ao_profile.c +#PROFILE_DEF=-DAO_PROFILE=1 + +#SAMPLE_PROFILE=ao_sample_profile.c \ +# ao_sample_profile_timer.c +#SAMPLE_PROFILE_DEF=-DHAS_SAMPLE_PROFILE=1 + +#STACK_GUARD=ao_mpu_stm.c +#STACK_GUARD_DEF=-DHAS_STACK_GUARD=1 + +ALTOS_SRC = \ + ao_interrupt.c \ + ao_product.c \ + ao_romconfig.c \ + ao_cmd.c \ + ao_task.c \ + ao_led.c \ + ao_stdio.c \ + ao_panic.c \ + ao_timer.c \ + ao_mutex.c \ + ao_dma_stm.c \ + ao_spi_stm.c \ + ao_usb_stm.c \ + ao_exti_stm.c \ + ao_adc_stm.c \ + ao_data.c + +PRODUCT=Fox1IHH-v0.1 +PRODUCT_DEF=-DFOX +IDPRODUCT=0x0024 + +CFLAGS = $(PRODUCT_DEF) $(STM_CFLAGS) $(PROFILE_DEF) $(SAMPLE_PROFILE_DEF) $(STACK_GUARD_DEF) -Os -g + +PROGNAME=fox1ihu-v0.1 +PROG=$(PROGNAME)-$(VERSION).elf + +SRC=$(ALTOS_SRC) ao_fox1ihu.c +OBJ=$(SRC:.c=.o) + +all: $(PROG) + +$(PROG): Makefile $(OBJ) altos.ld + $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(SAT_CLIB) -lgcc + +$(OBJ): $(INC) + +ao_product.h: ao-make-product.5c ../Version + $(call quiet,NICKLE,$<) $< -m altusmetrum.org -i $(IDPRODUCT) -p $(PRODUCT) -v $(VERSION) > $@ + +distclean: clean + +clean: + rm -f *.o $(PROGNAME)-*.elf + rm -f ao_product.h + +install: + +uninstall: -- cgit v1.2.3 From fbf01178e560d8a36916e295d7bdb0b0e98d2b02 Mon Sep 17 00:00:00 2001 From: Bdale Garbee Date: Wed, 23 Jan 2013 21:45:28 -0700 Subject: altos/fox: rename fox product It's Fox1IHU-v1 now --- src/fox1ihu/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/fox1ihu/Makefile') diff --git a/src/fox1ihu/Makefile b/src/fox1ihu/Makefile index f76633aa..714a308b 100644 --- a/src/fox1ihu/Makefile +++ b/src/fox1ihu/Makefile @@ -43,7 +43,7 @@ ALTOS_SRC = \ ao_adc_stm.c \ ao_data.c -PRODUCT=Fox1IHH-v0.1 +PRODUCT=Fox1IHU-v1 PRODUCT_DEF=-DFOX IDPRODUCT=0x0024 -- cgit v1.2.3 From e0c969910a516c018e64eaa73cdbe4bc2f979835 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 21 Mar 2013 09:49:15 -0700 Subject: altos/fox: Add watchdog timer Runs at 25Hz, can be enabled and disabled via the command line Signed-off-by: Keith Packard --- src/fox1ihu/Makefile | 3 ++- src/fox1ihu/ao_fox1ihu.c | 2 ++ src/fox1ihu/ao_pins.h | 6 ++++++ 3 files changed, 10 insertions(+), 1 deletion(-) (limited to 'src/fox1ihu/Makefile') diff --git a/src/fox1ihu/Makefile b/src/fox1ihu/Makefile index 714a308b..94315e79 100644 --- a/src/fox1ihu/Makefile +++ b/src/fox1ihu/Makefile @@ -41,7 +41,8 @@ ALTOS_SRC = \ ao_usb_stm.c \ ao_exti_stm.c \ ao_adc_stm.c \ - ao_data.c + ao_data.c \ + ao_watchdog.c PRODUCT=Fox1IHU-v1 PRODUCT_DEF=-DFOX diff --git a/src/fox1ihu/ao_fox1ihu.c b/src/fox1ihu/ao_fox1ihu.c index 43ae2ea8..9f7821f7 100644 --- a/src/fox1ihu/ao_fox1ihu.c +++ b/src/fox1ihu/ao_fox1ihu.c @@ -44,6 +44,8 @@ main(void) ao_usb_init(); + ao_watchdog_init(); + ao_start_scheduler(); return 0; } diff --git a/src/fox1ihu/ao_pins.h b/src/fox1ihu/ao_pins.h index 09fd5e99..e73ef63a 100644 --- a/src/fox1ihu/ao_pins.h +++ b/src/fox1ihu/ao_pins.h @@ -244,4 +244,10 @@ struct ao_adc { #define AO_ADC_SQ13 AO_ADC_TEMP #define AO_ADC_SQ13_NAME "temp" +/* Watchdog timer */ + +#define AO_WATCHDOG_INTERVAL AO_MS_TO_TICKS(40) +#define AO_WATCHDOG_PORT (&stm_gpiod) +#define AO_WATCHDOG_BIT 3 + #endif /* _AO_PINS_H_ */ -- cgit v1.2.3 From f517aa5e042af8dd7fd36be47e4b196f212e79b0 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 21 Mar 2013 10:16:35 -0700 Subject: altos/fox: Enable M25 driver for MRAM. The M25 driver can also talk to the MRAM chip, with a few adjustments Signed-off-by: Keith Packard --- src/fox1ihu/Makefile | 4 ++++ src/fox1ihu/ao_fox1ihu.c | 6 ++++-- src/fox1ihu/ao_pins.h | 7 +++++++ 3 files changed, 15 insertions(+), 2 deletions(-) (limited to 'src/fox1ihu/Makefile') diff --git a/src/fox1ihu/Makefile b/src/fox1ihu/Makefile index 94315e79..d702cca8 100644 --- a/src/fox1ihu/Makefile +++ b/src/fox1ihu/Makefile @@ -11,6 +11,8 @@ INC = \ ao_arch_funcs.h \ ao_pins.h \ ao_product.h \ + ao_watchdog.h \ + ao_storage.h \ ao_task.h \ stm32l.h \ Makefile @@ -42,6 +44,8 @@ ALTOS_SRC = \ ao_exti_stm.c \ ao_adc_stm.c \ ao_data.c \ + ao_storage.c \ + ao_m25.c \ ao_watchdog.c PRODUCT=Fox1IHU-v1 diff --git a/src/fox1ihu/ao_fox1ihu.c b/src/fox1ihu/ao_fox1ihu.c index 9f7821f7..5bbad328 100644 --- a/src/fox1ihu/ao_fox1ihu.c +++ b/src/fox1ihu/ao_fox1ihu.c @@ -17,8 +17,8 @@ #include #include -#include -#include +#include +#include int main(void) @@ -44,6 +44,8 @@ main(void) ao_usb_init(); + ao_storage_init(); + ao_watchdog_init(); ao_start_scheduler(); diff --git a/src/fox1ihu/ao_pins.h b/src/fox1ihu/ao_pins.h index e73ef63a..f901a96b 100644 --- a/src/fox1ihu/ao_pins.h +++ b/src/fox1ihu/ao_pins.h @@ -250,4 +250,11 @@ struct ao_adc { #define AO_WATCHDOG_PORT (&stm_gpiod) #define AO_WATCHDOG_BIT 3 +/* MRAM device */ + +#define M25_MAX_CHIPS 1 +#define AO_M25_SPI_CS_PORT (&stm_gpiod) +#define AO_M25_SPI_CS_MASK (1 << 0) +#define AO_M25_SPI_BUS AO_SPI_2_PB13_PB14_PB15 + #endif /* _AO_PINS_H_ */ -- cgit v1.2.3 From 4c37ccc63d37ff0a4382f6812060d3c5fd4b6cfb Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 25 Apr 2013 21:25:12 -0700 Subject: altos/fox: Add MRAM and SD card drivers Signed-off-by: Keith Packard --- src/fox1ihu/Makefile | 8 +++++++- src/fox1ihu/ao_fox1ihu.c | 3 +++ src/fox1ihu/ao_pins.h | 22 +++++++++++++++++----- 3 files changed, 27 insertions(+), 6 deletions(-) (limited to 'src/fox1ihu/Makefile') diff --git a/src/fox1ihu/Makefile b/src/fox1ihu/Makefile index d702cca8..aa5c6b4a 100644 --- a/src/fox1ihu/Makefile +++ b/src/fox1ihu/Makefile @@ -15,6 +15,9 @@ INC = \ ao_storage.h \ ao_task.h \ stm32l.h \ + ao_sdcard.h \ + ao_bufio.h \ + ao_fat.h \ Makefile #PROFILE=ao_profile.c @@ -45,7 +48,10 @@ ALTOS_SRC = \ ao_adc_stm.c \ ao_data.c \ ao_storage.c \ - ao_m25.c \ + ao_mr25.c \ + ao_sdcard.c \ + ao_bufio.c \ + ao_fat.c \ ao_watchdog.c PRODUCT=Fox1IHU-v1 diff --git a/src/fox1ihu/ao_fox1ihu.c b/src/fox1ihu/ao_fox1ihu.c index 5bbad328..2e1a2fdf 100644 --- a/src/fox1ihu/ao_fox1ihu.c +++ b/src/fox1ihu/ao_fox1ihu.c @@ -19,6 +19,7 @@ #include #include #include +#include int main(void) @@ -48,6 +49,8 @@ main(void) ao_watchdog_init(); + ao_fat_init(); + ao_start_scheduler(); return 0; } diff --git a/src/fox1ihu/ao_pins.h b/src/fox1ihu/ao_pins.h index f901a96b..028360a5 100644 --- a/src/fox1ihu/ao_pins.h +++ b/src/fox1ihu/ao_pins.h @@ -70,10 +70,13 @@ #define SPI_1_PA5_PA6_PA7 0 #define SPI_1_PB3_PB4_PB5 0 #define SPI_1_PE13_PE14_PE15 1 /* */ +#define SPI_1_OSPEEDR STM_OSPEEDR_10MHz -#define HAS_SPI_2 0 +#define HAS_SPI_2 1 #define SPI_2_PB13_PB14_PB15 1 /* */ #define SPI_2_PD1_PD3_PD4 0 +#define SPI_2_OSPEEDR STM_OSPEEDR_10MHz +#define HAS_STORAGE_DEBUG 1 #define SPI_2_PORT (&stm_gpiob) #define SPI_2_SCK_PIN 13 @@ -252,9 +255,18 @@ struct ao_adc { /* MRAM device */ -#define M25_MAX_CHIPS 1 -#define AO_M25_SPI_CS_PORT (&stm_gpiod) -#define AO_M25_SPI_CS_MASK (1 << 0) -#define AO_M25_SPI_BUS AO_SPI_2_PB13_PB14_PB15 +#define AO_MR25_SPI_CS_PORT (&stm_gpiod) +#define AO_MR25_SPI_CS_PIN 0 +#define AO_MR25_SPI_BUS AO_SPI_2_PB13_PB14_PB15 + +/* SD card */ + +#define AO_SDCARD_SPI_CS_PORT (&stm_gpiod) +#define AO_SDCARD_SPI_CS_PIN 1 +#define AO_SDCARD_SPI_BUS AO_SPI_2_PB13_PB14_PB15 +#define AO_SDCARD_SPI_PORT (&stm_gpiob) +#define AO_SDCARD_SPI_SCK_PIN 13 +#define AO_SDCARD_SPI_MISO_PIN 14 +#define AO_SDCARD_SPI_MOSI_PIN 15 #endif /* _AO_PINS_H_ */ -- cgit v1.2.3 From ca58096665fc1a11ca5683f0e6aafaf3e153af37 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Sun, 28 Apr 2013 00:42:31 -0700 Subject: altos/fox: update product name to show v2, enable watchdog by default Signed-off-by: Keith Packard --- src/fox1ihu/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/fox1ihu/Makefile') diff --git a/src/fox1ihu/Makefile b/src/fox1ihu/Makefile index aa5c6b4a..d80cb7af 100644 --- a/src/fox1ihu/Makefile +++ b/src/fox1ihu/Makefile @@ -54,7 +54,7 @@ ALTOS_SRC = \ ao_fat.c \ ao_watchdog.c -PRODUCT=Fox1IHU-v1 +PRODUCT=Fox1IHU-v2 PRODUCT_DEF=-DFOX IDPRODUCT=0x0024 -- cgit v1.2.3 From 54da028c492464802b048cb949d392cd83994e75 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 31 Jan 2014 17:44:45 -0800 Subject: altos/fox: Transition to current altos build environment Fix the library usage, use $(LIBS) instead of $(SAT_CLIB) -lgcc Signed-off-by: Keith Packard --- src/fox1ihu/Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/fox1ihu/Makefile') diff --git a/src/fox1ihu/Makefile b/src/fox1ihu/Makefile index d80cb7af..e3226a24 100644 --- a/src/fox1ihu/Makefile +++ b/src/fox1ihu/Makefile @@ -31,6 +31,7 @@ INC = \ #STACK_GUARD_DEF=-DHAS_STACK_GUARD=1 ALTOS_SRC = \ + ao_boot_chain.c \ ao_interrupt.c \ ao_product.c \ ao_romconfig.c \ @@ -62,14 +63,15 @@ CFLAGS = $(PRODUCT_DEF) $(STM_CFLAGS) $(PROFILE_DEF) $(SAMPLE_PROFILE_DEF) $(STA PROGNAME=fox1ihu-v0.1 PROG=$(PROGNAME)-$(VERSION).elf +HEX=$(PROGNAME)-$(VERSION).ihx SRC=$(ALTOS_SRC) ao_fox1ihu.c OBJ=$(SRC:.c=.o) -all: $(PROG) +all: $(PROG) $(HEX) $(PROG): Makefile $(OBJ) altos.ld - $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(SAT_CLIB) -lgcc + $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(LIBS) $(OBJ): $(INC) -- cgit v1.2.3