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
RFC: cmake: add nrf_pin_report target #24132
RFC: cmake: add nrf_pin_report target #24132
Conversation
All checks are passing now. Tip: The bot edits this comment instead of posting a new one, so you can check the comment's history to see earlier messages. |
e06dc44
to
8f4c14c
Compare
Tweaked the output a bit. Updated the description. @tejlmand what do you think about putting the cmake target into soc/arm/nordic_nrf/CMakeLists.txt or so? |
8f4c14c
to
22a5684
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.
Think we should find a better location for the CMake code.
add_custom_target( | ||
nrf_pin_report | ||
DEPENDS | ||
${ZEPHYR_BASE}/scripts/dts/nrf_pin_report.py | ||
COMMAND | ||
${PYTHON_EXECUTABLE} | ||
${ZEPHYR_BASE}/scripts/dts/nrf_pin_report.py | ||
--dts ${ZEPHYR_DTS} | ||
--bindings-dirs ${DTS_ROOT_BINDINGS} | ||
USES_TERMINAL | ||
) |
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 think this is too nRF specific at current stage, to be a build target we want on all boards.
For example, having a ninja nrf_pin_report
if my board is sam4s_explained
is a bit weird.
Could we place this code in a dedicated cmake file, and only include it for nRF boards ?
Similar to how boards/common/nrfjprog.board.cmake
is included ?
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.
Edit: somehow I hit the GitHub keyboard shortcut for 'send' too soon
I think this is too nRF specific at current stage, to be a build target we want on all boards.
To be clear, this is just an RFC to show what we can do for Nordic.
That is why I wrote this in the description:
This is just an RFC for now because I'm playing dirty tricks
And for emphasis, I do not want to solve this for other boards. Nordic SoCs are the only ones whose devicetrees are used in this way to encode pin mux information and there are a lot of changes going on in other SoCs in this regard right now, so it's not stable.
This is why I named the target nrf_pin_report instead of something else.
Now, the question is, is this worth having in mainline, just for Nordic SoCs and properly scoped and organized, at all, or not?
FInding what others think about the answer to this question is the purpose of the RFC.
If "yes", we can work on cleaning it up. If "no", I will continue to maintain this out of tree. But I've had users ask me how they can figure out pin maps and pin conflicts, so I personally think this is generally useful.
think this is more a board thing, and we already have board specific cmake files in |
For sure, none of the code is in the right place. I just wanted to get something working for an RFC. This is more an SoC thing than a board thing, though, isn't it? The SoC pins depend just as much on the application as the board. But the possible pins are determined by the SoC, not board or application. |
yeah, and I think it's a great start.
This highly depends on perspective. However, reading out the actual configuration, then I agree, this is a SoC thing, cause in that case, you don't care on what is possible. You care about actual configuration. Which brings up next part. Do we want to divide the config perspective from the reading perspective ? I think both SoC and board can be reasoned to be the right choice, and have no strong opinion on one over the other.
I think it is worth having this in mainline. One concern I do have, is that this only covers dts. |
I think it's worth having (though it's not something I've specifically looked for in Zephyr yet), and it should start as Nordic-specific because I suspect users of pinmux-based SOCs will need a very different sort of information. |
I'd rather see us produce something like this that can be used on the majority of boards/SoCs. I think having a 'port' & 'pin' concept in EDT would be more generic and we could than work up a tool across multiple SoCs. |
That's a worthy long term goal, for sure, but I don't see that as being a blocker for getting something like this enabled for SoCs that support it today. We can always rework it in the future so |
You'd think so, but it isn't simple at all to do this for other SoCs. People have been working on DTS-based pinmux for other platforms for years; it's still ongoing work. Nordic's hardware design makes it uniquely easy to do pinmux with existing DTS infrastructure. Hopefully we will start to see code for other platforms getting merged within the next release or two, but I don't want to wait for that if Nordic is able to do this now, especially since we can have this as example code / a source of inspiration for others.
Thanks.
There is simply no way to predict what an application will do at runtime. This is purely meant to be a check of what the build-time pinmux is. |
Then i'm happy with the proposal.
The nRF name, it is.
Exactly. And those participating in this review knows that. But this does not reduce the value of the command. |
Sure, I can make the output say something like "Build-time pin report" or so -- will that address the concern? |
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
This target prints the devicetree's pin map to standard out. It only works for Nordic SoCs. Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
22a5684
to
1622a24
Compare
I still think this can be worked into mergeable shape, even if it's buried in an SoC specific part of the build system, so rebased and removed stale label. |
This target prints the devicetree's pin map to standard out. It only works for Nordic SoCs.
This is just an RFC for now because I'm playing dirty tricks, but it's working so far:
I hate hunting for pins, and I hate having to grep zephyr.dts to look for conflicts, so this is useful enough for me to maintain out of tree for myself. But I thought I'd share in case we can find a way to mainline this if it's interesting to others.