[riot-notifications] [RIOT-OS/RIOT] stm32_common/flash_common: fix _wait_for_pemnding_isr() (#11790)

Francisco notifications at github.com
Thu Jul 4 10:28:53 CEST 2019


<!--
The RIOT community cares a lot about code quality.
Therefore, before describing what your contribution is about, we would like
you to make sure that your modifications are compliant with the RIOT
coding conventions, see https://github.com/RIOT-OS/RIOT/wiki/Coding-conventions.
-->

### Contribution description

<!--
Put here the description of your contribution:
- describe which part(s) of RIOT is (are) involved
- if it's a bug fix, describe the bug that it solves and how it is solved
- you can also give more information to reviewers about how to test your changes
-->

This PR fixes a flashpage implementation.

- In `flash_common` `FLASH_SR_EOP` is cleared by writing to 0, when RM states that it is cleared by writing 1 (check any STM32 `FLASH_SR` register description).
- It guards clearing  `FLASH_SR_EOP` for platforms that don't make use of it since  `FLASH_SR_EOP` is never set for them (STM32F2, STM32F4, STM32F7 & STM32L4).
- When writing to flash the first operation is performed before checking if there was any ongoing operation. This should also be done according to the RM.

### Testing procedure

<!--
Details steps to test your contribution:
- which test/example to compile for which board and is there a 'test' command
- how to know that it was not working/available in master
- the expected success test output
-->

Verify my statement in the RM.

Run for stm32x boards:

`make -C tests/periph_flashpage/ BOARD=nucleo-l476rg flash -j3 test`

### Issues/PRs references

<!--
Examples: Fixes #1234. See also #5678. Depends on PR #9876.

Please use keywords (e.g., fixes, resolve) with the links to the issues you
resolved, this way they will be automatically closed when your pull request
is merged. See https://help.github.com/articles/closing-issues-using-keywords/.
-->

You can view, comment on, or merge this pull request online at:

  https://github.com/RIOT-OS/RIOT/pull/11790

-- Commit Summary --

  * stm32_common/flash_common: properly clear EOP bit
  * stm32_common/flashpage: _wait_for_pending_operations() before write
  * stm32_common/flash_common: guard EOP bit clear

-- File Changes --

    M cpu/stm32_common/periph/flash_common.c (11)
    M cpu/stm32_common/periph/flashpage.c (3)

-- Patch Links --

https://github.com/RIOT-OS/RIOT/pull/11790.patch
https://github.com/RIOT-OS/RIOT/pull/11790.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/11790
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190704/f81ba912/attachment-0001.html>


More information about the notifications mailing list