-
Notifications
You must be signed in to change notification settings - Fork 544
Final prerequisites to improve debugger output #454
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
64b05d3
Fix stack trace debug level check
henrygab 4565d0c
Use uppercase PRINTF.
henrygab decde55
Use `Print` class reference
henrygab b8fb0cd
Add locations for two additional defines.
henrygab 03805f3
Define PRINTF macro regardless of debug level.
henrygab 7777bd9
Enable CI
henrygab 47d1b4d
Add defaults to global platforms.txt
henrygab 7fab012
Undo accidental change
henrygab f532a27
And disable Travis-CI once again.
henrygab 2709813
More printf() --> PRINTF() conversion
henrygab File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add defaults to global platforms.txt
- Loading branch information
commit 47d1b4d23f33c537e6d9a6fe38b227053cfce3d6
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@henrygab can we skip to include CFG_LOGGER and CFG_SYSVIEW in the
platforms.txt. Let's just enable them based on teh CFG_DEBUG value. If you want to enable it in other scenario, just modify the source directly. Would that make sense ??Uh oh!
There was an error while loading. Please reload this page.
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.
Hi @hathach,
Thank you for the review.
Two questions, each with their own answer. The short answer is that editing the source files in the BSP does not make sense in many scenarios. Let me address each in turn...
[Click to expand] As to CFG_LOGGER...
Summary good news: As requested, I have no plans to update the
boards.txtfile to override these in the BSP. As you indicate, the value can be updated by advanced users by editing the source code of the BSP.At the same time, it is desirable to ensure Arduino-standard extensibility points remain open, especially when they are particularly useful in classroom settings. Let me explain...
[Click to expand] Extensibility and why the default value was added
As you know, Arduino allows a overriding settings via a
boards.local.txtfile. This is an extremely useful setting for a teacher / IT staff to enable custom menu options, although I understand that you yourself would never use this file. This functionality is an Arduino standard, and part of the flexibility that the Arduino ecosystem provides -- IT staff / teachers can provide a customizedboards.local.txtto allow students to:Here, the long-term goal is to enable choice of alternative (e.g., higher-speed, lower-overhead) debug logging via this extensibility mechanism ... Critically, without editing the BSP files. After all, having a classroom use git (instead of the Board Manager) is not a desirable outcome ... it just adds too many layers of complexity when the goal is to teach coding. At the same time, they may need both Serial ports for their project, and thus need to redirect the debug output to an LCD, to a file, etc.
While the entire line could technically be duplicated in an IT-provided
platform.local.txt, the maintenance complexity is directly proportional to the length of the lines being added. Thebuild.flags.nrfsetting line is one of the longest, and thus it is preferable to lay the groundwork to provide an alternative. (Yes, I know you don't use this feature.)I initially simply attempted to add the variables
{build.logger_flags} {build.sysview_flags}in , without providing a default value. Really. It's in the commit history.Unfortunately, without a default value, compilation fails. Therefore, a default value was necessary to avoid encumbering the Arduino
.local.txtfeature.Because having a default value does not cause any compilation or maintenance problem, and because I am supporting your request not to add these options to the BSP's
boards.txtlist of options, this has no effect. Thus, I added this commit, not because I forgot or ignored your earlier request to use the sources files (rather than the BSP'sboards.txtfile), but as a minimum necessary compromise to achieve your request while ensuring a smooth path forward for the goal of enabling alternate debug outputs.BUT DO NOT FEAR...
Finally, I want to assure you that, although I had to add the default value into
platforms.txtto allow this to build, I have every intention of continuing to support your request to NOT change the BSP'sboards.txt-- I will not add the extra debug menu items there unless you request it, which is in line with your earlier feedback.[Click to expand] As to CFG_SYSVIEW...
I'm glad you understand that enabling of SYSVIEW may be desirable, without also enabling the verbose logging that a debug level of 3+ causes. Normal debug level of 3+ simply causes too much overhead, hides timing-related bugs, and prevents use of SYSVIEW for any performance analysis.
As you can see, this PR does not change the existing behavior:
boards.txtoptions enable SYSVIEW when debug level is set to 3+As noted above with respect to CFG_LOGGER, this PR lays the groundwork to allow this advanced functionality to be enabled, without requiring the user to edit BSP files. This is important in classrooms and maker spaces, and even for online tutuorials. (again, see more comprehensive explanation in prior section on the Arduino extensibility points).
Therefore, please accept this small addition, as it is necessary to simplify use of the standard Arduino extensibility points.
The Adafruit Feather nRF52840 Express is the only Feather with the built-in 10-pin debug header, and so is uniquely positioned for advanced classes, and provides a wonderful bridge when advancing users from Arduino to more advanced environments { platform.io, Segger Embedded Studio }. I like this board.
The PR has zero functional change, has zero GUI changes (no menu options), and simultaneously makes forward progress to enable Arduino extensibility points for advanced class use.
Furthermore, I am actively ensuring your prior (and current) concerns are being addressed. I have no plan for the next PRs to add any menu items, or to otherwise change the default logger of the BSP.
Please reconsider!
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.
@henrygab thanks for detail explanation, I am not aware of the use case of board/platforms.local.txt in the class/workshop as you mentioned. That is indeed a good scenario. Can I have my last attempt to ask you to bundle the
build.logger_flags + build.sysview_flagsinto 1 flag, maybe build.rtt_flags, build.extra_debug_flags, or anything that makes sense to you e.g