1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-31 16:52:10 +01:00

Merge remote-tracking branch 'revo/stac/openocd' into revolution

This commit is contained in:
James Cotton 2012-03-03 11:52:09 -06:00
commit b3f620af7c
14 changed files with 178 additions and 72 deletions

127
Makefile
View File

@ -200,7 +200,9 @@ arm_sdk_clean:
$(V1) [ ! -d "$(ARM_SDK_DIR)" ] || $(RM) -r $(ARM_SDK_DIR) $(V1) [ ! -d "$(ARM_SDK_DIR)" ] || $(RM) -r $(ARM_SDK_DIR)
# Set up openocd tools # Set up openocd tools
OPENOCD_DIR := $(TOOLS_DIR)/openocd OPENOCD_DIR := $(TOOLS_DIR)/openocd
OPENOCD_WIN_DIR := $(TOOLS_DIR)/openocd_win
OPENOCD_BUILD_DIR := $(DL_DIR)/openocd-build
.PHONY: openocd_install .PHONY: openocd_install
openocd_install: | $(DL_DIR) $(TOOLS_DIR) openocd_install: | $(DL_DIR) $(TOOLS_DIR)
@ -211,42 +213,139 @@ openocd_install: openocd_clean
$(V1) wget -N -P "$(DL_DIR)" --trust-server-name "$(OPENOCD_URL)" $(V1) wget -N -P "$(DL_DIR)" --trust-server-name "$(OPENOCD_URL)"
# extract the source # extract the source
$(V1) [ ! -d "$(DL_DIR)/openocd-build" ] || $(RM) -r "$(DL_DIR)/openocd-build" $(V1) [ ! -d "$(OPENOCD_BUILD_DIR)" ] || $(RM) -r "$(OPENOCD_BUILD_DIR)"
$(V1) mkdir -p "$(DL_DIR)/openocd-build" $(V1) mkdir -p "$(OPENOCD_BUILD_DIR)"
$(V1) tar -C $(DL_DIR)/openocd-build -xjf "$(DL_DIR)/$(OPENOCD_FILE)" $(V1) tar -C $(OPENOCD_BUILD_DIR) -xjf "$(DL_DIR)/$(OPENOCD_FILE)"
# build and install # build and install
$(V1) mkdir -p "$(OPENOCD_DIR)" $(V1) mkdir -p "$(OPENOCD_DIR)"
$(V1) ( \ $(V1) ( \
cd $(DL_DIR)/openocd-build/openocd-0.5.0 ; \ cd $(OPENOCD_BUILD_DIR)/openocd-0.5.0 ; \
./configure --prefix="$(OPENOCD_DIR)" --enable-ft2232_libftdi --enable-buspirate; \ ./configure --prefix="$(OPENOCD_DIR)" --enable-ft2232_libftdi --enable-buspirate; \
$(MAKE) --silent ; \ $(MAKE) --silent ; \
$(MAKE) --silent install ; \ $(MAKE) --silent install ; \
) )
# delete the extracted source when we're done # delete the extracted source when we're done
$(V1) [ ! -d "$(DL_DIR)/openocd-build" ] || $(RM) -rf "$(DL_DIR)/openocd-build" $(V1) [ ! -d "$(OPENOCD_BUILD_DIR)" ] || $(RM) -rf "$(OPENOCD_BUILD_DIR)"
.PHONY: ftd2xx_install
FTD2XX_DIR := $(DL_DIR)/ftd2xx
ftd2xx_install: | $(DL_DIR)
ftd2xx_install: FTD2XX_URL := http://www.ftdichip.com/Drivers/CDM/Beta/CDM20817.zip
ftd2xx_install: FTD2XX_FILE := CDM20817.zip
ftd2xx_install: ftd2xx_clean
# download the file only if it's newer than what we already have
$(V0) @echo " DOWNLOAD $(FTD2XX_URL)"
$(V1) wget -q -N -P "$(DL_DIR)" "$(FTD2XX_URL)"
# extract the source
$(V0) @echo " EXTRACT $(FTD2XX_FILE) -> $(FTD2XX_DIR)"
$(V1) mkdir -p "$(FTD2XX_DIR)"
$(V1) unzip -q -d "$(FTD2XX_DIR)" "$(DL_DIR)/$(FTD2XX_FILE)"
.PHONY: ftd2xx_clean
ftd2xx_clean:
$(V0) @echo " CLEAN $(FTD2XX_DIR)"
$(V1) [ ! -d "$(FTD2XX_DIR)" ] || $(RM) -r "$(FTD2XX_DIR)"
.PHONY: ftd2xx_install
LIBUSB_WIN_DIR := $(DL_DIR)/libusb-win32-bin-1.2.6.0
libusb_win_install: | $(DL_DIR)
libusb_win_install: LIBUSB_WIN_URL := http://sourceforge.net/projects/libusb-win32/files/libusb-win32-releases/1.2.6.0/libusb-win32-bin-1.2.6.0.zip/download
libusb_win_install: LIBUSB_WIN_FILE := libusb-win32-bin-1.2.6.0.zip
libusb_win_install: libusb_win_clean
# download the file only if it's newer than what we already have
$(V0) @echo " DOWNLOAD $(LIBUSB_WIN_URL)"
$(V1) wget -q -N -P "$(DL_DIR)" --trust-server-name "$(LIBUSB_WIN_URL)"
# extract the source
$(V0) @echo " EXTRACT $(LIBUSB_WIN_FILE) -> $(LIBUSB_WIN_DIR)"
$(V1) mkdir -p "$(LIBUSB_WIN_DIR)"
$(V1) unzip -q -d "$(DL_DIR)" "$(DL_DIR)/$(LIBUSB_WIN_FILE)"
# fixup .h file needed by openocd build
$(V0) @echo " FIXUP $(LIBUSB_WIN_DIR)"
$(V1) ln -s "$(LIBUSB_WIN_DIR)/include/lusb0_usb.h" "$(LIBUSB_WIN_DIR)/include/usb.h"
.PHONY: libusb_win_clean
libusb_win_clean:
$(V0) @echo " CLEAN $(LIBUSB_WIN_DIR)"
$(V1) [ ! -d "$(LIBUSB_WIN_DIR)" ] || $(RM) -r "$(LIBUSB_WIN_DIR)"
.PHONY: openocd_git_win_install
openocd_git_win_install: | $(DL_DIR) $(TOOLS_DIR)
openocd_git_win_install: OPENOCD_URL := git://openocd.git.sourceforge.net/gitroot/openocd/openocd
openocd_git_win_install: OPENOCD_REV := dec6b913809bd3f857af31be178ffde65e42dbab
openocd_git_win_install: openocd_win_clean libusb_win_install ftd2xx_install
# download the source
$(V0) @echo " DOWNLOAD $(OPENOCD_URL) @ $(OPENOCD_REV)"
$(V1) [ ! -d "$(OPENOCD_BUILD_DIR)" ] || $(RM) -rf "$(OPENOCD_BUILD_DIR)"
$(V1) mkdir -p "$(OPENOCD_BUILD_DIR)"
$(V1) git clone --depth 1 --no-checkout $(OPENOCD_URL) "$(DL_DIR)/openocd-build"
$(V1) ( \
cd $(OPENOCD_BUILD_DIR) ; \
git checkout -q $(OPENOCD_REV) ; \
)
# apply patches
$(V0) @echo " PATCH $(OPENOCD_BUILD_DIR)"
$(V1) ( \
cd $(OPENOCD_BUILD_DIR) ; \
git apply < $(ROOT_DIR)/flight/Project/OpenOCD/0001-armv7m-remove-dummy-FP-regs-for-new-gdb.patch ; \
git apply < $(ROOT_DIR)/flight/Project/OpenOCD/0002-rtos-add-stm32_stlink-to-FreeRTOS-targets.patch ; \
)
# build and install
$(V0) @echo " BUILD $(OPENOCD_WIN_DIR)"
$(V1) mkdir -p "$(OPENOCD_WIN_DIR)"
$(V1) ( \
cd $(OPENOCD_BUILD_DIR) ; \
./bootstrap ; \
./configure --enable-maintainer-mode --prefix="$(OPENOCD_WIN_DIR)" \
--build=i686-pc-linux-gnu --host=i586-mingw32msvc \
CPPFLAGS=-I$(LIBUSB_WIN_DIR)/include \
LDFLAGS=-L$(LIBUSB_WIN_DIR)/lib/gcc \
--enable-ft2232_ftd2xx --with-ftd2xx-win32-zipdir=$(FTD2XX_DIR) \
--disable-werror \
--enable-stlink ; \
$(MAKE) ; \
$(MAKE) install ; \
)
# delete the extracted source when we're done
$(V1) [ ! -d "$(OPENOCD_BUILD_DIR)" ] || $(RM) -rf "$(OPENOCD_BUILD_DIR)"
.PHONY: openocd_win_clean
openocd_win_clean:
$(V0) @echo " CLEAN $(OPENOCD_WIN_DIR)"
$(V1) [ ! -d "$(OPENOCD_WIN_DIR)" ] || $(RM) -r "$(OPENOCD_WIN_DIR)"
.PHONY: openocd_git_install .PHONY: openocd_git_install
openocd_git_install: | $(DL_DIR) $(TOOLS_DIR) openocd_git_install: | $(DL_DIR) $(TOOLS_DIR)
openocd_git_install: OPENOCD_URL := git://openocd.git.sourceforge.net/gitroot/openocd/openocd openocd_git_install: OPENOCD_URL := git://openocd.git.sourceforge.net/gitroot/openocd/openocd
openocd_git_install: OPENOCD_REV := bce7009e31b23250d4325637c7b7cdbae0efed9a openocd_git_install: OPENOCD_REV := dec6b913809bd3f857af31be178ffde65e42dbab
openocd_git_install: openocd_clean openocd_git_install: openocd_clean
# download the source # download the source
$(V0) @echo " DOWNLOAD $(OPENOCD_URL) @ $(OPENOCD_REV)" $(V0) @echo " DOWNLOAD $(OPENOCD_URL) @ $(OPENOCD_REV)"
$(V1) [ ! -d "$(DL_DIR)/openocd-build" ] || $(RM) -rf "$(DL_DIR)/openocd-build" $(V1) [ ! -d "$(OPENOCD_BUILD_DIR)" ] || $(RM) -rf "$(OPENOCD_BUILD_DIR)"
$(V1) mkdir -p "$(DL_DIR)/openocd-build" $(V1) mkdir -p "$(OPENOCD_BUILD_DIR)"
$(V1) git clone --depth 1 --no-checkout $(OPENOCD_URL) "$(DL_DIR)/openocd-build" $(V1) git clone --depth 1 --no-checkout $(OPENOCD_URL) "$(OPENOCD_BUILD_DIR)"
$(V1) ( \ $(V1) ( \
cd $(DL_DIR)/openocd-build ; \ cd $(OPENOCD_BUILD_DIR) ; \
git checkout -q $(OPENOCD_REV) ; \ git checkout -q $(OPENOCD_REV) ; \
) )
# apply patches # apply patches
$(V0) @echo " PATCH $(OPENOCD_DIR)" $(V0) @echo " PATCH $(OPENOCD_DIR)"
$(V1) ( \ $(V1) ( \
cd $(DL_DIR)/openocd-build ; \ cd $(OPENOCD_BUILD_DIR) ; \
git apply < $(ROOT_DIR)/flight/Project/OpenOCD/0001-armv7m-remove-dummy-FP-regs-for-new-gdb.patch ; \ git apply < $(ROOT_DIR)/flight/Project/OpenOCD/0001-armv7m-remove-dummy-FP-regs-for-new-gdb.patch ; \
git apply < $(ROOT_DIR)/flight/Project/OpenOCD/0002-rtos-add-stm32_stlink-to-FreeRTOS-targets.patch ; \ git apply < $(ROOT_DIR)/flight/Project/OpenOCD/0002-rtos-add-stm32_stlink-to-FreeRTOS-targets.patch ; \
) )
@ -255,7 +354,7 @@ openocd_git_install: openocd_clean
$(V0) @echo " BUILD $(OPENOCD_DIR)" $(V0) @echo " BUILD $(OPENOCD_DIR)"
$(V1) mkdir -p "$(OPENOCD_DIR)" $(V1) mkdir -p "$(OPENOCD_DIR)"
$(V1) ( \ $(V1) ( \
cd $(DL_DIR)/openocd-build ; \ cd $(OPENOCD_BUILD_DIR) ; \
./bootstrap ; \ ./bootstrap ; \
./configure --enable-maintainer-mode --prefix="$(OPENOCD_DIR)" --enable-ft2232_libftdi --enable-buspirate --enable-stlink ; \ ./configure --enable-maintainer-mode --prefix="$(OPENOCD_DIR)" --enable-ft2232_libftdi --enable-buspirate --enable-stlink ; \
$(MAKE) ; \ $(MAKE) ; \
@ -263,7 +362,7 @@ openocd_git_install: openocd_clean
) )
# delete the extracted source when we're done # delete the extracted source when we're done
$(V1) [ ! -d "$(DL_DIR)/openocd-build" ] || $(RM) -r "$(DL_DIR)/openocd-build" $(V1) [ ! -d "$(OPENOCD_BUILD_DIR)" ] || $(RM) -rf "$(OPENOCD_BUILD_DIR)"
.PHONY: openocd_clean .PHONY: openocd_clean
openocd_clean: openocd_clean:

