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 FLASH API : add critical sections #13914

Merged
merged 1 commit into from
Nov 24, 2020
Merged

Conversation

JeanMarcR
Copy link
Contributor

@JeanMarcR JeanMarcR commented Nov 17, 2020

See PR #13802 (for F4 board)

Concerned boards are

STM32F0
STM32F1
STM32F2
STM32F3
STM32F7
STM32G0
STM32G4
STM32H7
STM32L0
STM32L1
STM32L4
STM32L5

Summary of changes

Impact of changes

Migration actions required

Documentation


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

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

Reviewers


@ciarmcom ciarmcom requested review from a team November 17, 2020 10:00
@ciarmcom
Copy link
Member

@JeanMarcR, thank you for your changes.
@ARMmbed/team-st-mcd @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.

Please correct also indentation

/* Note: If an erase operation in Flash memory also concerns data in the data or instruction cache,
you have to make sure that these data are rewritten before they are accessed during code
execution. If this cannot be done safely, it is recommended to flush the caches by setting the
DCRST and ICRST bits in the FLASH_CR register. */
__HAL_FLASH_ART_DISABLE();
__HAL_FLASH_ART_RESET();
__HAL_FLASH_ART_RESET();q
Copy link
Collaborator

Choose a reason for hiding this comment

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

oups....

flash_lock();
core_util_critical_section_exit();

HAL_FLASH_Lock();
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would prefer to align code with HAL_FLASH_Unlock call:

if (HAL_FLASH_Lock() != HAL_OK) {
    return -1;
}

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea.

@JeanMarcR JeanMarcR changed the title FLASH API UPDATE STM32 FLASH API : add critical sections Nov 17, 2020
@mergify
Copy link

mergify bot commented Nov 18, 2020

This PR cannot be merged due to conflicts. Please rebase to resolve them.

@jeromecoutant
Copy link
Collaborator

@JeanMarcR Travis job has failed, I think you have to rebase on top of master

See PR ARMmbed#13802 (for F4 board)

Concerned boards are

STM32F0
STM32F1
STM32F2
STM32F3
STM32F4
STM32F7
STM32G0
STM32G4
STM32H7
STM32L0
STM32L1
STM32L4
STM32L5

Adding test of return code of HAL_FLASH_Lock() function
Adding board STM32F4
Running AStyle
@JeanMarcR
Copy link
Contributor Author

@jeromecoutant
I rebased on top of master

@JeanMarcR
Copy link
Contributor Author

@jeromecoutant
Please, could you review ?

@0xc0170
Copy link
Contributor

0xc0170 commented Nov 23, 2020

CI started

@mbed-ci
Copy link

mbed-ci commented Nov 23, 2020

Jenkins CI Test : ✔️ SUCCESS

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

CLICK for Detailed Summary

jobs Status
jenkins-ci/mbed-os-ci_unittests ✔️
jenkins-ci/mbed-os-ci_cmake-example-ARM ✔️
jenkins-ci/mbed-os-ci_cmake-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-greentea-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_build-greentea-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_build-example-ARM ✔️
jenkins-ci/mbed-os-ci_build-example-GCC_ARM ✔️
jenkins-ci/mbed-os-ci_cmake-example-test ✔️
jenkins-ci/mbed-os-ci_dynamic-memory-usage ✔️
jenkins-ci/mbed-os-ci_cloud-client-pytest ✔️
jenkins-ci/mbed-os-ci_greentea-test ✔️

@JeanMarcR
Copy link
Contributor Author

@jeromecoutant
Please, could you merge this pull request.

@0xc0170 0xc0170 added the release-type: patch Indentifies a PR as containing just a patch label Nov 24, 2020
@0xc0170 0xc0170 merged commit 59c03e1 into ARMmbed:master Nov 24, 2020
@mergify mergify bot removed the ready for merge label Nov 24, 2020
@mbedmain mbedmain added release-version: 6.6.0 Release-pending and removed release-type: patch Indentifies a PR as containing just a patch Release-pending labels Dec 11, 2020
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