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: AnalogOut: do not call HAL_DAC_Start in dac_write #14423

Merged
merged 1 commit into from
Mar 12, 2021

Conversation

mczerski
Copy link

@mczerski mczerski commented Mar 12, 2021

Summary of changes

dac_write (used by AnalogOut.write) calls HAL_DAC_Start
every time. It is required to call HAL_DAC_Start only once.
HAL_DAC_Start uses internally HAL_Delay(1) making AnalogOut
not suitable for use in high speed application.
This change removes call to HAL_DAC_Start in dac_write and
moves it to analogout_init.

Impact of changes

Call to AnalogOut.write for STM32 is at least 1ms faster.

Documentation

None


Pull request type

[X] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

Tested on STM32G474RE with oscilloscope by generating "sawtooth" signal.

[] No Tests required for this change (E.g docs only update)
[] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR


dac_write (used by AnalogOut.write) calls HAL_DAC_Start
every time. It is required to call HAL_DAC_Start only once.
HAL_DAC_Start uses internally HAL_Delay(1) making AnalogOut
not suitable for use in high speed application.
This change removes call to HAL_DAC_Start in dac_write and
moves it to analogout_init.
@ciarmcom ciarmcom added the release-type: patch Indentifies a PR as containing just a patch label Mar 12, 2021
@ciarmcom
Copy link
Member

@mczerski, thank you for your changes.
@ARMmbed/mbed-os-maintainers please review.

Copy link
Collaborator

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

I have only 1 simple DAC test in CI....
But test wit hall STM32 families is OK

@mergify mergify bot added needs: CI and removed needs: review labels Mar 12, 2021
@0xc0170
Copy link
Contributor

0xc0170 commented Mar 12, 2021

CI started

@mbed-ci
Copy link

mbed-ci commented Mar 12, 2021

Jenkins CI Test : ✔️ SUCCESS

Build Number: 1 | 🔒 Jenkins CI Job | 🌐 Logs & Artifacts

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_cmake-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_cmake-example-ARM ✔️
jenkins-ci/mbed-os-ci_unittests ✔️
jenkins-ci/mbed-os-ci_build-greentea-ARM ✔️
jenkins-ci/mbed-os-ci_build-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-greentea-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-cloud-example-ARM ✔️
jenkins-ci/mbed-os-ci_greentea-test ✔️
jenkins-ci/mbed-os-ci_cmake-example-test ✔️

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.

6 participants