telescience-v0.1 telescience-pwm telepyro-v0.1 micropeak
ARMDIRS=\
- telemega-v0.1 telemega-v0.3 megadongle-v0.1 stm-bringup stm-demo telelco-v0.1 \
+ telemega-v0.1 telemega-v0.1/flash-loader \
+ telemega-v0.3 telemega-v0.3/flash-loader \
+ megadongle-v0.1 megadongle-v0.1/flash-loader \
+ telegps-v0.1 telegps-v0.1/flash-loader \
+ stm-bringup stm-demo telelco-v0.1 \
telescience-v0.2
ifneq ($(shell which sdcc),)
--- /dev/null
+#
+# AltOS flash loader build
+#
+
+TOPDIR=../..
+HARDWARE=megadongle-v0.1
+include $(TOPDIR)/stm/Makefile-flash.defs
--- /dev/null
+/*
+ * Copyright © 2013 Keith Packard <keithp@keithp.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ */
+
+#ifndef _AO_PINS_H_
+#define _AO_PINS_H_
+
+/* External crystal at 8MHz */
+#define AO_HSE 8000000
+
+#include <ao_flash_stm_pins.h>
+
+/* Companion port cs_companion0 PD0 */
+
+#define AO_BOOT_PIN 1
+#define AO_BOOT_APPLICATION_GPIO stm_gpiod
+#define AO_BOOT_APPLICATION_PIN 0
+#define AO_BOOT_APPLICATION_VALUE 1
+#define AO_BOOT_APPLICATION_MODE AO_EXTI_MODE_PULL_UP
+
+#endif /* _AO_PINS_H_ */
--- /dev/null
+/*
+ * Copyright © 2013 Keith Packard <keithp@keithp.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ */
+
+#ifndef _AO_FLASH_PINS_H_
+#define _AO_FLASH_PINS_H_
+
+/* Common definitions for the USB flash loader */
+
+#define HAS_TASK_QUEUE 0
+
+#define HAS_USB 1
+#define USE_USB_STDIO 0
+#define HAS_BEEP 0
+#define HAS_TASK 0
+#define HAS_ECHO 0
+#define HAS_TICK 0
+
+#define PACKET_HAS_SLAVE 0
+
+#define HAS_TASK_INFO 0
+#define HAS_VERSION 0
+
+#define AO_BOOT_CHAIN 1
+#define AO_BOOT_PIN 1
+
+#endif /* _AO_FLASH_PINS_H_ */
--- /dev/null
+/*
+ * Copyright © 2013 Keith Packard <keithp@keithp.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ */
+
+#include "ao.h"
+#include <ao_exti.h>
+#include <ao_boot.h>
+#include <ao_flash.h>
+#include <ao_flash_task.h>
+
+void
+ao_panic(uint8_t reason)
+{
+}
+
+void
+ao_put_string(__code char *s)
+{
+ char c;
+ while ((c = *s++)) {
+ if (c == '\n')
+ ao_usb_putchar('\r');
+ ao_usb_putchar(c);
+ }
+}
+
+static void
+ao_application(void)
+{
+ ao_boot_reboot(AO_BOOT_APPLICATION_BASE);
+}
+
+static uint32_t
+ao_get_hex32(void)
+{
+ int8_t n;
+ uint32_t v = 0;
+
+ for (;;) {
+ n = ao_usb_getchar();
+ if (n != ' ')
+ break;
+ }
+ for(;;) {
+ if ('0' <= n && n <= '9')
+ n = n - '0';
+ else if ('a' <= n && n <= 'f')
+ n = n - ('a' - 10);
+ else if ('A' <= n && n <= 'F')
+ n = n - ('A' - 10);
+ else
+ break;
+ v = (v << 4) | n;
+ n = ao_usb_getchar();
+ }
+ return v;
+}
+
+static void
+ao_block_erase(void)
+{
+ uint32_t addr = ao_get_hex32();
+ uint32_t *p = (uint32_t *) addr;
+
+ ao_flash_erase_page(p);
+}
+
+static void
+ao_block_write(void)
+{
+ uint32_t addr = ao_get_hex32();
+ uint32_t *p = (uint32_t *) addr;
+ union {
+ uint8_t data8[256];
+ uint32_t data32[64];
+ } u;
+ uint16_t i;
+
+ if (addr < (uint32_t) AO_BOOT_APPLICATION_BASE) {
+ ao_put_string("Invalid address\n");
+ return;
+ }
+ for (i = 0; i < 256; i++)
+ u.data8[i] = ao_usb_getchar();
+ ao_flash_page(p, u.data32);
+}
+
+static void
+ao_block_read(void)
+{
+ uint32_t addr = ao_get_hex32();
+ uint8_t *p = (uint8_t *) addr;
+ uint16_t i;
+ uint8_t c;
+
+ for (i = 0; i < 256; i++) {
+ c = *p++;
+ ao_usb_putchar(c);
+ }
+}
+
+static void
+ao_show_version(void)
+{
+ ao_put_string("altos-loader");
+ ao_put_string("\nmanufacturer "); ao_put_string(ao_manufacturer);
+ ao_put_string("\nproduct "); ao_put_string(ao_product);
+ ao_put_string("\nsoftware-version "); ao_put_string(ao_version);
+ ao_put_string("\n");
+}
+
+void
+ao_flash_task(void) {
+ for (;;) {
+ ao_usb_flush();
+ switch (ao_usb_getchar()) {
+ case 'v': ao_show_version(); break;
+ case 'a': ao_application(); break;
+ case 'X': ao_block_erase(); break;
+ case 'W': ao_block_write(); break;
+ case 'R': ao_block_read(); break;
+ }
+ }
+}
--- /dev/null
+/*
+ * Copyright © 2013 Keith Packard <keithp@keithp.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ */
+
+#ifndef _AO_FLASH_TASK_H_
+#define _AO_FLASH_TASK_H_
+
+void
+ao_flash_task(void);
+
+#endif /* _AO_FLASH_TASK_H_ */
+++ /dev/null
-/*
- * Copyright © 2011 Keith Packard <keithp@keithp.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
- */
-
-#include "ao.h"
-#include <ao_exti.h>
-#include <ao_boot.h>
-#include <ao_flash_stm.h>
-
-void
-ao_panic(uint8_t reason)
-{
- for (;;);
-}
-
-void
-ao_put_string(__code char *s)
-{
- char c;
- while ((c = *s++)) {
- if (c == '\n')
- ao_usb_putchar('\r');
- ao_usb_putchar(c);
- }
-}
-
-void
-ao_application(void)
-{
- ao_boot_reboot(AO_BOOT_APPLICATION_BASE);
-}
-
-static uint32_t
-ao_get_hex32(void)
-{
- int8_t n;
- uint32_t v = 0;
-
- for (;;) {
- n = ao_usb_getchar();
- if (n != ' ')
- break;
- }
- for(;;) {
- if ('0' <= n && n <= '9')
- n = n - '0';
- else if ('a' <= n && n <= 'f')
- n = n - ('a' - 10);
- else if ('A' <= n && n <= 'F')
- n = n - ('A' - 10);
- else
- break;
- v = (v << 4) | n;
- n = ao_usb_getchar();
- }
- return v;
-}
-
-void
-ao_block_erase(void)
-{
- uint32_t addr = ao_get_hex32();
- uint32_t *p = (uint32_t *) addr;
-
- ao_flash_erase_page(p);
-}
-
-void
-ao_block_write(void)
-{
- uint32_t addr = ao_get_hex32();
- uint32_t *p = (uint32_t *) addr;
- union {
- uint8_t data8[256];
- uint32_t data32[64];
- } u;
- uint16_t i;
-
- if (addr < (uint32_t) AO_BOOT_APPLICATION_BASE) {
- ao_put_string("Invalid address\n");
- return;
- }
- for (i = 0; i < 256; i++)
- u.data8[i] = ao_usb_getchar();
- ao_flash_page(p, u.data32);
-}
-
-void
-ao_block_read(void)
-{
- uint32_t addr = ao_get_hex32();
- uint8_t *p = (uint8_t *) addr;
- uint16_t i;
- uint8_t c;
-
- for (i = 0; i < 256; i++) {
- c = *p++;
- ao_usb_putchar(c);
- }
-}
-
-static void
-ao_show_version(void)
-{
- ao_put_string("altos-loader");
- ao_put_string("\nmanufacturer "); ao_put_string(ao_manufacturer);
- ao_put_string("\nproduct "); ao_put_string(ao_product);
- ao_put_string("\nsoftware-version "); ao_put_string(ao_version);
- ao_put_string("\n");
-}
-
-static void
-ao_flash_task(void) {
- for (;;) {
- ao_usb_flush();
- switch (ao_usb_getchar()) {
- case 'v': ao_show_version(); break;
- case 'a': ao_application(); break;
- case 'X': ao_block_erase(); break;
- case 'W': ao_block_write(); break;
- case 'R': ao_block_read(); break;
- }
- }
-}
-
-int
-main(void)
-{
- ao_clock_init();
-
-// ao_timer_init();
-// ao_dma_init();
-// ao_exti_init();
- ao_usb_init();
-
- ao_flash_task();
- return 0;
-}
--- /dev/null
+vpath % $(TOPDIR)/stm:$(TOPDIR)/product:$(TOPDIR)/drivers:$(TOPDIR)/core:$(TOPDIR)/util:$(TOPDIR)
+vpath ao-make-product.5c $(TOPDIR)/util
+
+.SUFFIXES: .elf .ihx
+
+.elf.ihx:
+ objcopy -O ihex $*.elf $@
+
+CC=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
+
+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)
+
+LDFLAGS=-L$(TOPDIR)/stm -Wl,-Taltos-loader.ld
+
+NICKLE=nickle
+
+V=0
+# The user has explicitly enabled quiet compilation.
+ifeq ($(V),0)
+quiet = @printf " $1 $2 $@\n"; $($1)
+endif
+# Otherwise, print the full command line.
+quiet ?= $($1)
+
+.c.o:
+ $(call quiet,CC) -c $(CFLAGS) -o $@ $<
+
+INC = \
+ ao.h \
+ ao_arch.h \
+ ao_arch_funcs.h \
+ ao_flash_pins.h \
+ ao_flash_stm_pins.h \
+ ao_flash_task.h \
+ ao_pins.h \
+ ao_product.h \
+ Makefile
+
+#
+# Common AltOS sources
+#
+SRC = \
+ ao_interrupt.c \
+ ao_romconfig.c \
+ ao_boot_chain.c \
+ ao_boot_pin.c \
+ ao_product.c \
+ ao_notask.c \
+ ao_timer.c \
+ ao_usb_stm.c \
+ ao_flash_stm.c \
+ ao_flash_task.c \
+ ao_flash_loader_stm.c
+
+OBJ=$(SRC:.c=.o)
+
+PRODUCT=AltosFlash-$(VERSION)
+PRODUCT_DEF=-DALTOS_FLASH
+IDPRODUCT=0x000a
+
+CFLAGS = $(PRODUCT_DEF) $(STM_CFLAGS) -g -Os
+
+PROGNAME=altos-flash
+PROG=$(HARDWARE)-$(PROGNAME)-$(VERSION).elf
+
+$(PROG): Makefile $(OBJ) altos-loader.ld
+ $(call quiet,CC) $(LDFLAGS) $(CFLAGS) -o $(PROG) $(OBJ) $(SAT_CLIB) -lgcc
+
+ao_product.h: ao-make-product.5c $(TOPDIR)/Version
+ $(call quiet,NICKLE,$<) $< -m altusmetrum.org -i $(IDPRODUCT) -p $(PRODUCT) -v $(VERSION) > $@
+
+$(OBJ): $(INC)
+
+all: $(PROG)
+
+distclean: clean
+
+clean:
+ rm -f *.o $(PROG)
+ rm -f ao_product.h
+
+install:
+
+uninstall:
.text : {
__text_start__ = .;
*(.interrupt) /* Interrupt vectors */
- *(.romconfig*)
- *(.text) /* Executable code */
- . = ALIGN(4);
- *(.rodata*) /* Constants */
- . = ALIGN(4);
- } > rom
- .ARM.exidx : {
- . = ALIGN(4);
+ . = ORIGIN(rom) + 0x100;
+
+ ao_romconfig.o(.romconfig*)
+ ao_product.o(.romconfig*)
+ *(.text) /* Executable code */
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
- . = ALIGN(4);
+ *(.rodata*) /* Constants */
+ __text_end__ = .;
} > rom
- __text_end__ = .;
/* Boot data which must live at the start of ram so that
* the application and bootloader share the same addresses.
.boot (NOLOAD) : {
__boot_start__ = .;
*(.boot)
- . = ALIGN(4);
__boot_end__ = .;
} >ram
- /* Functions placed in RAM (required for flashing) */
- .textram : {
+ /* Functions placed in RAM (required for flashing)
+ *
+ * Align to 8 bytes as that's what the ARM likes text
+ * segment alignments to be, and if we don't, then
+ * we end up with a mismatch between the location in
+ * ROM and the desired location in RAM. I don't
+ * entirely understand this, but at least this appears
+ * to work...
+ */
+
+ .textram BLOCK(8): {
__data_start__ = .;
__text_ram_start__ = .;
*(.text.ram)
* For now, we're running at a weird frequency
*/
+#ifndef AO_HSE
+#error High speed frequency undefined
+#endif
+
#if AO_HSE
#define AO_PLLSRC AO_HSE
#else
--- /dev/null
+/*
+ * Copyright © 2013 Keith Packard <keithp@keithp.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ */
+
+#ifndef _AO_FLASH_STM_H_
+#define _AO_FLASH_STM_H_
+
+void
+ao_flash_erase_page(uint32_t *page);
+
+void
+ao_flash_page(uint32_t *page, uint32_t *src);
+
+#endif /* _AO_FLASH_STM_H_ */
--- /dev/null
+/*
+ * Copyright © 2013 Keith Packard <keithp@keithp.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ */
+
+#include "ao.h"
+#include <ao_exti.h>
+#include <ao_boot.h>
+#include <ao_flash_task.h>
+
+int
+main(void)
+{
+ ao_clock_init();
+
+ ao_usb_init();
+
+ ao_flash_task();
+ return 0;
+}
*/
#include <ao.h>
-#include <ao_flash_stm.h>
+#include <ao_flash.h>
static uint8_t
ao_flash_pecr_is_locked(void)
+++ /dev/null
-/*
- * Copyright © 2013 Keith Packard <keithp@keithp.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
- */
-
-#ifndef _AO_FLASH_STM_H_
-#define _AO_FLASH_STM_H_
-
-void
-ao_flash_erase_page(uint32_t *page);
-
-void
-ao_flash_page(uint32_t *page, uint32_t *src);
-
-#endif /* _AO_FLASH_STM_H_ */
--- /dev/null
+/*
+ * Copyright © 2013 Keith Packard <keithp@keithp.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ */
+
+#ifndef _AO_FLASH_STM_PINS_H_
+#define _AO_FLASH_STM_PINS_H_
+
+#include <ao_flash_pins.h>
+
+/* PLLVCO = 96MHz (so that USB will work) */
+#define AO_PLLMUL 12
+#define AO_RCC_CFGR_PLLMUL (STM_RCC_CFGR_PLLMUL_12)
+
+/* SYSCLK = 32MHz */
+#define AO_PLLDIV 3
+#define AO_RCC_CFGR_PLLDIV (STM_RCC_CFGR_PLLDIV_3)
+
+/* HCLK = 32MHZ (CPU clock) */
+#define AO_AHB_PRESCALER 1
+#define AO_RCC_CFGR_HPRE_DIV STM_RCC_CFGR_HPRE_DIV_1
+
+/* Run APB1 at HCLK/1 */
+#define AO_APB1_PRESCALER 1
+#define AO_RCC_CFGR_PPRE1_DIV STM_RCC_CFGR_PPRE2_DIV_1
+
+/* Run APB2 at HCLK/1 */
+#define AO_APB2_PRESCALER 1
+#define AO_RCC_CFGR_PPRE2_DIV STM_RCC_CFGR_PPRE2_DIV_1
+
+#endif /* _AO_FLASH_STM_PINS_H_ */
--- /dev/null
+#
+# AltOS flash loader build
+#
+#
+
+TOPDIR=../..
+HARDWARE=telegps-v0.1
+include $(TOPDIR)/stm/Makefile-flash.defs
--- /dev/null
+/*
+ * Copyright © 2013 Keith Packard <keithp@keithp.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ */
+
+#ifndef _AO_PINS_H_
+#define _AO_PINS_H_
+
+/* External crystal at 8MHz */
+#define AO_HSE 8000000
+
+#include <ao_flash_stm_pins.h>
+
+/* Telemetry TX pin PB6 */
+
+#define AO_BOOT_PIN 1
+#define AO_BOOT_APPLICATION_GPIO stm_gpiob
+#define AO_BOOT_APPLICATION_PIN 6
+#define AO_BOOT_APPLICATION_VALUE 1
+#define AO_BOOT_APPLICATION_MODE AO_EXTI_MODE_PULL_UP
+
+#endif /* _AO_PINS_H_ */
--- /dev/null
+#
+# AltOS flash loader build
+#
+
+TOPDIR=../..
+HARDWARE=telemega-v0.1
+include $(TOPDIR)/stm/Makefile-flash.defs
--- /dev/null
+/*
+ * Copyright © 2013 Keith Packard <keithp@keithp.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ */
+
+#ifndef _AO_PINS_H_
+#define _AO_PINS_H_
+
+/* External crystal at 8MHz */
+#define AO_HSE 8000000
+
+#include <ao_flash_stm_pins.h>
+
+/* Companion port cs_companion0 PD0 */
+
+#define AO_BOOT_PIN 1
+#define AO_BOOT_APPLICATION_GPIO stm_gpiod
+#define AO_BOOT_APPLICATION_PIN 0
+#define AO_BOOT_APPLICATION_VALUE 1
+#define AO_BOOT_APPLICATION_MODE AO_EXTI_MODE_PULL_UP
+
+#endif /* _AO_PINS_H_ */
--- /dev/null
+#
+# AltOS flash loader build
+#
+#
+
+TOPDIR=../..
+HARDWARE=telemega-v0.3
+include $(TOPDIR)/stm/Makefile-flash.defs
--- /dev/null
+/*
+ * Copyright © 2013 Keith Packard <keithp@keithp.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ */
+
+#ifndef _AO_PINS_H_
+#define _AO_PINS_H_
+
+/* External crystal at 8MHz */
+#define AO_HSE 8000000
+
+#include <ao_flash_stm_pins.h>
+
+/* Companion port cs_companion0 PD0 */
+
+#define AO_BOOT_PIN 1
+#define AO_BOOT_APPLICATION_GPIO stm_gpiod
+#define AO_BOOT_APPLICATION_PIN 0
+#define AO_BOOT_APPLICATION_VALUE 1
+#define AO_BOOT_APPLICATION_MODE AO_EXTI_MODE_PULL_UP
+
+#endif /* _AO_PINS_H_ */