View File

@ -414,7 +414,7 @@ $(eval $(call PARTIAL_COMPILE_ARM_TEMPLATE, SRCARM))
$(OUTDIR)/$(TARGET).bin.o: $(OUTDIR)/$(TARGET).bin $(OUTDIR)/$(TARGET).bin.o: $(OUTDIR)/$(TARGET).bin
# Add jtag targets (program and wipe) # Add jtag targets (program and wipe)
$(eval $(call JTAG_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(BL_BANK_BASE),$(BL_BANK_SIZE),$(OPENOCD_CONFIG))) $(eval $(call JTAG_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(BL_BANK_BASE),$(BL_BANK_SIZE),$(OPENOCD_JTAG_CONFIG),$(OPENOCD_CONFIG)))
.PHONY: elf lss sym hex bin bino .PHONY: elf lss sym hex bin bino
elf: $(OUTDIR)/$(TARGET).elf elf: $(OUTDIR)/$(TARGET).elf

View File

@ -418,7 +418,7 @@ $(eval $(call PARTIAL_COMPILE_ARM_TEMPLATE, SRCARM))
$(OUTDIR)/$(TARGET).bin.o: $(OUTDIR)/$(TARGET).bin $(OUTDIR)/$(TARGET).bin.o: $(OUTDIR)/$(TARGET).bin
# Add jtag targets (program and wipe) # Add jtag targets (program and wipe)
$(eval $(call JTAG_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(BL_BANK_BASE),$(BL_BANK_SIZE),$(OPENOCD_CONFIG))) $(eval $(call JTAG_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(BL_BANK_BASE),$(BL_BANK_SIZE),$(OPENOCD_JTAG_CONFIG),$(OPENOCD_CONFIG)))
.PHONY: elf lss sym hex bin bino .PHONY: elf lss sym hex bin bino
elf: $(OUTDIR)/$(TARGET).elf elf: $(OUTDIR)/$(TARGET).elf

