-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Fix for debugging when trying to load to ram. #87423
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -439,7 +439,7 @@ def do_run_common_image(command, user_args, user_runner_args, used_cmds, | |
# the board has enabled this functionality, check if the board should be | ||
# reset or not. If this is not specified in the board/soc file, leave it up to | ||
# the runner's default configuration to decide if a reset should occur. | ||
if runner_cls.capabilities().reset and '--no-reset' not in final_argv: | ||
if runner_cls.capabilities().reset and '--no-reset' not in final_argv and len(board_image_count): | ||
decsny marked this conversation as resolved.
Show resolved
Hide resolved
|
||
if board_image_count is not None: | ||
reset = True | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @nordicjm your PR #69748 made the initial change here with respect to board_image_count and the forced addition of reset. What we found is that the test here for not None is always true because board_image_count is instantiated but doesn't have any elements in it... so not None. This results in the runner always adding a reset to the gdb commands. I suspect, from your comment block above, that this wasn't your intention. We didn't notice this change because in the normal debug situation, you wouldn't care if the gdb did reset, load, reset if the image was being put in flash. But if you are targeting an image to a RAM space, the reset, load, reset causes the bootrom to load the flash image preventing you from debugging the image you created for RAM loading/debugging. In parallel to this PR being added, I just saw this other PR [#87138] (@VynDragon) that just merged to force the larger logic to NOT ignore the no-reset runner option. We could have done the same thing now that I see this but I'm still questioning the logic of "if board_image_count not None" when combined with the comment block about multiple images. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so in this particular case, the len(board_image_count) was 0 and we needed to have this check to keep the rest of your logic from doing another reset. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @nordicjm Do you have any more comments on this PR? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the change here doesn't make sense, it should never have a len of 0 so you need to look into what is causing that, this change is not acceptable though without some in depth analysis showing there is a bug and given this code is in use and works fine on multiple boards by multiple vendors... I'm not seeing it |
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -150,7 +150,10 @@ def do_run(self, command, **kwargs): | |
['-ex', f'target remote {self.gdb_host}:{self.gdb_port}']) | ||
|
||
if command == 'debug': | ||
gdb_cmd += [ '-ex', 'load', '-ex', 'monitor reset'] | ||
# If the flash node points to ram, linkserver treats | ||
# the ram as inaccessible and does not flash. | ||
gdb_cmd += ['-ex', 'set mem inaccessible-by-default off'] | ||
gdb_cmd += ['-ex', 'monitor reset', '-ex', 'load'] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is the order of load, reset being reversed to reset, load? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we are going to reset, we would want it to be before a load. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But I do see a typo I will fix in the next push if I don't get further comments There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yes, I see that is what you are doing, you are restating what it is that I said that am observing, my question was why. You should explain in the commit message also why you are reversing this order. I don't know why. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have updated the commit message, let me know if that helps! |
||
|
||
if command == 'attach': | ||
linkserver_cmd += ['--attach'] | ||
|
Uh oh!
There was an error while loading. Please reload this page.