-
Notifications
You must be signed in to change notification settings - Fork 8k
Add nrf_coresight driver #95124
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 nrf_coresight driver #95124
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.
Looks ok. One more thing that might be added is early logging on app. On sdfw there was a RAM buffer (CONFIG_LOG_FRONTEND_STMESP_EARLY_BUF_SIZE
!=0) that was collecting logging data and flushing it to STM when system notified that ETR is ready. using log_frontend_stmesp_etr_ready()
. Now it should be done on app but it can be added later as well.
} | ||
} | ||
|
||
err = ironside_se_tdd_configure(IRONSIDE_SE_TDD_CONFIG_ON_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.
Recently I wanted to use DWT->CYCCNT for accurate code execution measurement. On nrf54hx I had to power up TDD (or use debug session). I wonder if there are other use cases where app would like to power up TDD. Maybe there should be tdd-on-only
default mode?
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.
Yes good idea, you are right there is quite a bit in the coresight subsystem that'd be nice to use without having to handle a full blown mode (beyond power up tdd and pinctrl) in the coresight driver. This will also be convenient to use with ETM, as there coresight can be configured externally from a debugger.
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 added CORESIGHT_NRF_MODE_UNCONFIGURED
to indicate coresight subsystem is active but unconfigured, so that pinctrl and tdd power are handled, but the coresight peripherals themselves remain at reset values
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.
Driver should be using HAL and fixups should be added to the nrfx.
You mean the nrf hal? There is no nrf hal for the coresight peripherals, these aren't nordic IPs, they come from ARM. How about I add a coresight.h header where the coresight peripherals are defined in an MDK like fashion but no reference to NRF types but instead ARM__Type? Could I then write straight to such |
Sounds good, then the driver could be vendor-agnostic - |
for STMESP I did https://github.com/zephyrproject-rtos/zephyr/blob/8d508a2f94970561b696a87feb35132c4a9dcc1a/include/zephyr/drivers/misc/coresight/stmesp.h. Are the funnels architecture in TDD Nordic specific? |
Yes I am looking into something like this for the coresight peripherals. I was going to do something without structs for the register map but OFFSET definitions but this actually does look nicer, so I'll change it to that.
The funnels aren't nordic specific, but the way the whole trace and debug domain is setup is highly nordic specific, so the way all the different funnel and replicators link together various trace data sources and sinks. So I still plan to have a coresight_nrf that just configures all of those in one go and assume this design will hold for other users as well. |
d6e0812
to
324b0a4
Compare
324b0a4
to
4191458
Compare
Added an entry into the migration guide for it |
Migration guide for the move of drivers/misc/nrf_etr to drivers/debug/debug_nrf_etr. Signed-off-by: Karsten Koenig <[email protected]>
Pinctrl needs to set the needed drive and direction of the pins. Also this later allows automatically setting the clock bit for the traceclk pin. Signed-off-by: Karsten Koenig <[email protected]>
Added driver and bindings for the coresight nrf submodule. add integrated it for the nrf54h20. The coresight subsystem is a combination of ARM Coresight peripherals that get configured together to achieve a simplified configuration based on a desired operating mode. This also replaces the previous handling in the nrf54h20 soc.c which was powering the subsystem up but not configuring it. Signed-off-by: Karsten Koenig <[email protected]>
Replaced the old tddconf with the full coresight driver that configures the coresight peripherals locally on the running core. Also fixed minor bug in the corresponding sample where messages were not shown for the radio core. Signed-off-by: Karsten Koenig <[email protected]>
Make sure the nordic_vpr_launcher gets started after the coresight driver if that is present. Signed-off-by: Karsten Koenig <[email protected]>
Added a new convience snippet to redirect logs to STM and then sink them to TPIU where they can be captured by a trace probe. Signed-off-by: Karsten Koenig <[email protected]>
The JLinkScript originally configured more than needed which reduces readability, so stripped it down to the minimum. At the same time improved behavior under reset and added ETM to the radiocore JLinkScript. Signed-off-by: Karsten Koenig <[email protected]>
48d90ba
4191458
to
48d90ba
Compare
|
@nordic-krch there were already 3 assignees on this, can you please document and elaborate on why you self-assigned? |
@kartben I was the initial author of coresight/STM Nordic support in Zephyr so most of modified files are were created by me. I don't think that @anangl @masz-nordic @bjarki-andreasen have much expertise in that area so I would not expect a review from them. |
I should probably have added myself as the maintainer before. |
The coresight subsystem for the Nordic Haltium family of devices is a combination of different coresight modules that can be used in combination for logging, data tracing, instruction tracing etc.
This adds a driver and bindings for the coresight subsystem that powers and then applies a configuration based on a selected operating mode. It replaces the previous system where the configuration was applied by a closed-source firmware bit.
This also adds the needed pinctrl handling for trace pins.
Furthermore the existing samples and snippets are adjusted accordingly.