-
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
Workaround to reset UARTE peripheral to be able to go into deep sleep #11779
Conversation
Would you refer this fix? |
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.
In #10924 we shied away from adding serial_free
to the destructor itself (for fear of breakage, using an untested HAL call), but similar changes are happening now in other classes - see #11746 - so I'm inclined to proceed with this now. (cc @mprse, @yarbcy, @bulislaw )
Just needs to be updated because of #10924
drivers/source/SerialBase.cpp
Outdated
@@ -272,6 +272,7 @@ SerialBase::~SerialBase() | |||
for (int irq = 0; irq < IrqCnt; irq++) { | |||
attach(NULL, (IrqType)irq); | |||
} | |||
serial_free(&_serial); |
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.
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.
Please rebase, this PR should contain just nrf52 fix - should be sufficient
If this is workaround, what is the real fix ? Using nordic driver did not fix the issue , did it? |
The rebase resulted in the commits that should not be here, please review |
@RobVlaar Your commit for nrf52 fix is also reverted. Can you create a branch from latest master and apply the patch there? You can create a new PR if that helps. Or I might be able if I have permission to write to your branch to resolve this, let me know |
yea something somewhere went terribly wrong, i'm still getting the hang of Github. |
Clean-up here should be fine. |
|
||
/* Turn NRF_UARTE0_BASE or NRF_UARTE1_BASE power off and on to reset peripheral. */ | ||
if (instance == 0) { | ||
*(volatile uint32_t *)0x40002FFC = 0; |
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.
These write to registers do not have equivalent in their driver (more readable than writing to magic addresses) ?
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 could use the NRF_UARTE0_BASE
address and add FFC to it which is the power register which isn't defined by nordic for this peripheral. This should be something for nordic to fix.
@0xc0170 I have given you permission. I have tried a few thing to clean the current branch but im clueless right now, maybe you can help me out ? |
I was able to update to the latest master but failed to push that fix to your branch unfortunately , permission denied |
I'll create a new PR, a sec |
see #11790 |
Description
Resolves: #11758
Pull request type
Added workaround to reset the UARTE peripheral on a destruction of SerialBase to be able to go into deep sleep.
Pull request type (required)
Test results (required)
Reviewers (optional)
@0xc0170