-
Notifications
You must be signed in to change notification settings - Fork 3k
STM32L0/4 Enable use of LPUART in stop mode #5941
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
Conversation
Automatic CI verification build not done, please verify manually. |
Hi |
Now that I've learned that normal uarts can also wake up from stop mode I'm wondering if this PR isn't a bit shortsighted to only address the LP uart. For the wake up to work we have to use the LSE or HSI for the uart clock. If we change the preferred clock from SYSCLK to HSI we might run into some issues when the device is clocked by an HSE and the HSI gets disabled. I don't know if its better to do this in a separate PR after this one is merged or do it here. |
@marcemmers @jeromecoutant I've removed the Needs PR label for now, since the second link referenced is an issue. We'll change it back once #5943 turns into a PR. |
@cmonr In my eyes #5943 is not really necessary for this PR to be implemented. I might have worded is poorly in my first description seeing that this PR is not really useful until the SerialBase functionality is modified but it can still be implemented. My question from my earlier comment is still valid though |
@jeromecoutant @bcostm Suggestions for this pull request? SerialBase attach and locking is a separate issue. I am interested in the target side things if this PR would be beneficial for the current version as it is |
@@ -393,32 +393,30 @@ void serial_baud(serial_t *obj, int baudrate) | |||
struct serial_s *obj_s = SERIAL_S(obj); | |||
|
|||
obj_s->baudrate = baudrate; |
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.
Not related to this PR, but maybe put back the previous baudrate if the init_uart function has returned a FAIL ?
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.
We could but it still doesn't really notify you that the operation has failed. You would have to check wat the actual baudrate is after te operation to verify it succeeded.
@marcemmers Could you rebase this PR instead of merging it, while we wait for @jeromecoutant'd feedback? |
e276d1a
to
7881e68
Compare
Should be ok now @cmonr |
👍 @jeromecoutant @bcostm Please review |
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.
LGTM
/morph build |
Build : SUCCESSBuild number : 1080 Triggering tests/morph test |
Test : SUCCESSBuild number : 887 |
Exporter Build : FAILUREBuild number : 757 |
Windows export machine closed too soon. |
/morph export-build |
Exporter Build : SUCCESSBuild number : 768 |
@marcemmers Can you sign please https://os.mbed.com/contributor_agreement/ ? |
@0xc0170 I thought I already did? If I click on the link it says i have already signed it 24 januari. I have linked this account my mbed account under account settings -> connected accounts -> github. |
Whats your nick? I could not locate marcemmers |
@0xc0170 its memmers, it was already taken on github ;) |
Description
Working on using the LPUART in stop mode.
Always switching to LSE when available when baudrates are below or equal to 9600.
This is at least still blocked by the
SerialBase::attach()
wheresleep_manager_lock_deep_sleep()
is called.Status
IN DEVELOPMENT
Deploy notes
This breaks when compiling on an STM32L4 because the HAL doesn't have the function
HAL_UARTEx_EnableClockStopMode()
. The HAL should have the same function as the STM32L0 has because the peripheral also has the same settings. For example, see chapter 41.4.11 of the ST RM0351 and the UCESM bit in CR3.