<p>Tested on <code>frdm-k64f</code> using <a class="issue-link js-issue-link" data-error-text="Failed to load issue title" data-id="464078105" data-permission-text="Issue title is private" data-url="https://github.com/RIOT-OS/RIOT/issues/11789" data-hovercard-type="pull_request" data-hovercard-url="/RIOT-OS/RIOT/pull/11789/hovercard" href="https://github.com/RIOT-OS/RIOT/pull/11789">#11789</a>, the following output are after I flashed an application that has <code>pm_set(0)</code> right at the start.</p>
<details><summary>OPENOCD_RESET_USE_CONNECT_ASSERT_SRST=0 make -C tests/periph_pm BOARD=frdm-k64f flash -j3
</summary>
<pre><code>make: Entering directory '/home/francisco/workspace/RIOT/tests/periph_pm'
Building application "tests_periph_pm" for "frdm-k64f" with MCU "kinetis".

"make" -C /home/francisco/workspace/RIOT/boards/frdm-k64f
"make" -C /home/francisco/workspace/RIOT/core
"make" -C /home/francisco/workspace/RIOT/cpu/kinetis
"make" -C /home/francisco/workspace/RIOT/drivers
"make" -C /home/francisco/workspace/RIOT/cpu/cortexm_common
"make" -C /home/francisco/workspace/RIOT/drivers/periph_common
"make" -C /home/francisco/workspace/RIOT/cpu/cortexm_common/periph
"make" -C /home/francisco/workspace/RIOT/cpu/kinetis/periph
"make" -C /home/francisco/workspace/RIOT/sys
"make" -C /home/francisco/workspace/RIOT/sys/auto_init
"make" -C /home/francisco/workspace/RIOT/sys/isrpipe
"make" -C /home/francisco/workspace/RIOT/sys/newlib_syscalls_default
"make" -C /home/francisco/workspace/RIOT/sys/pm_layered
"make" -C /home/francisco/workspace/RIOT/sys/shell
"make" -C /home/francisco/workspace/RIOT/sys/stdio_uart
"make" -C /home/francisco/workspace/RIOT/sys/tsrb
   text    data     bss     dec     hex filename
  20732     240    2820   23792    5cf0 /home/francisco/workspace/RIOT/tests/periph_pm/bin/frdm-k64f/tests_periph_pm.elf
/home/francisco/workspace/RIOT/dist/tools/openocd/openocd.sh flash /home/francisco/workspace/RIOT/tests/periph_pm/bin/frdm-k64f/tests_periph_pm.elf
### Flashing Target ###
/home/francisco/workspace/RIOT/tests/periph_pm/bin/frdm-k64f/tests_periph_pm.elf is not locked.
Open On-Chip Debugger 0.10.0+dev-00703-g92bb76a4-dirty (2019-07-19-14:27)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "swd". To override use 'transport select <transport>'.
Info : add flash_bank kinetis kx.pflash
adapter speed: 1000 kHz
none separate
cortex_m reset_config sysresetreq
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Info : CMSIS-DAP: SWD  Supported
Info : CMSIS-DAP: FW Version = 1.10
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : SWCLK/TCK = 0 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : clock speed 1000 kHz


/home/francisco/workspace/RIOT/tests/periph_pm/../../Makefile.include:600: recipe for target 'flash' failed
make: *** [flash] Error 1
make: Leaving directory '/home/francisco/workspace/RIOT/tests/periph_pm'


</code></pre>
</details>
<details><summary>OPENOCD_RESET_USE_CONNECT_ASSERT_SRST=1 make -C tests/periph_pm BOARD=frdm-k64f flash -j3
</summary>
<pre><code>
make: Entering directory '/home/francisco/workspace/RIOT/tests/periph_pm'
Building application "tests_periph_pm" for "frdm-k64f" with MCU "kinetis".

"make" -C /home/francisco/workspace/RIOT/boards/frdm-k64f
"make" -C /home/francisco/workspace/RIOT/core
"make" -C /home/francisco/workspace/RIOT/cpu/kinetis
"make" -C /home/francisco/workspace/RIOT/drivers
"make" -C /home/francisco/workspace/RIOT/cpu/cortexm_common
"make" -C /home/francisco/workspace/RIOT/drivers/periph_common
"make" -C /home/francisco/workspace/RIOT/cpu/cortexm_common/periph
"make" -C /home/francisco/workspace/RIOT/cpu/kinetis/periph
"make" -C /home/francisco/workspace/RIOT/sys
"make" -C /home/francisco/workspace/RIOT/sys/auto_init
"make" -C /home/francisco/workspace/RIOT/sys/isrpipe
"make" -C /home/francisco/workspace/RIOT/sys/newlib_syscalls_default
"make" -C /home/francisco/workspace/RIOT/sys/pm_layered
"make" -C /home/francisco/workspace/RIOT/sys/shell
"make" -C /home/francisco/workspace/RIOT/sys/stdio_uart
"make" -C /home/francisco/workspace/RIOT/sys/tsrb
   text    data     bss     dec     hex filename
  20732     240    2820   23792    5cf0 /home/francisco/workspace/RIOT/tests/periph_pm/bin/frdm-k64f/tests_periph_pm.elf
