Skip to content

openocd: get flash and debug files from cli#10539

Merged
aabadie merged 2 commits intoRIOT-OS:masterfrom
cladmi:pr/make/openocd/flashfile_from_cli
Dec 5, 2018
Merged

openocd: get flash and debug files from cli#10539
aabadie merged 2 commits intoRIOT-OS:masterfrom
cladmi:pr/make/openocd/flashfile_from_cli

Conversation

@cladmi
Copy link
Copy Markdown
Contributor

@cladmi cladmi commented Dec 3, 2018

Contribution description

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.

EDIT: this also includes hifive1 specific flasher based on openocd as they share FFLAGS.

Testing procedure

I tested on iotlab-m3 with flash and debug.
I also ran the command for the seeeduino_arch-pro has it had specific changes.

I checked and no boards | Makefile.include is setting IMAGE_FILE anymore too.

iotlab-m3 check

To get a more verbose comparison I used:

BOARD=iotlab-m3 make --no-print-directory -C examples/default/ flash-only FLASHER='bash -x $(RIOTTOOLS)/openocd/openocd.sh'

BOARD=iotlab-m3 make --no-print-directory -C examples/default/ debug DEBUGGER='bash -x $(RIOTTOOLS)/openocd/openocd.sh'

The difference for flash between master and this PR was this one (without the speed and time diff)

1c1
< bash -x /home/harter/work/git/RIOT/dist/tools/openocd/openocd.sh flash
---
> bash -x /home/harter/work/git/RIOT/dist/tools/openocd/openocd.sh flash /home/harter/work/git/RIOT/examples/default/bin/iotlab-m3/default.elf
17d16
< + : /home/harter/work/git/RIOT/examples/default/bin/iotlab-m3/default.elf
19a19
> + shift
23c23,24
< + do_flash
---
> + do_flash /home/harter/work/git/RIOT/examples/default/bin/iotlab-m3/default.elf
> + IMAGE_FILE=/home/harter/work/git/RIOT/examples/default/bin/iotlab-m3/default.elf

and for debug, after removing the difference for the tmp directory name:

1c1
< bash -x /home/harter/work/git/RIOT/dist/tools/openocd/openocd.sh debug
---
> bash -x /home/harter/work/git/RIOT/dist/tools/openocd/openocd.sh debug /home/harter/work/git/RIOT/examples/default/bin/iotlab-m3/default.elf
17d16
< + : /home/harter/work/git/RIOT/examples/default/bin/iotlab-m3/default.elf
19a19
> + shift
23c23,24
< + do_debug
---
> + do_debug /home/harter/work/git/RIOT/examples/default/bin/iotlab-m3/default.elf
> + ELFFILE=/home/harter/work/git/RIOT/examples/default/bin/iotlab-m3/default.elf

seeeduino_arch-pro check

For the seeeduino_arch-pro it is using the hexfile as is master. The command output was this one (without the board):

1c1
< bash -x /home/harter/work/git/RIOT/dist/tools/openocd/openocd.sh flash
---
> bash -x /home/harter/work/git/RIOT/dist/tools/openocd/openocd.sh flash /home/harter/work/git/RIOT/examples/default/bin/seeeduino_arch-pro/default.hex
17d16
< + : /home/harter/work/git/RIOT/examples/default/bin/seeeduino_arch-pro/default.hex
19a19
> + shift
23c23,24
< + do_flash
---
> + do_flash /home/harter/work/git/RIOT/examples/default/bin/seeeduino_arch-pro/default.hex
> + IMAGE_FILE=/home/harter/work/git/RIOT/examples/default/bin/seeeduino_arch-pro/default.hex

hifive1 check

2c2
< bash -x /home/harter/work/git/worktree/riot_master/boards/hifive1/dist/flasher.sh flash
---
> bash -x /home/harter/work/git/worktree/riot_master/boards/hifive1/dist/flasher.sh flash /home/harter/work/git/worktree/riot_master/examples/default/bin/hifive1/default.elf
6d5
< + : /home/harter/work/git/worktree/riot_master/examples/default/bin/hifive1/default.elf
8a8
> + shift
12c12,13
< + do_flash
---
> + do_flash /home/harter/work/git/worktree/riot_master/examples/default/bin/hifive1/default.elf
> + IMAGE_FILE=/home/harter/work/git/worktree/riot_master/examples/default/bin/hifive1/default.elf

Issues/PRs references

Split out of #8838

@cladmi cladmi added Area: build system Area: Build system CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Area: tools Area: Supplementary tools Area: boards Area: Board ports labels Dec 3, 2018
@cladmi cladmi requested a review from aabadie December 3, 2018 16:14
@cladmi cladmi force-pushed the pr/make/openocd/flashfile_from_cli branch from d0b0c69 to c98b038 Compare December 3, 2018 16:18
@cladmi
Copy link
Copy Markdown
Contributor Author

cladmi commented Dec 3, 2018

I rebased on top of the last master to be a base for other PRs.

@cladmi
Copy link
Copy Markdown
Contributor Author

cladmi commented Dec 3, 2018

By debugging the other required files, I think I should also include the changes for the hifive1 board in this one.
It uses a separate openocd.sh flash script but uses openocd.inc.mk file FFLAGS variable anyway.

@cladmi
Copy link
Copy Markdown
Contributor Author

cladmi commented Dec 3, 2018

@kenrabold can you check flashing is still working for the hifive1 with this change, would be great!

Copy link
Copy Markdown
Contributor

@aabadie aabadie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No particular comment on the code changes, they are all good.

I tested flash and debug on a nucleo board and all worked the same as in master.

ACK, but before merging, let's wait a bit for @kenrabold test on hifive.

@miri64 miri64 added the Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation label Dec 4, 2018
@aabadie
Copy link
Copy Markdown
Contributor

aabadie commented Dec 4, 2018

I'll merge this one tomorrow if no one objects.

do_flash "$@"
;;
*)
echo "Usage: $0 flash"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe also update the "usage" message ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forgot this one indeed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem, now it's time to squash !

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.
Get FLASH_FILE from command line instead of environment variable.

The documentation was claiming ELFFILE was given as a command line argument
already, but is was not.

This is the same change as with `openocd.sh`.
@cladmi cladmi force-pushed the pr/make/openocd/flashfile_from_cli branch from a54658f to 0b66445 Compare December 5, 2018 15:21
@cladmi
Copy link
Copy Markdown
Contributor Author

cladmi commented Dec 5, 2018

Squashed and rebased.

@cladmi cladmi added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Dec 5, 2018
@cladmi
Copy link
Copy Markdown
Contributor Author

cladmi commented Dec 5, 2018

Failing to an unrelated native xtimer test, re-triggering murdock.

@cladmi
Copy link
Copy Markdown
Contributor Author

cladmi commented Dec 5, 2018

@cladmi cladmi added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Dec 5, 2018
@aabadie
Copy link
Copy Markdown
Contributor

aabadie commented Dec 5, 2018

It's all green ! Thanks @cladmi for restarting the CI.

@aabadie aabadie merged commit 49aa583 into RIOT-OS:master Dec 5, 2018
@cladmi
Copy link
Copy Markdown
Contributor Author

cladmi commented Dec 6, 2018

Thanks for the review :)

@cladmi cladmi deleted the pr/make/openocd/flashfile_from_cli branch December 6, 2018 13:07
@aabadie aabadie added this to the Release 2019.01 milestone Dec 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: boards Area: Board ports Area: build system Area: Build system Area: tools Area: Supplementary tools CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants