-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Add support for debug and program launch configurations #9342
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
LGTM, but afaik, we're not testing this specific exporter in CI. @Cypress-OpenOCD Would you happen to have an example of something that this PR fixes/makes working? Something like a log or screenshot? |
@Cypress-OpenOCD @cmonr This exporter is named |
tools/export/cdt/__init__.py
Outdated
templates = ['%s.tmpl' % (self.target.lower())] + \ | ||
['%s.tmpl' % (label.lower()) for label | ||
in self.toolchain.target.extra_labels] + \ | ||
['%s.tmpl' % 'pyocd_settings'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As there are no target-specific templates, could we use the following instead:
templates = ["pyocd_settings.tmpl", "pyocd_settings_debug.tmpl", "pyocd_settings_program.tmpl"]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@theotherjimmy, I suggest to have 3 default templates: templates = ["pyocd_settings_debug.tmpl", "pyocd_settings_program.tmpl", "pyocd_settings_erase.tmpl"] . As I understood, the specific parameters should go through JSON file.
tools/export/cdt/__init__.py
Outdated
try: | ||
self.gen_file('cdt/%s' % templatefile, ctx, join('eclipse-extras', | ||
'{target}_{project}_{launch}.launch'.format(target=self.target, | ||
project=self.project_name, launch=templatefile))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation seems off here. Could you move target=
onto it's own line and reflow the other arguments?
tools/export/cdt/__init__.py
Outdated
self.gen_file('cdt/%s' % templatefile, ctx, join('eclipse-extras', | ||
'{target}_{project}_{launch}.launch'.format(target=self.target, | ||
project=self.project_name, launch=templatefile))) | ||
except TemplateNotFound: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just thought of this: without target-specific templates, there is no chance of missing templates. Could you get rid of the try-except here too?
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.gdbServerExecutable" value="${pyocd_path}/${pyocd_executable}"/> | ||
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.gdbServerFlashFastVerify" value="false"/> | ||
<intAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.gdbServerFlashMode" value="2"/> | ||
<intAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.gdbServerGdbPortNumber" value="3334"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the default template of pyocd_settings_debug.tml should be the same as pyocd_settings.tmpl. Specific port 3334 should be in the json file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rbatyuk Could you specify which json file you're referring to?
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.gdbServerHaltAtHardFault" value="false"/> | ||
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.gdbServerLog" value=""/> | ||
<!-- Remove target name(-t cy8c6xxa) once we have DAPLink support in KP3 --> | ||
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.gdbServerOther" value="-t cy8c6xxa -p 3333 --no-deprecation-warning"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the name of target should not be included in the default template
@rbatyuk, agree, there are some psoc6-related implementation in the templates. I cannot see any way to make 'generic' template without having some sort of set of target specific parameters somewhere, since some targets may require specific reset sequence etc. I am thinking about the similar approach that is used for the iar exporter. There are a set of defaults which can be redefined for the specific target (tools/export/iar/iar_definitions.json). If we make similar JSON for Eclipse we have single template per each use case (e.g. debug, program, erase) where some parameters may be added or redefined with their own flow. |
@Cypress-OpenOCD I prefer having a system like |
I am already working on that, looks like we could end up with a single template. |
I'm excited to see that! Will it be one template total? or 3, one each for debug/program/erase? |
Single template for all use cases. The concrete details would be implemented in the json. Hope it will work ;) |
Hi, please check out the reworked version of program/debug launch configurations support. In short: now there is single template for all launch configurations. Default and target-specific data comes from cdt_definitions.json. Thus, if some target require any custom sequence it may define it in the JSON file (like for CY8CPROTO_062_4343W). |
Please rebase your PR. A fix for the |
… template. Specific data comes from the JSON file
fa8c8c3
to
7a85ae7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor thing, then mention me so that I can approve and we can get this improvement in.
I labeled this for 5.11.3 , please review @theotherjimmy |
@0xc0170 I'm already reviewing this PR. |
I was asking for review the label (if this can go into 5.11.3 or not) |
@0xc0170 Thanks for the clarification. Yes, 5.11.3 is a fine target. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ya know what? I can make that change later. As pointed out, I missed the use of self. approval still stands.
Ok, thanks. |
The files are all focused around a specific vendor's exporter. It's not as clean as the "is the change udner TARGETS/*" soft rule that we use, but this should definitely be fine for 5.11.3. |
CI started |
Whoops. Started CI too soon, it's being stopped in the backgound. |
We are going to add GNU MCU Eclipse plugin support. It would be better to track the changes here. |
Test run: FAILEDSummary: 6 of 7 test jobs failed Failed test jobs:
|
Please review the changes made to support new GNU MCU Eclipse plug-in.
With these changes mbed export generates two sets of launch configurations: compatible with GNU ARM Eclipse, and GNU MCU Eclipse, therefore users may use plug-in they prefer. We are going to add few more kits on Monday, which may affect |
Overview of this pull request:
@theotherjimmy please review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of these comments are style nits or online compiler tweaks. The online compiler will load this file once and use it for many, many exporters. Therefore it is important to make sure that you don't modify any global state within the exporter to avoid accidentally copying settings between users exporting.
Co-Authored-By: Cypress-OpenOCD <39907069+Cypress-OpenOCD@users.noreply.github.com>
class Eclipse(Makefile): | ||
"""Generic Eclipse project. Intended to be subclassed by classes that | ||
specify a type of Makefile. | ||
""" | ||
def get_target_config(self, ctx, configuration): | ||
"""Retrieve info from cdt_definitions.json""" | ||
tgt = deepcopy(TARGET_MAP[self.target]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you need this deepcopy. Further, I think you only use tgt.name
which is always the same as self.target
.
def get_target_config(self, ctx, configuration): | ||
"""Retrieve info from cdt_definitions.json""" | ||
tgt = deepcopy(TARGET_MAP[self.target]) | ||
defaults = deepcopy(_CONFIGS_OPTIONS['default']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you modify defaults, so this copy may not be needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I think this may be kept to prevent any issues in case future updates
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Previous comments are not blocking.
CI started |
Test run: SUCCESSSummary: 12 of 12 test jobs passed |
Description
As of now the only one launch configuration is generated for the Eclipse which cannot cover all use cases. This PR is intended to extend support for different launch configurations (program, debug and erase) for the "cdt" exporter.
Pull request type
Reviewers
@theotherjimmy