aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@leaflabs.com>2012-07-31 17:25:34 -0400
committerMarti Bolivar <mbolivar@leaflabs.com>2012-07-31 17:27:43 -0400
commitee40d089a0dd41197535f8b1d46fb7a8a0ea24ee (patch)
tree78be84fbfc63ff1432faa6fc2eef1f028c319890
parentd0fc50d44d664329f6336b4bef9c9e62a12768be (diff)
downloadlibrambutan-ee40d089a0dd41197535f8b1d46fb7a8a0ea24ee.tar.gz
librambutan-ee40d089a0dd41197535f8b1d46fb7a8a0ea24ee.zip
Move bootloader details out of libmaple.h.
Finally! Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
-rw-r--r--libmaple/include/libmaple/libmaple.h8
-rw-r--r--wirish/boards.cpp12
2 files changed, 12 insertions, 8 deletions
diff --git a/libmaple/include/libmaple/libmaple.h b/libmaple/include/libmaple/libmaple.h
index 5abcaf9..c9034d7 100644
--- a/libmaple/include/libmaple/libmaple.h
+++ b/libmaple/include/libmaple/libmaple.h
@@ -41,14 +41,6 @@ extern "C" {
#include <libmaple/util.h>
#include <libmaple/delay.h>
-/*
- * Where to put usercode, based on space reserved for bootloader.
- *
- * FIXME this has no business being here
- */
-#define USER_ADDR_ROM 0x08005000
-#define USER_ADDR_RAM 0x20000C00
-
#ifdef __cplusplus
}
#endif
diff --git a/wirish/boards.cpp b/wirish/boards.cpp
index 5771df5..dbc308e 100644
--- a/wirish/boards.cpp
+++ b/wirish/boards.cpp
@@ -139,6 +139,18 @@ static void setup_clocks(void) {
rcc_switch_sysclk(RCC_CLKSRC_PLL);
}
+/*
+ * These addresses are where usercode starts when a bootloader is
+ * present. If no bootloader is present, the user NVIC usually starts
+ * at the Flash base address, 0x08000000.
+ *
+ * FIXME Let the build specify the vector table address numerically to
+ * avoid having these magic values -- some people have been fixing up
+ * the bootloader so it uses less space.
+ */
+#define USER_ADDR_ROM 0x08005000
+#define USER_ADDR_RAM 0x20000C00
+
static void setup_nvic(void) {
#ifdef VECT_TAB_FLASH
nvic_init(USER_ADDR_ROM, 0);