-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
stm32: pm: Enable to driver JTAG port pns to analog when not required #63495
stm32: pm: Enable to driver JTAG port pns to analog when not required #63495
Conversation
#include <zephyr/drivers/gpio.h> | ||
#include <zephyr/init.h> | ||
|
||
#if !defined(CONFIG_DEBUG) && defined(CONFIG_PM) |
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.
is CONFIG_PM
a strict condition here?
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.
If CONFIG_PM
is not a condition, it would mean that you can't use gdb unless CONFIG_DEBUG is set, which is not a condition today.
I already foresee that I will get tens of questions around this..
Using CONFIG_PM
, I don't break anything as gdb can't be used today with CONFIG_PM unless CONFIG_DEBUG is set.
5911c1d
to
45c54db
Compare
The following west manifest projects have been modified in this Pull Request:
Note: This message is automatically posted and updated by the Manifest GitHub Action. |
45c54db
to
b74881e
Compare
b74881e
to
3c69c6a
Compare
OpenOCD can now be used to flash and debug nucleo_wba52cg. However it required use of STMicroelectronics OpenOCD fork. Add instructions on how to use it. Signed-off-by: Erwan Gouriou <[email protected]>
&debug_jtdi_pa15 &debug_jtdo_swo_pb3 | ||
&debug_jtrst_pb4>; | ||
pinctrl-1 = <&analog_pa13 &analog_pa14 &analog_pa15 | ||
&analog_pb3 &analog_pb4>; |
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'm not sure the dtsi is the best place to put that since the pins can be used for something else than debug.
For example, in the nucleo_wba55cg.dts, PA15, PB3 and PB4 are used for SPI1. Depending on the order of initialization, I think it could result in drivers not functioning.
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.
Right, so we should make sure this is done before configuring any other device and change priority
SW/JTAG signals description are useful when we don't need them. Signed-off-by: Erwan Gouriou <[email protected]>
At chip startup, jtag pins are configured by default to enable debug. This configuration adds consumption and when using PM profile, we can save ~40uA by resetting this configuration and setting pins to analog mode. Signed-off-by: Erwan Gouriou <[email protected]>
Provide jtag port pins description, so they can be used to be set in analog mode when not required to save power (around 40uA saved in total). Signed-off-by: Erwan Gouriou <[email protected]>
In some cases, PINCTRL_STATE_SLEEP may be required even when CONFIG_PM_DEVICE is not defined. One example is the possibility/need to put JTAG pins to analog when CONIG_PM=y and CONFIG_DEBUG=n. Signed-off-by: Erwan Gouriou <[email protected]>
3c69c6a
to
8fbf9bd
Compare
@gautierg-st PTAL |
During the migration to Hw model V2 the PR zephyrproject-rtos#63495 was not fully reported. This change is adding the support Serial Wire / JTAG port pins Signed-off-by: Francois Ramu <[email protected]>
During the migration to Hw model V2 the PR #63495 was not fully reported. This change is adding the support Serial Wire / JTAG port pins Signed-off-by: Francois Ramu <[email protected]>
During the migration to Hw model V2 the PR zephyrproject-rtos#63495 was not fully reported. This change is adding the support Serial Wire / JTAG port pins Signed-off-by: Francois Ramu <[email protected]>
Configuring JTAG port pins in analog when not required (build time) can save few uA.
Requires #64109
Note:
This operation can also be done using pinctrl API, which would allow dynamic handling of the pins (JTAG function are alternate functions which can't be configured using GPIO API)
Main reason to push this PR using GPIO API is that this is my first shot at this. If everyone agrees this is good enough, this is fine with me