View File

@ -328,7 +328,7 @@ $(OUTDIR)/$(TARGET).bin.o: $(OUTDIR)/$(TARGET).bin
$(eval $(call OPFW_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(BOARD_TYPE),$(BOARD_REVISION))) $(eval $(call OPFW_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(BOARD_TYPE),$(BOARD_REVISION)))
# Add jtag targets (program and wipe) # Add jtag targets (program and wipe)
$(eval $(call JTAG_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(BL_BANK_BASE),$(BL_BANK_SIZE),$(OPENOCD_CONFIG))) $(eval $(call JTAG_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(BL_BANK_BASE),$(BL_BANK_SIZE),$(OPENOCD_JTAG_CONFIG),$(OPENOCD_CONFIG)))
.PHONY: elf lss sym hex bin bino .PHONY: elf lss sym hex bin bino
elf: $(OUTDIR)/$(TARGET).elf elf: $(OUTDIR)/$(TARGET).elf

View File

@ -583,7 +583,7 @@ $(OUTDIR)/$(TARGET).bin.o: $(OUTDIR)/$(TARGET).bin
$(eval $(call OPFW_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(BOARD_TYPE),$(BOARD_REVISION))) $(eval $(call OPFW_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(BOARD_TYPE),$(BOARD_REVISION)))
# Add jtag targets (program and wipe) # Add jtag targets (program and wipe)
$(eval $(call JTAG_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(FW_BANK_BASE),$(FW_BANK_SIZE),$(OPENOCD_CONFIG))) $(eval $(call JTAG_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(FW_BANK_BASE),$(FW_BANK_SIZE),$(OPENOCD_JTAG_CONFIG),$(OPENOCD_CONFIG)))
.PHONY: elf lss sym hex bin bino opfw .PHONY: elf lss sym hex bin bino opfw
elf: $(OUTDIR)/$(TARGET).elf elf: $(OUTDIR)/$(TARGET).elf

