diff options
author | Gregwar <g.passault@gmail.com> | 2014-04-23 16:45:23 +0200 |
---|---|---|
committer | Gregwar <g.passault@gmail.com> | 2014-04-23 22:22:41 +0200 |
commit | 3c8ded4743c09a7b0c7737392d4e4c15e6959852 (patch) | |
tree | ad50fd91846490111cff6c04a6753d1bf0036213 | |
parent | 139e4b1a1ae547540d32aa66d47c4e69b1b57bbf (diff) | |
download | librambutan-3c8ded4743c09a7b0c7737392d4e4c15e6959852.tar.gz librambutan-3c8ded4743c09a7b0c7737392d4e4c15e6959852.zip |
Adding BOOTLOADER option to support Robotis bootloader different ROM
Signed-off-by: Grégoire Passault <g.passault@gmail.com>
-rw-r--r-- | Makefile | 6 | ||||
-rw-r--r-- | support/ld/stm32/mem/sram_20k_flash_128k_robotis/mem-flash.inc | 5 | ||||
-rw-r--r-- | support/ld/stm32/mem/sram_20k_flash_128k_robotis/mem-jtag.inc | 5 | ||||
-rw-r--r-- | support/ld/stm32/mem/sram_20k_flash_128k_robotis/mem-ram.inc | 5 | ||||
-rw-r--r-- | support/make/board-includes/cm900.mk | 5 | ||||
-rw-r--r-- | support/make/board-includes/opencm904.mk | 5 | ||||
-rw-r--r-- | wirish/boards.cpp | 4 |
7 files changed, 34 insertions, 1 deletions
@@ -32,6 +32,9 @@ BOARD_INCLUDE_DIR := $(MAKEDIR)/board-includes BOARD ?= maple MEMORY_TARGET ?= flash +# Chooses the bootloader, available: maple and robotis +BOOTLOADER ?= maple + # $(BOARD)- and $(MEMORY_TARGET)-specific configuration include $(MAKEDIR)/target-config.mk @@ -56,7 +59,8 @@ TARGET_FLAGS += -I$(LIBMAPLE_PATH)/include/libmaple \ TARGET_FLAGS += -I$(LIBRARIES_PATH) # for internal lib. includes, e.g. <Wire/WireBase.h> GLOBAL_CFLAGS := -Os -g3 -gdwarf-2 -nostdlib \ -ffunction-sections -fdata-sections \ - -Wl,--gc-sections $(TARGET_FLAGS) + -Wl,--gc-sections $(TARGET_FLAGS) \ + -DBOOTLOADER_$(BOOTLOADER) GLOBAL_CXXFLAGS := -fno-rtti -fno-exceptions -Wall $(TARGET_FLAGS) GLOBAL_ASFLAGS := -x assembler-with-cpp $(TARGET_FLAGS) LDFLAGS = $(TARGET_LDFLAGS) $(TOOLCHAIN_LDFLAGS) -mcpu=cortex-m3 -mthumb \ diff --git a/support/ld/stm32/mem/sram_20k_flash_128k_robotis/mem-flash.inc b/support/ld/stm32/mem/sram_20k_flash_128k_robotis/mem-flash.inc new file mode 100644 index 0000000..2c03ea9 --- /dev/null +++ b/support/ld/stm32/mem/sram_20k_flash_128k_robotis/mem-flash.inc @@ -0,0 +1,5 @@ +MEMORY +{ + ram (rwx) : ORIGIN = 0x20000C00, LENGTH = 17K + rom (rx) : ORIGIN = 0x08003000, LENGTH = 108K +} diff --git a/support/ld/stm32/mem/sram_20k_flash_128k_robotis/mem-jtag.inc b/support/ld/stm32/mem/sram_20k_flash_128k_robotis/mem-jtag.inc new file mode 100644 index 0000000..20fbec0 --- /dev/null +++ b/support/ld/stm32/mem/sram_20k_flash_128k_robotis/mem-jtag.inc @@ -0,0 +1,5 @@ +MEMORY +{ + ram (rwx) : ORIGIN = 0x20000000, LENGTH = 20K + rom (rx) : ORIGIN = 0x08000000, LENGTH = 128K +} diff --git a/support/ld/stm32/mem/sram_20k_flash_128k_robotis/mem-ram.inc b/support/ld/stm32/mem/sram_20k_flash_128k_robotis/mem-ram.inc new file mode 100644 index 0000000..f02453b --- /dev/null +++ b/support/ld/stm32/mem/sram_20k_flash_128k_robotis/mem-ram.inc @@ -0,0 +1,5 @@ +MEMORY +{ + ram (rwx) : ORIGIN = 0x20000C00, LENGTH = 17K + rom (rx) : ORIGIN = 0x08005000, LENGTH = 0K +} diff --git a/support/make/board-includes/cm900.mk b/support/make/board-includes/cm900.mk index f9a09ac..9f70a1b 100644 --- a/support/make/board-includes/cm900.mk +++ b/support/make/board-includes/cm900.mk @@ -7,4 +7,9 @@ MCU_F1_LINE := performance # This crap is due to ld-script limitations. If you know of a better # way to go about this (like some magic ld switches to specify MEMORY # at the command line), please tell us! +ifeq ($(BOOTLOADER),maple) LD_MEM_DIR := sram_20k_flash_128k +endif +ifeq ($(BOOTLOADER),robotis) +LD_MEM_DIR := sram_20k_flash_128k_robotis +endif diff --git a/support/make/board-includes/opencm904.mk b/support/make/board-includes/opencm904.mk index f3a4aa7..64d3351 100644 --- a/support/make/board-includes/opencm904.mk +++ b/support/make/board-includes/opencm904.mk @@ -7,4 +7,9 @@ MCU_F1_LINE := performance # This crap is due to ld-script limitations. If you know of a better # way to go about this (like some magic ld switches to specify MEMORY # at the command line), please tell us! +ifeq ($(BOOTLOADER),maple) LD_MEM_DIR := sram_20k_flash_128k +endif +ifeq ($(BOOTLOADER),robotis) +LD_MEM_DIR := sram_20k_flash_128k_robotis +endif diff --git a/wirish/boards.cpp b/wirish/boards.cpp index a693fa6..77a05de 100644 --- a/wirish/boards.cpp +++ b/wirish/boards.cpp @@ -144,7 +144,11 @@ static void setup_clocks(void) { * present. If no bootloader is present, the user NVIC usually starts * at the Flash base address, 0x08000000. */ +#if defined(BOOTLOADER_maple) #define USER_ADDR_ROM 0x08005000 +#elif defined(BOOTLOADER_robotis) +#define USER_ADDR_ROM 0x08003000 +#endif #define USER_ADDR_RAM 0x20000C00 extern char __text_start__; |