Skip to content

STM32 UART init update #5570

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

Merged
merged 3 commits into from
Jan 4, 2018
Merged

Conversation

jeromecoutant
Copy link
Collaborator

Description

  • serial_init, serial_free and serial_baud functions moved from serial_device.c (specific to each STM32 family) to serial_api.c (common STM32 file)

  • default baudrate value was hardcoded to 9600

    • Value is set now to MBED_CONF_PLATFORM_STDIO_BAUD_RATE for STDIO
    • Value is set now to MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE for other use
  • UART init will not be stopped before calling serial_baud function

  • for LPUART, init procedure can update the clock source depending on expected baudrate

This should close #5389 issue

Status

READY

Tests

OS2 and OS5 tests verified for all STM32 targets

- serial_init, serial_free and serial_baud function moved from serial_device.c (specific to each STM32 family) to serial_api.c (common STM32 file)
- default baudrate value was hardcoded to 9600
  - Value is set now to MBED_CONF_PLATFORM_STDIO_BAUD_RATE for STDIO
  - Value is set now to MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE for other use
- UART init will not be stopped before calling serial_baud function
#if defined (TARGET_STM32F091RC)
#define UART_NUM (8)
#if defined (TARGET_STM32F031K6)
#define UART_NUM (1
Copy link
Contributor

Choose a reason for hiding this comment

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

a parenthesis is missing ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, I didn't see this build failure in the non reg tests... :-(

#define UART_NUM (6)
#elif defined (TARGET_STM32F429xI) || defined (TARGET_STM32F439xI) || defined (TARGET_STM32F437xG) || defined (TARGET_STM32F469xI)
#define UART_NUM (8)
#elif defined (TARGET_STM32F413xH)
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe merge this #elif and the #else below ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done


// #include "cmsis.h"
Copy link
Contributor

Choose a reason for hiding this comment

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

remove this dead code ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 24, 2017

@jeromecoutant Please look at travis failure, related to the changesets

Copy link
Collaborator Author

@jeromecoutant jeromecoutant left a comment

Choose a reason for hiding this comment

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

Updates done (Travis will also be OK)
Thx for the code review

#if defined (TARGET_STM32F091RC)
#define UART_NUM (8)
#if defined (TARGET_STM32F031K6)
#define UART_NUM (1
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, I didn't see this build failure in the non reg tests... :-(

#define UART_NUM (6)
#elif defined (TARGET_STM32F429xI) || defined (TARGET_STM32F439xI) || defined (TARGET_STM32F437xG) || defined (TARGET_STM32F469xI)
#define UART_NUM (8)
#elif defined (TARGET_STM32F413xH)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done


// #include "cmsis.h"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

done

@jeromecoutant
Copy link
Collaborator Author

/morph test

@0xc0170
Copy link
Contributor

0xc0170 commented Dec 5, 2017

/morph build

@mbed-ci
Copy link

mbed-ci commented Dec 5, 2017

Build : SUCCESS

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

Triggering tests

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

@mbed-ci
Copy link

mbed-ci commented Dec 5, 2017

@mbed-ci
Copy link

mbed-ci commented Dec 5, 2017

@kegilbert
Copy link
Contributor

We have seen related test failures intermittently, retesting to confirm.
/morph test

@mbed-ci
Copy link

mbed-ci commented Dec 6, 2017

@0xc0170
Copy link
Contributor

0xc0170 commented Dec 7, 2017

@jeromecoutant Getting a failure that we have seen earlier :/ Do you have the target to reproduce this failure?

/morph test

@jeromecoutant
Copy link
Collaborator Author

Failure is not related to the PR... it is a known issue: #5622

@mbed-ci
Copy link

mbed-ci commented Dec 7, 2017

@jeromecoutant
Copy link
Collaborator Author

Could this PR be merged ?
Thx

@0xc0170
Copy link
Contributor

0xc0170 commented Dec 13, 2017

/morph build

@0xc0170
Copy link
Contributor

0xc0170 commented Dec 14, 2017

/morph build

@mbed-ci
Copy link

mbed-ci commented Dec 14, 2017

Build : SUCCESS

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

Triggering tests

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

@mbed-ci
Copy link

mbed-ci commented Dec 14, 2017

@mbed-ci
Copy link

mbed-ci commented Dec 14, 2017

@0xc0170
Copy link
Contributor

0xc0170 commented Dec 14, 2017

The failure is known, being investigated, hopefully resolved soon

@jeromecoutant
Copy link
Collaborator Author

The failure is known,

So it can be merged ? :-)

@0xc0170
Copy link
Contributor

0xc0170 commented Dec 15, 2017

Green policy here 🍏 📗 needs to get green

@0xc0170
Copy link
Contributor

0xc0170 commented Dec 22, 2017

/morph test

@mbed-ci
Copy link

mbed-ci commented Dec 22, 2017

@adbridge
Copy link
Contributor

/morph test

@mbed-ci
Copy link

mbed-ci commented Dec 29, 2017

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 3, 2018

Needs to be rebuild I believe

/morph build

@mbed-ci
Copy link

mbed-ci commented Jan 3, 2018

Build : SUCCESS

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

Triggering tests

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

@mbed-ci
Copy link

mbed-ci commented Jan 3, 2018

@mbed-ci
Copy link

mbed-ci commented Jan 3, 2018

Test : SUCCESS

Build number : 618
Test logs :http://mbed-os-logs.s3-website-us-west-1.amazonaws.com/?prefix=logs/5570/618

@0xc0170
Copy link
Contributor

0xc0170 commented Jan 3, 2018

🍏 Green !

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.

NUCLEO_L476RG : LPUART1 cannot be used
7 participants