Skip to content
Snippets Groups Projects
Unverified Commit d4ca2644 authored by Gaëtan Harter's avatar Gaëtan Harter
Browse files

boards/iotlab-m3|a8: fix openocd configuration

iotlab-m3 boards always ended up not being able to flash after time.
This changes managed to fix and flash boards that where able to be flashed with
the deprecated `ft2232` driver and not with the `ftdi` driver used in RIOT.

It combines configuration from openocd, iot-lab, RIOT config and Alexandre
Abadie feedback

* http://repo.or.cz/openocd.git/blob/HEAD:/tcl/interface/ftdi/iotlab-usb.cfg
  * ftdi configuration
* https://github.com/iot-lab/iot-lab-gateway/blob/2.4.1/gateway_code/static/iot-lab-m3.cfg
  * `trst_and_srst` config
* Alexandre feedback and http://openocd.org/doc/html/Reset-Configuration.html
  * 'connect_assert_srst' reset configuration
    * it prevents errors in the output on first flash
    * should help on boards with invalid code
    * It was taken from what Alexandre found for board 'b-l072z-lrwan1'
  * It requires using '-c reset halt' instead of '-c halt' before debug
* RIOT
  * Keep the `configure -rtos` auto
parent 2ac61b7f
No related branches found
No related tags found
No related merge requests found
...@@ -10,6 +10,10 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbserial*B))) ...@@ -10,6 +10,10 @@ PORT_DARWIN ?= $(firstword $(sort $(wildcard /dev/tty.usbserial*B)))
export BAUD = 500000 export BAUD = 500000
include $(RIOTMAKE)/tools/serial.inc.mk include $(RIOTMAKE)/tools/serial.inc.mk
# call a 'reset halt' command before starting the debugger
# it is required as `connect_assert_srst` is set
export OPENOCD_DBG_START_CMD = -c 'reset halt'
# this board uses openocd # this board uses openocd
include $(RIOTMAKE)/tools/openocd.inc.mk include $(RIOTMAKE)/tools/openocd.inc.mk
......
interface ftdi source [find interface/ftdi/iotlab-usb.cfg]
ftdi_vid_pid 0x0403 0x6010 source [find target/stm32f1x.cfg]
ftdi_layout_init 0x0c08 0x0c2b # use combined on interfaces or targets that can't set TRST/SRST separately
ftdi_layout_signal nTRST -data 0x0800 # Using connect_assert_srst removes errors on first flash
ftdi_layout_signal nSRST -data 0x0400 reset_config trst_and_srst connect_assert_srst
source [find target/stm32f1x.cfg]
$_TARGETNAME configure -rtos auto $_TARGETNAME configure -rtos auto
interface ftdi source [find interface/ftdi/iotlab-usb.cfg]
ftdi_vid_pid 0x0403 0x6010 source [find target/stm32f1x.cfg]
ftdi_layout_init 0x0c08 0x0c2b # use combined on interfaces or targets that can't set TRST/SRST separately
ftdi_layout_signal nTRST -data 0x0800 # Using connect_assert_srst removes errors on first flash
ftdi_layout_signal nSRST -data 0x0400 reset_config trst_and_srst connect_assert_srst
source [find target/stm32f1x.cfg]
$_TARGETNAME configure -rtos auto $_TARGETNAME configure -rtos auto
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment