You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ma...@apache.org on 2015/11/03 23:41:34 UTC
[1/5] incubator-mynewt-larva git commit: Add download/debug support
files for Olimex E407 BSP.
Repository: incubator-mynewt-larva
Updated Branches:
refs/heads/master cc3b813e1 -> fb01df470
Add download/debug support files for Olimex E407 BSP.
Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/commit/6a7a34df
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/tree/6a7a34df
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/diff/6a7a34df
Branch: refs/heads/master
Commit: 6a7a34dfbf3f4207f1eb872d8c8fcb9a77c99408
Parents: cc3b813
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Tue Nov 3 14:38:03 2015 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Tue Nov 3 14:38:03 2015 -0800
----------------------------------------------------------------------
hw/bsp/olimex_stm32-e407_devboard/egg.yml | 2 +
hw/bsp/olimex_stm32-e407_devboard/f407.cfg | 63 ++++++++++++++++++++
.../olimex_stm32-e407_devboard_debug.sh | 26 ++++++++
.../olimex_stm32-e407_devboard_download.sh | 21 +++++++
4 files changed, 112 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/6a7a34df/hw/bsp/olimex_stm32-e407_devboard/egg.yml
----------------------------------------------------------------------
diff --git a/hw/bsp/olimex_stm32-e407_devboard/egg.yml b/hw/bsp/olimex_stm32-e407_devboard/egg.yml
index 2e726a8..5319542 100644
--- a/hw/bsp/olimex_stm32-e407_devboard/egg.yml
+++ b/hw/bsp/olimex_stm32-e407_devboard/egg.yml
@@ -1,6 +1,8 @@
egg.name: "hw/bsp/olimex_stm32-e407_devboard"
egg.linkerscript: "olimex_stm32-e407_devboard.ld"
egg.linkerscript.bootloader.OVERWRITE: "boot-olimex_stm32-e407_devboard.ld"
+egg.downloadscript: "olimex_stm32-e407_devboard_download.sh"
+egg.debugscript: "olimex_stm32-e407_devboard_debug.sh"
egg.cflags: -DSTM32F407xx
egg.deps:
- hw/mcu/stm/stm32f4xx
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/6a7a34df/hw/bsp/olimex_stm32-e407_devboard/f407.cfg
----------------------------------------------------------------------
diff --git a/hw/bsp/olimex_stm32-e407_devboard/f407.cfg b/hw/bsp/olimex_stm32-e407_devboard/f407.cfg
new file mode 100644
index 0000000..16beaa4
--- /dev/null
+++ b/hw/bsp/olimex_stm32-e407_devboard/f407.cfg
@@ -0,0 +1,63 @@
+# script for stm32f4x family
+
+if { [info exists CHIPNAME] } {
+ set _CHIPNAME $CHIPNAME
+} else {
+ set _CHIPNAME stm32f4x
+}
+
+if { [info exists ENDIAN] } {
+ set _ENDIAN $ENDIAN
+} else {
+ set _ENDIAN little
+}
+
+# Work-area is a space in RAM used for flash programming
+# By default use 64kB
+if { [info exists WORKAREASIZE] } {
+ set _WORKAREASIZE $WORKAREASIZE
+} else {
+ set _WORKAREASIZE 0x10000
+}
+
+# JTAG speed should be <= F_CPU/6. F_CPU after reset is 8MHz, so use F_JTAG = 1MHz
+#
+# Since we may be running of an RC oscilator, we crank down the speed a
+# bit more to be on the safe side. Perhaps superstition, but if are
+# running off a crystal, we can run closer to the limit. Note
+# that there can be a pretty wide band where things are more or less stable.
+adapter_khz 1000
+
+adapter_nsrst_delay 100
+jtag_ntrst_delay 100
+
+#jtag scan chain
+if { [info exists CPUTAPID] } {
+ set _CPUTAPID $CPUTAPID
+} else {
+ # See STM Document RM0090
+ # Section 32.6.2 - corresponds to Cortex-M4 r0p1
+ set _CPUTAPID 0x4ba00477
+}
+jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
+
+if { [info exists BSTAPID] } {
+ set _BSTAPID $BSTAPID
+} else {
+ # See STM Document RM0090
+ # Section 32.6.3
+ set _BSTAPID 0x06413041
+}
+jtag newtap $_CHIPNAME bs -irlen 5 -expected-id $_BSTAPID
+
+set _TARGETNAME $_CHIPNAME.cpu
+target create $_TARGETNAME cortex_m3 -endian $_ENDIAN -chain-position $_TARGETNAME
+
+$_TARGETNAME configure -work-area-phys 0x20000000 -work-area-size $_WORKAREASIZE -work-area-backup 0
+
+set _FLASHNAME $_CHIPNAME.flash
+flash bank $_FLASHNAME stm32f2x 0 0 0 0 $_TARGETNAME
+
+# if srst is not fitted use SYSRESETREQ to
+# perform a soft reset
+cortex_m3 reset_config sysresetreq
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/6a7a34df/hw/bsp/olimex_stm32-e407_devboard/olimex_stm32-e407_devboard_debug.sh
----------------------------------------------------------------------
diff --git a/hw/bsp/olimex_stm32-e407_devboard/olimex_stm32-e407_devboard_debug.sh b/hw/bsp/olimex_stm32-e407_devboard/olimex_stm32-e407_devboard_debug.sh
new file mode 100755
index 0000000..0a3f8e1
--- /dev/null
+++ b/hw/bsp/olimex_stm32-e407_devboard/olimex_stm32-e407_devboard_debug.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+#
+# Called: $0 <binary> [identities...]
+# - binary is the path to prefix to target binary, .elf appended to name is
+# the ELF file
+# - identities is the project identities string.
+#
+#
+if [ $# -lt 1 ]; then
+ echo "Need binary to debug"
+ exit 1
+fi
+
+FILE_NAME=$1.elf
+GDB_CMD_FILE=.gdb_cmds
+
+echo "Debugging" $FILE_NAME
+
+#
+# Block Ctrl-C from getting passed to openocd.
+# Exit openocd when gdb detaches.
+#
+echo "shell /bin/sh -c 'trap \"\" 2; openocd -f interface/ftdi/olimex-arm-usb-tiny-h.cfg -s hw/bsp/olimex_stm32-e407_devboard -f f407.cfg -c \"gdb_port 3333; telnet_port 4444; stm32f4x.cpu configure -event gdb-detach {shutdown}\" -c init -c \"reset halt\"' & " > $GDB_CMD_FILE
+echo "target remote localhost:3333" >> $GDB_CMD_FILE
+arm-none-eabi-gdb -x $GDB_CMD_FILE $FILE_NAME
+rm $GDB_CMD_FILE
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/6a7a34df/hw/bsp/olimex_stm32-e407_devboard/olimex_stm32-e407_devboard_download.sh
----------------------------------------------------------------------
diff --git a/hw/bsp/olimex_stm32-e407_devboard/olimex_stm32-e407_devboard_download.sh b/hw/bsp/olimex_stm32-e407_devboard/olimex_stm32-e407_devboard_download.sh
new file mode 100755
index 0000000..f1cdf56
--- /dev/null
+++ b/hw/bsp/olimex_stm32-e407_devboard/olimex_stm32-e407_devboard_download.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+#
+# Called: $0 <binary> [identities...]
+# - binary is the path to prefix to target binary, .elf.bin appended to this
+# name is the raw binary format of the binary.
+# - identities is the project identities string. So you can have e.g. different
+# flash offset for bootloader identity
+#
+#
+if [ $# -lt 1 ]; then
+ echo "Need binary to download"
+ exit 1
+fi
+
+FLASH_OFFSET=0x08000000
+FILE_NAME=$1.elf.bin
+
+echo "Downloading" $FILE_NAME
+
+openocd -f interface/ftdi/olimex-arm-usb-tiny-h.cfg -s hw/bsp/olimex_stm32-e407_devboard -f f407.cfg -c init -c "reset halt" -c "flash write_image erase $FILE_NAME $FLASH_OFFSET" -c "reset run" -c shutdown
+
[2/5] incubator-mynewt-larva git commit: Make flash as the default
destination when building for Olimex.
Posted by ma...@apache.org.
Make flash as the default destination when building for Olimex.
Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/commit/337106c5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/tree/337106c5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/diff/337106c5
Branch: refs/heads/master
Commit: 337106c5bb0023a2de7a65434aac9796bccb02d1
Parents: 6a7a34d
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Tue Nov 3 14:38:51 2015 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Tue Nov 3 14:38:51 2015 -0800
----------------------------------------------------------------------
.../olimex_stm32-e407_devboard.ld | 34 +++++++++++---------
1 file changed, 18 insertions(+), 16 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/337106c5/hw/bsp/olimex_stm32-e407_devboard/olimex_stm32-e407_devboard.ld
----------------------------------------------------------------------
diff --git a/hw/bsp/olimex_stm32-e407_devboard/olimex_stm32-e407_devboard.ld b/hw/bsp/olimex_stm32-e407_devboard/olimex_stm32-e407_devboard.ld
index 2872894..952b728 100755
--- a/hw/bsp/olimex_stm32-e407_devboard/olimex_stm32-e407_devboard.ld
+++ b/hw/bsp/olimex_stm32-e407_devboard/olimex_stm32-e407_devboard.ld
@@ -14,14 +14,14 @@
* limitations under the License.
*/
-/* Linker script for STM32F407 when running code from SRAM */
+/* Linker script for STM32F407 when running from flash and not using the bootloader */
/* Linker script to configure memory regions. */
MEMORY
{
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K
CCM (rwx) : ORIGIN = 0x10000000, LENGTH = 64K
- RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x20000
+ RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x20000
}
/* Linker script to place sections and symbol values. Should be used together
@@ -55,7 +55,7 @@ MEMORY
* __corebss_start__
* __corebss_end__
* __ecoredata
- * __ecorebss
+ * __ecorebs
*/
ENTRY(Reset_Handler)
@@ -63,8 +63,9 @@ SECTIONS
{
.text :
{
- __vector_tbl_reloc__ = .;
+ __isr_vector_start = .;
KEEP(*(.isr_vector))
+ __isr_vector_end = .;
*(.text*)
KEEP(*(.init))
@@ -87,40 +88,41 @@ SECTIONS
*(.rodata*)
KEEP(*(.eh_frame*))
- } > RAM
+ } > FLASH
.ARM.extab :
{
*(.ARM.extab* .gnu.linkonce.armextab.*)
- } > RAM
+ } > FLASH
__exidx_start = .;
.ARM.exidx :
{
*(.ARM.exidx* .gnu.linkonce.armexidx.*)
- } > RAM
+ } > FLASH
__exidx_end = .;
- . = ALIGN(8);
__etext = .;
+ .vector_relocation :
+ {
+ . = ALIGN(4);
+ __vector_tbl_reloc__ = .;
+ . = . + (__isr_vector_end - __isr_vector_start);
+ . = ALIGN(4);
+ } > RAM
+
.coredata : AT (__etext)
{
__coredata_start__ = .;
*(.data.core)
- . = ALIGN(8);
+ . = ALIGN(4);
__coredata_end__ = .;
} > CCM
__ecoredata = __etext + SIZEOF(.coredata);
-
- /* This section is here so that the start of .data has the same VMA and LMA */
- .ram_coredata (NOLOAD):
- {
- . = . + SIZEOF(.coredata);
- } > RAM
-
+
.data : AT (__ecoredata)
{
__data_start__ = .;
[5/5] incubator-mynewt-larva git commit: Fix comment.
Posted by ma...@apache.org.
Fix comment.
Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/commit/fb01df47
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/tree/fb01df47
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/diff/fb01df47
Branch: refs/heads/master
Commit: fb01df470509ec203a6f68757a2166fb068aa458
Parents: 6504f7c
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Tue Nov 3 14:41:04 2015 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Tue Nov 3 14:41:04 2015 -0800
----------------------------------------------------------------------
hw/hal/include/hal/hal_uart.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/fb01df47/hw/hal/include/hal/hal_uart.h
----------------------------------------------------------------------
diff --git a/hw/hal/include/hal/hal_uart.h b/hw/hal/include/hal/hal_uart.h
index 626759e..b308b84 100644
--- a/hw/hal/include/hal/hal_uart.h
+++ b/hw/hal/include/hal/hal_uart.h
@@ -41,7 +41,7 @@ typedef void (*hal_uart_tx_done)(void *arg);
typedef int (*hal_uart_rx_char)(void *arg, uint8_t byte);
/**
- * hal uart init
+ * hal uart init cbs
*
* Initializes given uart. Mapping of logical UART number to physical
* UART/GPIO pins is in BSP.
[3/5] incubator-mynewt-larva git commit: Add download/debug support
files for STM32F3 discovery board.
Posted by ma...@apache.org.
Add download/debug support files for STM32F3 discovery board.
Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/commit/d0aeff2e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/tree/d0aeff2e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/diff/d0aeff2e
Branch: refs/heads/master
Commit: d0aeff2eb2eab57694fb062177e85fef7df5f097
Parents: 337106c
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Tue Nov 3 14:39:51 2015 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Tue Nov 3 14:39:51 2015 -0800
----------------------------------------------------------------------
hw/bsp/stm32f3discovery/egg.yml | 2 ++
.../stm32f3discovery/stm32f3discovery_debug.sh | 27 ++++++++++++++++++++
.../stm32f3discovery_download.sh | 21 +++++++++++++++
3 files changed, 50 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/d0aeff2e/hw/bsp/stm32f3discovery/egg.yml
----------------------------------------------------------------------
diff --git a/hw/bsp/stm32f3discovery/egg.yml b/hw/bsp/stm32f3discovery/egg.yml
index 389f86f..f307b73 100644
--- a/hw/bsp/stm32f3discovery/egg.yml
+++ b/hw/bsp/stm32f3discovery/egg.yml
@@ -1,6 +1,8 @@
egg.name: "hw/bsp/stm32f3discovery"
egg.linkerscript: "stm32f3discovery.ld"
egg.linkerscript.bootloader.OVERWRITE: "boot-stm32f3discovery.ld"
+egg.downloadscript: "stm32f3discovery_download.sh"
+egg.debugscript: "stm32f3discovery_debug.sh"
egg.cflags: -DSTM32F303xC
egg.deps:
- hw/mcu/stm/stm32f3xx
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/d0aeff2e/hw/bsp/stm32f3discovery/stm32f3discovery_debug.sh
----------------------------------------------------------------------
diff --git a/hw/bsp/stm32f3discovery/stm32f3discovery_debug.sh b/hw/bsp/stm32f3discovery/stm32f3discovery_debug.sh
new file mode 100755
index 0000000..63ba061
--- /dev/null
+++ b/hw/bsp/stm32f3discovery/stm32f3discovery_debug.sh
@@ -0,0 +1,27 @@
+#!/bin/sh
+#
+# Called: $0 <binary> [identities...]
+# - binary is the path to prefix to target binary, .elf appended to name is
+# the ELF file
+# - identities is the project identities string.
+#
+#
+if [ $# -lt 1 ]; then
+ echo "Need binary to debug"
+ exit 1
+fi
+
+FILE_NAME=$1.elf
+GDB_CMD_FILE=.gdb_cmds
+
+echo "Debugging" $FILE_NAME
+
+#
+# Block Ctrl-C from getting passed to openocd.
+# Exit openocd when gdb detaches.
+#
+echo "shell /bin/sh -c 'trap \"\" 2; openocd -f board/stm32f3discovery.cfg -c \"gdb_port 3333; telnet_port 4444; stm32f3x.cpu configure -event gdb-detach {shutdown}\" -c init -c \"reset halt\"' & " > $GDB_CMD_FILE
+echo "target remote localhost:3333" >> $GDB_CMD_FILE
+arm-none-eabi-gdb -x $GDB_CMD_FILE $FILE_NAME
+rm $GDB_CMD_FILE
+
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/d0aeff2e/hw/bsp/stm32f3discovery/stm32f3discovery_download.sh
----------------------------------------------------------------------
diff --git a/hw/bsp/stm32f3discovery/stm32f3discovery_download.sh b/hw/bsp/stm32f3discovery/stm32f3discovery_download.sh
new file mode 100755
index 0000000..4682d56
--- /dev/null
+++ b/hw/bsp/stm32f3discovery/stm32f3discovery_download.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+#
+# Called: $0 <binary> [identities...]
+# - binary is the path to prefix to target binary, .elf.bin appended to this
+# name is the raw binary format of the binary.
+# - identities is the project identities string. So you can have e.g. different
+# flash offset for bootloader identity
+#
+#
+if [ $# -lt 1 ]; then
+ echo "Need binary to download"
+ exit 1
+fi
+
+FLASH_OFFSET=0x08000000
+FILE_NAME=$1.elf.bin
+
+echo "Downloading" $FILE_NAME
+
+openocd -f board/stm32f3discovery.cfg -c init -c "reset halt" -c "flash write_image erase $FILE_NAME $FLASH_OFFSET" -c "reset run" -c shutdown
+
[4/5] incubator-mynewt-larva git commit: Fix boot project. Should not
depend on specific MCU, must include one of the console libs.
Posted by ma...@apache.org.
Fix boot project. Should not depend on specific MCU, must include
one of the console libs.
Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/commit/6504f7c2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/tree/6504f7c2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/diff/6504f7c2
Branch: refs/heads/master
Commit: 6504f7c241c27ad4270106e59e73b0da1e52d862
Parents: d0aeff2
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Tue Nov 3 14:40:18 2015 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Tue Nov 3 14:40:18 2015 -0800
----------------------------------------------------------------------
project/boot/boot.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/6504f7c2/project/boot/boot.yml
----------------------------------------------------------------------
diff --git a/project/boot/boot.yml b/project/boot/boot.yml
index 319ff10..08eabe8 100644
--- a/project/boot/boot.yml
+++ b/project/boot/boot.yml
@@ -4,4 +4,4 @@ project.eggs:
- libs/os
- libs/bootutil
- libs/nffs
- - hw/mcu/stm/stm32f4xx
+ - libs/console/stub