/home/francisco/workspace/RIOT/dist/tools/openocd/openocd.sh flash /home/francisco/workspace/RIOT/tests/periph_pm/bin/frdm-k64f/tests_periph_pm.elf
### Flashing Target ###
/home/francisco/workspace/RIOT/tests/periph_pm/bin/frdm-k64f/tests_periph_pm.elf is not locked.
Open On-Chip Debugger 0.10.0+dev-00703-g92bb76a4-dirty (2019-07-19-14:27)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "swd". To override use 'transport select <transport>'.
Info : add flash_bank kinetis kx.pflash
adapter speed: 1000 kHz
none separate
cortex_m reset_config sysresetreq
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
srst_only separate srst_nogate srst_open_drain connect_assert_srst
Info : CMSIS-DAP: SWD  Supported
Info : CMSIS-DAP: FW Version = 1.10
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : SWCLK/TCK = 0 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 0 nRESET = 1
Info : Connecting under reset
Info : CMSIS-DAP: Interface ready
Info : clock speed 1000 kHz
Info : SWD DPIDR 0x2ba01477
Info : MDM: Chip is unsecured. Continuing.
Info : kx.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : kx.cpu: external reset detected
Info : Listening on port 46373 for gdb connections
    TargetName         Type       Endian TapName            State       
--  ------------------ ---------- ------ ------------------ ------------
 0* kx.cpu             cortex_m   little kx.cpu             reset
Info : MDM: Chip is unsecured. Continuing.
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0x0000073c msp: 0x1fff0200
auto erase enabled
Info : Kinetis MK64FN1M0xxx12 detected: 2 flash blocks
Info : 2 PFlash banks: 1024k total
wrote 24576 bytes from file /home/francisco/workspace/RIOT/tests/periph_pm/bin/frdm-k64f/tests_periph_pm.elf in 1.209991s (19.835 KiB/s)
Info : kx.cpu: external reset detected
Error: Failed to write memory and, additionally, failed to find out where
Warn : target was in unknown state when halt was requested
Error: error executing cortex_m crc algorithm
Error: Failed to read memory and, additionally, failed to find out where

/home/francisco/workspace/RIOT/tests/periph_pm/../../Makefile.include:600: recipe for target 'flash' failed
make: *** [flash] Error 1
make: Leaving directory '/home/francisco/workspace/RIOT/tests/periph_pm'

</code></pre>
</details>
<details><summary><b>NOTE</b>: my diff</summary>
<pre><code>diff --git a/boards/common/frdm/dist/openocd-klx.cfg b/boards/common/frdm/dist/openocd-klx.cfg
index 5d7f29cb1..7970abc14 100644
--- a/boards/common/frdm/dist/openocd-klx.cfg
+++ b/boards/common/frdm/dist/openocd-klx.cfg
@@ -19,7 +19,7 @@ source [find target/klx.cfg]
 # The debug module is stopped in low leakage modes, we use connect_assert_srst
 # to hold the device in reset while connecting with OpenOCD to make sure that we
 # always get a connection even when the application uses low power modes.
-reset_config srst_only connect_assert_srst
+reset_config srst_only
 
 $_TARGETNAME configure -event gdb-attach {
   halt
diff --git a/boards/common/frdm/dist/openocd-kx.cfg b/boards/common/frdm/dist/openocd-kx.cfg
index 2e128dcb9..84bd6243e 100644
--- a/boards/common/frdm/dist/openocd-kx.cfg
+++ b/boards/common/frdm/dist/openocd-kx.cfg
@@ -16,7 +16,7 @@ source [find target/kx.cfg]
 # The debug module is stopped in low leakage modes, we use connect_assert_srst
 # to hold the device in reset while connecting with OpenOCD to make sure that we
 # always get a connection even when the application uses low power modes.
-reset_config srst_only connect_assert_srst
+reset_config srst_only
 
 $_TARGETNAME configure -event gdb-attach {
   halt
diff --git a/tests/periph_pm/main.c b/tests/periph_pm/main.c
index 4fe74b3bf..3f5705956 100644
--- a/tests/periph_pm/main.c
+++ b/tests/periph_pm/main.c
@@ -241,6 +241,8 @@ int main(void)
          "needed.");
 #endif
 
+    pm_set(0);
+
     /* run the shell and wait for the user to enter a mode */
     shell_run(shell_commands, line_buf, SHELL_DEFAULT_BUFSIZE);
</code></pre>
</details>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/RIOT-OS/RIOT/pull/12261?email_source=notifications&email_token=ABE7WYF4FA7722GKXSC7BFDQKRZ73A5CNFSM4IXPBX5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7F2BDY#issuecomment-533438607">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABE7WYDITOHPN734AF4H62TQKRZ73ANCNFSM4IXPBX5A">mute the thread</a>.<img src="https://github.com/notifications/beacon/ABE7WYDXYKJJZ5UBCQUZBIDQKRZ73A5CNFSM4IXPBX5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7F2BDY.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/RIOT-OS/RIOT/pull/12261?email_source=notifications\u0026email_token=ABE7WYF4FA7722GKXSC7BFDQKRZ73A5CNFSM4IXPBX5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7F2BDY#issuecomment-533438607",
"url": "https://github.com/RIOT-OS/RIOT/pull/12261?email_source=notifications\u0026email_token=ABE7WYF4FA7722GKXSC7BFDQKRZ73A5CNFSM4IXPBX5KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7F2BDY#issuecomment-533438607",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>