Skip to content

boards/iotlab: rely on OPENOCD_RESET_USE_CONNECT_ASSERT_SRST#12153

Merged
aabadie merged 1 commit intoRIOT-OS:masterfrom
cladmi:pr/iotlab/use_openocd_reset_use_connect_assert_srst
Sep 10, 2019
Merged

boards/iotlab: rely on OPENOCD_RESET_USE_CONNECT_ASSERT_SRST#12153
aabadie merged 1 commit intoRIOT-OS:masterfrom
cladmi:pr/iotlab/use_openocd_reset_use_connect_assert_srst

Conversation

@cladmi
Copy link
Contributor

@cladmi cladmi commented Sep 2, 2019

Contribution description

Use the new OPENOCD_RESET_USE_CONNECT_ASSERT_SRST to configure
'reset_config connect_assert_srst' when flashing and resetting only.

This removes the need for a special debug configuration and should allow
connecting to a running target again.

Testing procedure

When flashing the reset configuration used is the same (see the last line displayed in the output):

BOARD=iotlab-m3 RIOT_CI_BUILD=1 make --no-print-directory -C examples/hello-world/ flash
Output in the PR, the configuration is changed to the same as in master
BOARD=iotlab-m3 RIOT_CI_BUILD=1 make --no-print-directory -C examples/hello-world/ flash
Building application "hello-world" for "iotlab-m3" with MCU "stm32f1".

   text    data     bss     dec     hex filename
   8168     120    2556   10844    2a5c /home/harter/work/git/worktree/riot_master/examples/hello-world/bin/iotlab-m3/hello-world.elf
/home/harter/work/git/worktree/riot_master/dist/tools/openocd/openocd.sh flash /home/harter/work/git/worktree/riot_master/examples/hello-world/bin/iotlab-m3/hello-world.elf
### Flashing Target ###
GNU MCU Eclipse 64-bit Open On-Chip Debugger 0.10.0+dev-00462-gdd1d90111 (2019-01-18-11:37)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
adapter speed: 1000 kHz
adapter_nsrst_delay: 100
jtag_ntrst_delay: 100
none separate
cortex_m reset_config sysresetreq
trst_and_srst separate srst_nogate trst_push_pull srst_open_drain connect_deassert_srst
trst_and_srst separate srst_nogate trst_push_pull srst_open_drain connect_assert_srst
Output in master until the reset configuration
Building application "hello-world" for "iotlab-m3" with MCU "stm32f1".                                                                                                                                                                                                                    

   text    data     bss     dec     hex filename
   8168     120    2556   10844    2a5c /home/harter/work/git/worktree/riot_master/examples/hello-world/bin/iotlab-m3/hello-world.elf
/home/harter/work/git/worktree/riot_master/dist/tools/openocd/openocd.sh flash /home/harter/work/git/worktree/riot_master/examples/hello-world/bin/iotlab-m3/hello-world.elf
/home/harter/work/git/worktree/riot_master/dist/tools/openocd/openocd.sh: line 124: [: : integer expression expected
### Flashing Target ###
GNU MCU Eclipse 64-bit Open On-Chip Debugger 0.10.0+dev-00462-gdd1d90111 (2019-01-18-11:37)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "jtag". To override use 'transport select <transport>'.
adapter speed: 1000 kHz
adapter_nsrst_delay: 100
jtag_ntrst_delay: 100
none separate
cortex_m reset_config sysresetreq
trst_and_srst separate srst_nogate trst_push_pull srst_open_drain connect_assert_srst
Debug works
BOARD=iotlab-m3 RIOT_CI_BUILD=1 make --no-print-directory -C examples/hello-world/ debug
/home/harter/work/git/worktree/riot_master/dist/tools/openocd/openocd.sh debug /home/harter/work/git/worktree/riot_master/examples/hello-world/bin/iotlab-m3/hello-world.elf
### Starting Debugging ###
GNU MCU Eclipse 64-bit Open On-Chip Debugger 0.10.0+dev-00462-gdd1d90111 (2019-01-18-11:37)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
Reading symbols from /home/harter/work/git/worktree/riot_master/examples/hello-world/bin/iotlab-m3/hello-world.elf...done.
Remote debugging using :3333
cortexm_sleep (deep=<optimized out>) at /home/harter/work/git/worktree/riot_master/cpu/cortexm_common/include/cpu.h:177
177         irq_restore(state);
(gdb) 

Issues/PRs references

Alternative way of doing #8977 that restores debug on a running target now that we have #11976

Use the new OPENOCD_RESET_USE_CONNECT_ASSERT_SRST to configure
'reset_config connect_assert_srst' when flashing and resetting only.

This removes the need for a special debug configuration and should allow
connecting to a running target again.
@cladmi
Copy link
Contributor Author

cladmi commented Sep 2, 2019

@aabadie I update the openocd config done in #8977 using #11976 you may be the right person to review this.

@jcarrano jcarrano added Area: boards Area: Board ports Area: tools Area: Supplementary tools Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Sep 2, 2019
@aabadie aabadie added Reviewed: 1-fundamentals The fundamentals of the PR were reviewed according to the maintainer guidelines Reviewed: 2-code-design The code design of the PR was reviewed according to the maintainer guidelines Reviewed: 4-code-style The adherence to coding conventions by the PR were reviewed according to the maintainer guidelines Reviewed: 5-documentation The documentation details of the PR were reviewed according to the maintainer guidelines labels Sep 3, 2019
@aabadie aabadie self-requested a review September 3, 2019 19:47
Copy link
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.

Tested on IoT-LAB M3 and works the same.

ACK and go!

@aabadie aabadie merged commit b80a41f into RIOT-OS:master Sep 10, 2019
@cladmi
Copy link
Contributor Author

cladmi commented Sep 10, 2019

Thank you for the review.
I almost did not see it with all the stale bots messages :D

@cladmi cladmi deleted the pr/iotlab/use_openocd_reset_use_connect_assert_srst branch September 10, 2019 12:31
@kb2ma kb2ma added this to the Release 2019.10 milestone Sep 16, 2019
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: tools Area: Supplementary tools CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Reviewed: 1-fundamentals The fundamentals of the PR were reviewed according to the maintainer guidelines Reviewed: 2-code-design The code design of the PR was reviewed according to the maintainer guidelines Reviewed: 4-code-style The adherence to coding conventions by the PR were reviewed according to the maintainer guidelines Reviewed: 5-documentation The documentation details of the PR were reviewed according to the maintainer guidelines Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants