Pyocd errors when debugging on NUCLEO-F746ZG (pyocd.core.exceptions.DebugError: No cores were discovered!)

I’m using Mbed Studio: 1.3.1 with NUCLEO-F746ZG (STM32F746). The program is able to run on the board without errors, but the debug function gives this error log below. Any idea on how to fix this issue?

0000671:INFO:rom_table: [1]
0000673:INFO:rom_table: [2]
0000676:INFO:rom_table: [3]
0000677:INFO:rom_table: [1]
0000679:INFO:rom_table:[1]
0000681:INFO:dwt:4 hardware watchpoints
0000687:INFO:fpb:8 hardware breakpoints, 1 literal comparators
0000709:CRITICAL:main:No cores were discovered!
Traceback (most recent call last):
File “c:\Users\MikoNore\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd_main_.py”, line 362, in run
self.COMMANDSself._args.cmd
File "c:\Users\MikoNore\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd_main
.py", line 680, in do_gdbserver
with session:
File “c:\Users\MikoNore\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\core\session.py”, line 302, in enter
self.open()
File “c:\Users\MikoNore\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\core\session.py”, line 420, in open
self._board.init()
File “c:\Users\MikoNore\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\board\board.py”, line 85, in init
self.target.init()
File “c:\Users\MikoNore\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\core\coresight_target.py”, line 160, in init
seq.invoke()
File “c:\Users\MikoNore\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\utility\sequencer.py”, line 208, in invoke
resultSequence = call()
File “c:\Users\MikoNore\AppData\Local\Mbed Studio\mbed-studio-tools\python\lib\site-packages\pyocd\core\coresight_target.py”, line 299, in check_for_cores
raise exceptions.DebugError(“No cores were discovered!”)
pyocd.core.exceptions.DebugError: No cores were discovered!
“GDB server stopped unexpectedly with exit code 1”

Thanks

Hello,

I not sure but I think the situation is still same

BR, Jan

Thanks for your reply.
Do you mean that the board is not supported for debug in Mbed Studio?
//Miko

Hi
Are you working with mbed-os-6.6.0 version ?
There is an issue corrected with STM32: RESET GPIO during init is configurable by jeromecoutant · Pull Request #14032 · ARMmbed/mbed-os · GitHub

Regards,

Ye, I mean it is not supported because it is probably still in development.

DISCO-F746NG - “No cores were discovered!” · Issue #863 · pyocd/pyOCD (github.com)
CMSIS Pack for STM32F7/H7 broken? · Issue #727 · pyocd/pyOCD (github.com)

I also tried some steps according to this page pyOCD/target_support.md at master · pyocd/pyOCD (github.com) but without succesful.

BR, Jan

I have the same problem, no cores were discovered.
The pyocd that comes with MbedStudio is not the most recent, but also with an external pyocd it reports the same when started with ‘pyocd gdbserver’. I have installed also the packs for the STM32F7, the pyocd version is 0.29.1.dev16.

Debugging in VSCode with Cortex-Debug works, but with some other old problem: a step over runs always into the interrupt handler :frowning:
I will try some workaround that is posted here:
https://community.st.com/s/question/0D50X00009XkgAOSAZ/problem-with-single-step-stmf7

But again, this is next problem when you got the debugger running. I guess pyocd has a problem with the complex ROM table scanning in the ARM coresight.

Edit:
another link for this problem:

I have performed a mass erase with the STM32CubeProgrammer tool and now pyocd can connect correctly. But debugging in MBedStudio still quits without an error message.
ok, that problem was the CubeProgrammer was still connected. After disconnecting, the old behaviour, no cores were discovered.

Did you ever figure this out? I’m having a similar-looking issue (No cores were discovered) on a STM32H743ZI2

More or less randomly means that it used to run ok, then started to stop after some time

Hi
Maybe you could have a look on

Regards,
Jerome