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

STM32L0/4 Enable use of LPUART in stop mode #5941

Merged
merged 2 commits into from Feb 12, 2018

Conversation

Projects
None yet
6 participants
@marcemmers
Contributor

marcemmers commented Jan 25, 2018

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() where sleep_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.

@mbed-ci

This comment has been minimized.

mbed-ci commented Jan 25, 2018

Automatic CI verification build not done, please verify manually.

@jeromecoutant

This comment has been minimized.

Contributor

jeromecoutant commented Jan 25, 2018

Hi
I am checking the L4 issue... strange...
Thx

@jeromecoutant

This comment has been minimized.

Contributor

jeromecoutant commented Jan 26, 2018

This PR needs #5947 and #5943

@marcemmers

This comment has been minimized.

Contributor

marcemmers commented Jan 29, 2018

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.

@cmonr

This comment has been minimized.

Contributor

cmonr commented Jan 30, 2018

@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.

@marcemmers

This comment has been minimized.

Contributor

marcemmers commented Jan 30, 2018

@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

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Jan 31, 2018

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.

@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;

This comment has been minimized.

@bcostm

bcostm Jan 31, 2018

Contributor

Not related to this PR, but maybe put back the previous baudrate if the init_uart function has returned a FAIL ?

This comment has been minimized.

@marcemmers

marcemmers Feb 2, 2018

Contributor

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.

@cmonr

This comment has been minimized.

Contributor

cmonr commented Feb 5, 2018

@marcemmers Could you rebase this PR instead of merging it, while we wait for @jeromecoutant'd feedback?

@marcemmers marcemmers force-pushed the marcemmers:lpuart-use-lse branch from e276d1a to 7881e68 Feb 6, 2018

@marcemmers

This comment has been minimized.

Contributor

marcemmers commented Feb 6, 2018

Should be ok now @cmonr

@0xc0170 0xc0170 added needs: review and removed needs: work labels Feb 6, 2018

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Feb 6, 2018

Should be ok now @cmonr

👍

@jeromecoutant @bcostm Please review

@bcostm

bcostm approved these changes Feb 7, 2018

LGTM

@0xc0170 0xc0170 added needs: CI and removed needs: review labels Feb 7, 2018

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Feb 7, 2018

/morph build

@mbed-ci

This comment has been minimized.

mbed-ci commented Feb 7, 2018

Build : SUCCESS

Build number : 1080
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/5941/

Triggering tests

/morph test
/morph uvisor-test
/morph export-build

@mbed-ci

This comment has been minimized.

@mbed-ci

This comment has been minimized.

@cmonr

This comment has been minimized.

Contributor

cmonr commented Feb 7, 2018

Windows export machine closed too soon.
/morph export-build

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Feb 8, 2018

/morph export-build

@mbed-ci

This comment has been minimized.

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Feb 8, 2018

@marcemmers

This comment has been minimized.

Contributor

marcemmers commented Feb 9, 2018

@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.

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Feb 9, 2018

@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

@marcemmers

This comment has been minimized.

Contributor

marcemmers commented Feb 9, 2018

@0xc0170 its memmers, it was already taken on github ;)

@cmonr cmonr merged commit 84ee9cc into ARMmbed:master Feb 12, 2018

19 checks passed

AWS-CI uVisor Build & Test Success
Details
ci-morph-build build completed
Details
ci-morph-exporter build completed
Details
ci-morph-test test completed
Details
continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
mbed-ci-generic Build finished.
Details
travis-ci/docs Local docs testing has passed
Details
travis-ci/events Local events testing has passed
Details
travis-ci/littlefs Local littlefs testing has passed
Details
travis-ci/mbed2-ATMEL Local mbed2-ATMEL testing has passed
Details
travis-ci/mbed2-MAXIM Local mbed2-MAXIM testing has passed
Details
travis-ci/mbed2-NORDIC Local mbed2-NORDIC testing has passed
Details
travis-ci/mbed2-NUVOTON Local mbed2-NUVOTON testing has passed
Details
travis-ci/mbed2-NXP Local mbed2-NXP testing has passed
Details
travis-ci/mbed2-RENESAS Local mbed2-RENESAS testing has passed
Details
travis-ci/mbed2-SILICON_LABS Local mbed2-SILICON_LABS testing has passed
Details
travis-ci/mbed2-STM Local mbed2-STM testing has passed
Details
travis-ci/tools Local tools testing has passed
Details

@cmonr cmonr removed the ready for merge label Feb 12, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment