Skip to content
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: add lpuart_clock_source config #7326

Merged
merged 2 commits into from
Jun 30, 2018

Conversation

bcostm
Copy link
Contributor

@bcostm bcostm commented Jun 26, 2018

Description

This PR allows to change the LPUART1 source clock using a JSON file. Previously the clock source was fixed to LSE and PCLK1 and it was not possible to use HSI clock. Note that the default clock configuration is the same as before this PR (i.e. LSE and PCLK1).

If you want to use only the HSI clock instead, write the following in the mbed_app.json file:

"target_overrides": {
    "NUCLEO_L476RG":  {
        "target.lpuart_clock_source": "USE_LPUART_CLK_HSI",
        "target.clock_source": "USE_PLL_HSI"
    }
}

Should fix Issue #7315

Pull request type

[X] Fix
[ ] Refactor
[ ] New target
[ ] Feature
[ ] Breaking change

@cmonr cmonr requested a review from jeromecoutant June 27, 2018 02:09
Copy link
Contributor

@cmonr cmonr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine aside for a doc question.

@@ -730,6 +730,10 @@
"help": "Define if a Low Speed External xtal (LSE) is available on the board (0 = No, 1 = Yes). If Yes, the LSE will be used to clock the RTC, LPUART, ... otherwise the Low Speed Internal clock (LSI) will be used",
"value": "1"
},
"lpuart_clock_source": {
"help": "Define the LPUART clock source. Mask values: USE_LPUART_CLK_LSE, USE_LPUART_CLK_PCLK1, USE_LPUART_CLK_HSI",
"value": "USE_LPUART_CLK_LSE|USE_LPUART_CLK_PCLK1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this also list USE_LPUART_CLK_HSI?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did it on purpose to not change the actual behavior. If the HSI is added here then it has also to be added in the system clock source selection. And it is not the case for all the boards... That's why I didn't add it here...

cmonr
cmonr previously approved these changes Jun 27, 2018
@cmonr
Copy link
Contributor

cmonr commented Jun 27, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Jun 28, 2018

Build : SUCCESS

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

Triggering tests

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

@mbed-ci
Copy link

mbed-ci commented Jun 28, 2018

@mbed-ci
Copy link

mbed-ci commented Jun 28, 2018

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 28, 2018

@jeromecoutant Happy with the changes? One note, that there is coding style update. It is ready to get in but will cause some others to be rebased in some cases. If there is any priority, let us know. Otherwise I would recommend to get that style update first and the rest rebased if needed (the biggest change goes in first as otherway around you will end up rebasing it often).

@jeromecoutant
Copy link
Collaborator

Yes, please merge #7351 first...
@bcostm will rebase after :-)

@cmonr
Copy link
Contributor

cmonr commented Jun 28, 2018

@jeromecoutant @bcostm Rebase at will!

Keep same clock configuration as done before this PR (LSE and PCLK1).
Use a JSON file to change it.
@bcostm
Copy link
Contributor Author

bcostm commented Jun 29, 2018

Rebase done !

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 29, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Jun 29, 2018

Build : SUCCESS

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

Triggering tests

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

@mbed-ci
Copy link

mbed-ci commented Jun 29, 2018

@mbed-ci
Copy link

mbed-ci commented Jun 29, 2018

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

Successfully merging this pull request may close these issues.

5 participants