View File

@ -392,7 +392,7 @@ $(OUTDIR)/$(TARGET).bin.o: $(OUTDIR)/$(TARGET).bin
$(eval $(call OPFW_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(BOARD_TYPE),$(BOARD_REVISION))) $(eval $(call OPFW_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(BOARD_TYPE),$(BOARD_REVISION)))
# Add jtag targets (program and wipe) # Add jtag targets (program and wipe)
$(eval $(call JTAG_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(FW_BANK_BASE),$(FW_BANK_SIZE),$(OPENOCD_CONFIG))) $(eval $(call JTAG_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(FW_BANK_BASE),$(FW_BANK_SIZE),$(OPENOCD_JTAG_CONFIG),$(OPENOCD_CONFIG)))
.PHONY: elf lss sym hex bin bino opfw .PHONY: elf lss sym hex bin bino opfw
elf: $(OUTDIR)/$(TARGET).elf elf: $(OUTDIR)/$(TARGET).elf

View File

@ -1,58 +1,58 @@
From 7a8a1dbf856a2183c91f441cfdd2eee5b3d9151b Mon Sep 17 00:00:00 2001 From 8fd5040df32511f57b898bdbff412f61fbe28516 Mon Sep 17 00:00:00 2001
From: Stacey Sheldon <stac@solidgoldbomb.org> From: Stacey Sheldon <stac@solidgoldbomb.org>
Date: Thu, 2 Feb 2012 22:42:03 -0500 Date: Thu, 2 Feb 2012 22:42:03 -0500
Subject: [PATCH 1/2] armv7m: remove dummy FP regs for new gdb Subject: [PATCH 1/2] armv7m: remove dummy FP regs for new gdb
--- ---
src/rtos/rtos_standard_stackings.c | 6 ++++++ src/rtos/rtos_standard_stackings.c | 7 +++++++
src/target/armv7m.c | 16 ++++++++++++++++ src/target/armv7m.c | 16 ++++++++++++++++
2 files changed, 22 insertions(+), 0 deletions(-) 2 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/src/rtos/rtos_standard_stackings.c b/src/rtos/rtos_standard_stackings.c diff --git a/src/rtos/rtos_standard_stackings.c b/src/rtos/rtos_standard_stackings.c
index 278d3ef..7ef4659 100644 index 30d9cd9..6ea6565 100644
--- a/src/rtos/rtos_standard_stackings.c --- a/src/rtos/rtos_standard_stackings.c
+++ b/src/rtos/rtos_standard_stackings.c +++ b/src/rtos/rtos_standard_stackings.c
@@ -41,6 +41,7 @@ static const struct stack_register_offset rtos_standard_Cortex_M3_stack_offsets[ @@ -41,6 +41,7 @@ static const struct stack_register_offset rtos_standard_Cortex_M3_stack_offsets[
{ -2, 32 }, /* sp */ { -2, 32 }, /* sp */
{ 0x34, 32 }, /* lr */ { 0x34, 32 }, /* lr */
{ 0x38, 32 }, /* pc */ { 0x38, 32 }, /* pc */
+#ifdef USE_DUMMY_FP_REGS +#ifdef USE_DUMMY_FP_REGS
{ -1, 96 }, /* FPA1 */ { -1, 96 }, /* FPA1 */
{ -1, 96 }, /* FPA2 */ { -1, 96 }, /* FPA2 */
{ -1, 96 }, /* FPA3 */ { -1, 96 }, /* FPA3 */
@@ -50,6 +51,7 @@ static const struct stack_register_offset rtos_standard_Cortex_M3_stack_offsets[ @@ -50,13 +51,19 @@ static const struct stack_register_offset rtos_standard_Cortex_M3_stack_offsets[
{ -1, 96 }, /* FPA7 */ { -1, 96 }, /* FPA7 */
{ -1, 96 }, /* FPA8 */ { -1, 96 }, /* FPA8 */
{ -1, 32 }, /* FPS */ { -1, 32 }, /* FPS */
+#endif +#endif
{ 0x3c, 32 }, /* xPSR */ { 0x3c, 32 }, /* xPSR */
}; };
@@ -58,7 +60,11 @@ const struct rtos_register_stacking rtos_standard_Cortex_M3_stacking = +
{ const struct rtos_register_stacking rtos_standard_Cortex_M3_stacking = {
0x40, /* stack_registers_size */ 0x40, /* stack_registers_size */
-1, /* stack_growth_direction */ -1, /* stack_growth_direction */
+#ifdef USE_DUMMY_FP_REGS +#ifdef USE_DUMMY_FP_REGS
26, /* num_output_registers */ 26, /* num_output_registers */
+#else +#else
+ 17, + 17,
+#endif +#endif
8, /* stack_alignment */ 8, /* stack_alignment */
rtos_standard_Cortex_M3_stack_offsets /* register_offsets */ rtos_standard_Cortex_M3_stack_offsets /* register_offsets */
}; };
diff --git a/src/target/armv7m.c b/src/target/armv7m.c diff --git a/src/target/armv7m.c b/src/target/armv7m.c
index 6c1732e..7bb53c7 100644 index 258653e..50b26d4 100644
--- a/src/target/armv7m.c --- a/src/target/armv7m.c
+++ b/src/target/armv7m.c +++ b/src/target/armv7m.c
@@ -272,6 +272,7 @@ int armv7m_get_gdb_reg_list(struct target *target, struct reg **reg_list[], int @@ -267,6 +267,7 @@ int armv7m_get_gdb_reg_list(struct target *target, struct reg **reg_list[], int
struct armv7m_common *armv7m = target_to_armv7m(target); struct armv7m_common *armv7m = target_to_armv7m(target);
int i; int i;
+#ifdef USE_DUMMY_FP_REGS +#ifdef USE_DUMMY_FP_REGS
*reg_list_size = 26; *reg_list_size = 26;
*reg_list = malloc(sizeof(struct reg*) * (*reg_list_size)); *reg_list = malloc(sizeof(struct reg *) * (*reg_list_size));
@@ -302,6 +303,21 @@ int armv7m_get_gdb_reg_list(struct target *target, struct reg **reg_list[], int @@ -295,6 +296,21 @@ int armv7m_get_gdb_reg_list(struct target *target, struct reg **reg_list[], int
(*reg_list)[25] = &armv7m->core_cache->reg_list[ARMV7M_xPSR]; (*reg_list)[25] = &armv7m->core_cache->reg_list[ARMV7M_xPSR];
#endif #endif

View File

@ -1,34 +1,35 @@
From fceb681b4421dd00eb47085990b77c0f0716517d Mon Sep 17 00:00:00 2001 From e29b134e142cd759c85de4ea7c26084e87380ce1 Mon Sep 17 00:00:00 2001
From: Stacey Sheldon <stac@solidgoldbomb.org> From: Stacey Sheldon <stac@solidgoldbomb.org>
Date: Thu, 2 Feb 2012 22:42:26 -0500 Date: Thu, 2 Feb 2012 22:42:26 -0500
Subject: [PATCH 2/2] rtos: add stm32_stlink to FreeRTOS targets Subject: [PATCH 2/2] rtos: add stm32_stlink to FreeRTOS targets
--- ---
src/rtos/FreeRTOS.c | 11 +++++++++++ src/rtos/FreeRTOS.c | 12 ++++++++++++
1 files changed, 11 insertions(+), 0 deletions(-) 1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/src/rtos/FreeRTOS.c b/src/rtos/FreeRTOS.c diff --git a/src/rtos/FreeRTOS.c b/src/rtos/FreeRTOS.c
index eeab134..e57806e 100644 index c7b4643..e99d471 100644
--- a/src/rtos/FreeRTOS.c --- a/src/rtos/FreeRTOS.c
+++ b/src/rtos/FreeRTOS.c +++ b/src/rtos/FreeRTOS.c
@@ -63,6 +63,17 @@ const struct FreeRTOS_params FreeRTOS_params_list[] = @@ -57,6 +57,18 @@ const struct FreeRTOS_params FreeRTOS_params_list[] = {
0, // thread_stack_offset; 0, /* thread_stack_offset; */
52, // thread_name_offset; 52, /* thread_name_offset; */
&rtos_standard_Cortex_M3_stacking, // stacking_info &rtos_standard_Cortex_M3_stacking, /* stacking_info */
+ }, + },
+ { "stm32_stlink", // target_name + {
+ 4, // thread_count_width; + "stm32_stlink", /* target_name */
+ 4, // pointer_width; + 4, /* thread_count_width; */
+ 16, // list_next_offset; + 4, /* pointer_width; */
+ 20, // list_width; + 16, /* list_next_offset; */
+ 8, // list_elem_next_offset; + 20, /* list_width; */
+ 12, // list_elem_content_offset + 8, /* list_elem_next_offset; */
+ 0, // thread_stack_offset; + 12, /* list_elem_content_offset */
+ 52, // thread_name_offset; + 0, /* thread_stack_offset; */
+ &rtos_standard_Cortex_M3_stacking, // stacking_info + 52, /* thread_name_offset; */
} + &rtos_standard_Cortex_M3_stacking, /* stacking_info */
}
}; };
-- --
1.7.1 1.7.1

View File

@ -30,5 +30,5 @@ target create $_TARGETNAME stm32_stlink -chain-position $_TARGETNAME -rtos auto
$_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE -work-area-backup 0 $_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE -work-area-backup 0
#set _FLASHNAME $_CHIPNAME.flash set _FLASHNAME $_CHIPNAME.flash
#flash bank $_FLASHNAME stm32f2x 0x08000000 0 0 0 $_TARGETNAME flash bank $_FLASHNAME stm32f2x 0x08000000 0 0 0 $_TARGETNAME

View File

@ -419,7 +419,7 @@ $(OUTDIR)/$(TARGET).bin.o: $(OUTDIR)/$(TARGET).bin
$(eval $(call OPFW_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(BOARD_TYPE),$(BOARD_REVISION))) $(eval $(call OPFW_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(BOARD_TYPE),$(BOARD_REVISION)))
# Add jtag targets (program and wipe) # Add jtag targets (program and wipe)
$(eval $(call JTAG_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(FW_BANK_BASE),$(FW_BANK_SIZE),$(OPENOCD_CONFIG))) $(eval $(call JTAG_TEMPLATE,$(OUTDIR)/$(TARGET).bin,$(FW_BANK_BASE),$(FW_BANK_SIZE),$(OPENOCD_JTAG_CONFIG),$(OPENOCD_CONFIG)))
.PHONY: elf lss sym hex bin bino opfw .PHONY: elf lss sym hex bin bino opfw
elf: $(OUTDIR)/$(TARGET).elf elf: $(OUTDIR)/$(TARGET).elf

View File

@ -9,6 +9,7 @@ BOARD := STM32103CB_CC_Rev1
MODEL := MD MODEL := MD
MODEL_SUFFIX := _CC MODEL_SUFFIX := _CC
OPENOCD_JTAG_CONFIG := foss-jtag.revb.cfg
OPENOCD_CONFIG := stm32f1x.cfg OPENOCD_CONFIG := stm32f1x.cfg
# Note: These must match the values in link_$(BOARD)_memory.ld # Note: These must match the values in link_$(BOARD)_memory.ld

View File

@ -9,6 +9,9 @@ BOARD := STM32103CB_PIPXTREME
MODEL := MD MODEL := MD
MODEL_SUFFIX := MODEL_SUFFIX :=
OPENOCD_JTAG_CONFIG := foss-jtag.revb.cfg
OPENOCD_CONFIG := stm32f1x.cfg
# Note: These must match the values in link_$(BOARD)_memory.ld # Note: These must match the values in link_$(BOARD)_memory.ld
BL_BANK_BASE := 0x08000000 # Start of bootloader flash BL_BANK_BASE := 0x08000000 # Start of bootloader flash
BL_BANK_SIZE := 0x00003000 # Should include BD_INFO region BL_BANK_SIZE := 0x00003000 # Should include BD_INFO region

View File

@ -9,7 +9,8 @@ BOARD := STM32F4xx_OP
MODEL := HD MODEL := HD
MODEL_SUFFIX := MODEL_SUFFIX :=
OPENOCD_CONFIG := stm32f4xx.cfg OPENOCD_JTAG_CONFIG := stlink-v2.cfg
OPENOCD_CONFIG := stm32f4xx.stlink.cfg
# Note: These must match the values in link_$(BOARD)_memory.ld # Note: These must match the values in link_$(BOARD)_memory.ld
BL_BANK_BASE := 0x08000000 # Start of bootloader flash BL_BANK_BASE := 0x08000000 # Start of bootloader flash

View File

@ -203,7 +203,8 @@ endef
# $(1) = Name of binary image to write # $(1) = Name of binary image to write
# $(2) = Base of flash region to write/wipe # $(2) = Base of flash region to write/wipe
# $(3) = Size of flash region to write/wipe # $(3) = Size of flash region to write/wipe
# $(4) = OpenOCD configuration file to use # $(4) = OpenOCD JTAG interface configuration file to use
# $(5) = OpenOCD configuration file to use
define JTAG_TEMPLATE define JTAG_TEMPLATE
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Options for OpenOCD flash-programming # Options for OpenOCD flash-programming
@ -216,7 +217,7 @@ OOCD_EXE ?= openocd
OOCD_JTAG_SETUP = -d0 OOCD_JTAG_SETUP = -d0
# interface and board/target settings (using the OOCD target-library here) # interface and board/target settings (using the OOCD target-library here)
OOCD_JTAG_SETUP += -s $(TOP)/flight/Project/OpenOCD OOCD_JTAG_SETUP += -s $(TOP)/flight/Project/OpenOCD
OOCD_JTAG_SETUP += -f foss-jtag.revb.cfg -f $(4) OOCD_JTAG_SETUP += -f $(4) -f $(5)
# initialize # initialize
OOCD_BOARD_RESET = -c init OOCD_BOARD_RESET = -c init