-
Notifications
You must be signed in to change notification settings - Fork 493
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"No cores were discovered!" with nucleo_g071rb #743
Comments
Unfortunately I don't have an STM32G0 to test with. When I get a chance, I'll review the reference manual for this device to see if anything stands out as to why the ROM table accesses are returning invalid values. |
@flit, If this can help, one hint is that read cidr value is not always the same. |
I encounter the same issue. Error log: Additional remarks:
|
The comment about the problem disappearing if you have valid code in flash is very Interesting. I'm not sure what the different cidr values means. Except, yes, it's obviously not hardcoded. |
Looks like the If STM32CubeIDE is setting Please try creating a def will_init_target(target, init_seq):
# add init task to set RCC_APBENR1.DBGEN before reading ROM tables
init_seq.insert_after('create_aps',
('set_dbgen', lambda : target.write32(0x4002103c, 0x08000000))
)
return init_seq (Note that I have not tested this since I don't have the STM32G0 hardware.) For more about user scripts, the documentation is here: https://github.com/mbedmicro/pyOCD/blob/master/docs/user_scripts.md |
@flit , any required pyocd version to use scripts ? I'm using 0.21.0
|
@flit Thank you for the help. Then I've renamed def will_init_target(target, init_sequence):
# add init task to set RCC_APBENR1.DBGEN before reading ROM tables
init_sequence.insert_after('create_aps',
('set_dbgen', lambda : target.write32(0x4002103c, 0x08000000))
)
return init_sequence But I'm still stuck with this error:
|
Sorry! Among other things, I forgot that Please try this updated version. I was able to test this enough to make sure the register write happens at the right time. def will_init_target(target, init_sequence):
def set_dbgen():
LOG.info("setting RCC_APBENR1.DBGEN")
aps[0].write32(0x4002103c, 0x08000000)
dp.flush()
# add init task to set RCC_APBENR1.DBGEN before reading ROM tables
init_sequence.insert_after('create_aps',
('set_dbgen', set_dbgen)
)
return init_sequence |
Same issue, though it seems change applied correctly.
|
Same status than @erwango, still the " No cores were discovered!" error, the application is not flashed but the user script print "RCC_APBENR1.DBGEN" appears in the logs. |
Test with 73710a2 commit version:
|
@jeromecoutant what about |
@erwango @lbarthelemy I don't know why writing @jeromecoutant Can you try with the |
@flit I understand, thank you for the support any way! |
Hi pyocd gdbserver -t stm32g071rbtx is OK (tested with Keil.STM32G0xx_DFP.1.2.0.pack file) |
Hi,
Could you please try the following sequence:
(I need to flash using pyocd one time, before "no cores" error show up for subsequent pyocd calls.) Thank you by advance |
Looks similar to #729 |
I see the same issue with the L073RZ(#729) and the F767ZI: PyOCD: 0.23.0 $ ./pyocd flash --frequency 1800000 -O connect_mode=under-reset --uid 0672FF574953867567051035 --target STM32F767ZI --pack ~/Desktop/Keil.STM32F7xx_DFP.2.12.0.pack --erase=chip /Users/user/mbed-os-example-blinky.bin
0003040:ERROR:ap:Transfer error while reading AP#0 ROM table: SWD/JTAG Transfer Fault @ 0xe000efbc-0xe000f043
0003109:CRITICAL:__main__:No cores were discovered!
Traceback (most recent call last):
File "pyocd/__main__.py", line 343, in run
self._COMMANDS[self._args.cmd](self)
File "pyocd/__main__.py", line 473, in do_flash
with session:
File "pyocd/core/session.py", line 287, in __enter__
self.open()
File "pyocd/core/session.py", line 367, in open
self._board.init()
File "pyocd/board/board.py", line 83, in init
self.target.init()
File "pyocd/core/coresight_target.py", line 164, in init
seq.invoke()
File "pyocd/utility/sequencer.py", line 208, in invoke
resultSequence = call()
File "pyocd/core/coresight_target.py", line 298, in check_for_cores
raise exceptions.DebugError("No cores were discovered!")
DebugError: No cores were discovered! |
@lbarthelemy, @flit, I manage to flash using pyocd by holding the board reset during flash (but not too long otherwise I get another error). This is using pyocd v0.21.0. |
@lbarthelemy, I'm now able to flash from command line without manualinteraction with the board:
|
@erwango Thank you for the update!!
It still need to use |
@flit , I'm closing this point. I think solution could be proposed for other similar issues. |
I still think there is an underlying issue in PyOCD which needs to be investigated here. At the least a guard against the error which can guide the user? |
I found a workable solution by looking at openocd which works correctly. and also looking at From the openocd target config
This is my configuration that allows me to debug, however it does reset the core on startup which causes the application to restart. I am not sure how to change this in pyocd. I stepped release_reset through the different phases until things worked. It seems to need to be released before some additional configuration happens. The following is my pyocd_user.py
|
When trying to flash nucleo_g071rb using pyocd, following error happens:
The text was updated successfully, but these errors were encountered: