1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

33 Commits

Author SHA1 Message Date
Gaëtan Harter
468e4084f2
tools/openocd.sh: probe the board for real flash address on binary flash
Some boards have a configuration of the flash bank with an address of 0
when it actually starts as 0x08000000 but openocd relies on probing
the hardware at runtime.

This now allows to first probe the board to get the actual value.
If probing fail for any reason, return the value from the configuration.
This can happen when the board is unreachable so at least give a valid
output instead of an error.

This will allow correct flash detection on for example the `stm32f3` and
`stm32l4` which have a configured address of 0.

4a6f93c961/tcl/target/stm32f3x.cfg (L64)
4a6f93c961/tcl/target/stm32l4x.cfg (L51)
2019-05-17 18:28:27 +02:00
3583b00750 dist/tools/openocd: make "reset run" command configurable
Co-Authored-By: jcarrano <juan@carrano.com.ar>
2019-03-12 11:49:02 +01:00
Gaëtan Harter
a0b97ad737
openocd: get flash and debug files from cli
Get FLASH_FILE and ELFFILE from command line instead of environment variable.

The documentation was claiming ELFFILE was given as a command line argument
already, but is was not.
2018-12-05 16:21:03 +01:00
cladmi
a7779e24c5
openocd.sh: handle 'newline' on osx
https://stackoverflow.com/a/24276470

    In replacement strings used with the s command, assume that NO
    control-character escape sequences are supported (ex '\n')

Replace with an escaped newline character. Current form works in 'bash'.
2018-10-30 19:44:37 +01:00
cladmi
6f02568c84
openocd.sh: split 'sed' commands on different lines
https://stackoverflow.com/a/24276470

    Labels and branching commands (e.g., b) must be followed by an actual
    newline or continuation via a separate -e option.
2018-10-30 19:44:37 +01:00
cladmi
291a80c664
openocd.sh: refactor splitting banks in a separate function
Prepare for other refactoring.
2018-10-30 19:44:37 +01:00
cladmi
bc7e53f3d4
openocd.sh: include base address in IMAGE_OFFSET for binfiles
Add the rom base address to the flash address when flashing binaries.
This allows flashing binaries with the default openocd configuration.

It is an API change to IMAGE_OFFSET with binary files as it should now
only be an offset to the base address.

Force openocd type to '.bin' in case we want to flash hex/elf objects or
files not automatically recognized as bin.
2018-09-04 13:53:38 +02:00
cladmi
36b51467dd
openocd.sh: add functions to access board flash address
This allows getting the ROM base address.

It may not be available in the build system directly so better extract it from
openocd. Also openocd is board specific and this address is cpu specific
so would have definition order issue in the build system.
2018-09-04 13:50:46 +02:00
cladmi
5748d6a75f
openocd.sh: add a _is_binfile function
Returns 0 if it is true.

The test is based on the file extension, but also use the IMAGE_TYPE variable
to force setting to binary.
2018-09-04 13:49:45 +02:00
cladmi
60aac4a75b
openocd.sh: fix verify_image with IMAGE_OFFSET
When flashing with an IMAGE_OFFSET, it should also be passed to
verify_image. It is handling the base address in the image too.

This works with both elf files and binaries with the base address added.
2018-09-04 13:48:16 +02:00
cladmi
09f0930f59
openocd.sh: add a debug message when flashing with an offset 2018-09-04 13:48:12 +02:00
cladmi
5bb9babfe0
openocd.sh: update to bash
Update to bash to have `local` variables and `=~` regex matching.
Will be used in upcoming commits.
2018-09-04 13:46:25 +02:00
2172074598 dist/tools/openocd: make reset before halt option in debug 2018-04-18 17:33:30 +02:00
Joakim Nohlgård
57de166ea1 makefiles: Refactor openocd tool handling
Attempt to decouple board configuration from debugger interface
configuration by specifying the DEBUG_IFACE variable for the debug
hardware interface to use.
2017-11-17 10:03:05 +01:00
Joakim Nohlgård
dd95f593a0 openocd: Run verify after write without intermediate reset
Fixes problems with the watchdog interfering on Kinetis K devices
when USE_OLD_OPENOCD=0.
2017-10-18 14:34:20 +02:00
Joakim Nohlgård
7713bede99 openocd: Refactor openocd.sh script
- Merge flash and flash-elf commands since they were identical except
  for the file name of the image
- Split GDB command from DBG environment variable to allow more easily
  configure front-ends for GDB via environment variables.
- Remove verbose tests of empty variables and replace by `: ${VAR:=default}`
- Remove passed command line arguments to sub-functions, they were
  unused in the functions anyway.
- Remove TUI variable, use `export DBG_EXTRA_FLAGS=-tui` to get the same
  result.
2017-10-18 14:34:20 +02:00
8601285b13 openocd: return error if flashing went wrong 2016-07-27 17:42:06 +02:00
Toon Stegen
cf431e696c make debug: start gdb quietly 2016-04-22 12:00:10 +02:00
Joakim Nohlgård
98c465008b all: Update @gebart family name, email 2015-09-20 13:47:39 +02:00
daniel-k
78b98b3b1c debugging: fix openocd closing when pressing Ctrl+C in GDB, fix #3427 2015-08-29 19:17:24 +02:00
daniel-k
03542161dd openocd: don't reset cpu for target 'debug' 2015-07-13 17:22:54 +02:00
Joakim Gebart
527750c496 dist: openocd.sh: Add PRE_FLASH_CHECK_SCRIPT 2015-05-27 10:30:33 +02:00
Johann Fischer
21141cd389 dist/tools/openocd/openocd.sh: Add flash-elf command 2015-05-27 10:30:33 +02:00
Joakim Gebart
f5c67ebe62 dist: openocd.sh: Refactor argument handling, add new hooks for extra commands 2015-05-27 10:30:33 +02:00
Oleg Hahm
96e6d2aee3 Merge pull request #2471 from haukepetersen/fix_openocd_shutdown
dist/openocd.sh: added shutdown to flash commands
2015-03-05 17:18:10 +01:00
Joakim Gebart
f10c1f94d8 dist/tools/openocd: Replace OPENOCD_EXTRA_INIT with command line arguments
OPENOCD_EXTRA_INIT did not work for quoted arguments or openocd commands which require arguments.
2015-02-23 10:57:24 +01:00
Hauke Petersen
34541a5e0e squash: work-around for wrong openocd return value 2015-02-19 16:59:03 +01:00
Hauke Petersen
8b17d0575e dist/openocd.sh: added shutdown to flash commands 2015-02-19 16:45:00 +01:00
Joakim Gebart
a519aaad3d dist/tools/openocd: Add documentation for newly introduced environment variables 2015-02-18 10:20:26 +01:00
Joakim Gebart
f4006cda2a dist/tools/openocd: Quote file names in shell arguments 2015-02-18 10:11:07 +01:00
Joakim Gebart
b4c3f0c565 dist/tools/openocd: Make openocd command configurable. 2015-02-18 10:11:06 +01:00
Joakim Gebart
6e88b4ab2d dist/tools/openocd: Add support for specifying config file and extra initialization arguments. 2015-02-18 10:10:53 +01:00
haukepetersen
63f019210c dist: added unified openocd control script 2015-02-10 14:27:45 +01:00