Skip to content

STM32: Lock / Unlock flash for each operation #5026

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 1 commit into from
Sep 27, 2017

Conversation

LMESTM
Copy link
Contributor

@LMESTM LMESTM commented Sep 5, 2017

Description

Rather than Unlocking flash during flash object creation, and leaving
the flash possibly continuously unlocked a(s object might bever be freed),
we decide to Unlock then Lock again at each erase or program call.

This solves issue #4967

Status

READY

TESTS

  • L0
+-------------------+---------------+-----------------------------+--------+--------------------+-------------+
| target            | platform_name | test suite                  | result | elapsed_time (sec) | copy_method |
+-------------------+---------------+-----------------------------+--------+--------------------+-------------+
| NUCLEO_L073RZ-ARM | NUCLEO_L073RZ | tests-mbed_drivers-flashiap | OK     | 80.59              | shell       |
| NUCLEO_L073RZ-ARM | NUCLEO_L073RZ | tests-mbed_hal-flash        | OK     | 79.9               | shell       |
+-------------------+---------------+-----------------------------+--------+--------------------+-------------+
  • L1
+-------------------+---------------+-----------------------------+--------+--------------------+-------------+
| target            | platform_name | test suite                  | result | elapsed_time (sec) | copy_method |
+-------------------+---------------+-----------------------------+--------+--------------------+-------------+
| NUCLEO_L152RE-ARM | NUCLEO_L152RE | tests-mbed_drivers-flashiap | OK     | 59.48              | shell       |
| NUCLEO_L152RE-ARM | NUCLEO_L152RE | tests-mbed_hal-flash        | OK     | 56.14              | shell       |
+-------------------+---------------+-----------------------------+--------+--------------------+-------------+
  • L4
+-------------------+---------------+-----------------------------+--------+--------------------+-------------+
| target            | platform_name | test suite                  | result | elapsed_time (sec) | copy_method |
+-------------------+---------------+-----------------------------+--------+--------------------+-------------+
| DISCO_L476VG-ARM  | DISCO_L476VG  | tests-mbed_drivers-flashiap | OK     | 88.25              | shell       |
| DISCO_L476VG-ARM  | DISCO_L476VG  | tests-mbed_hal-flash        | OK     | 89.7               | shell       |
| NUCLEO_L432KC-ARM | NUCLEO_L432KC | tests-mbed_drivers-flashiap | OK     | 88.64              | shell       |
| NUCLEO_L432KC-ARM | NUCLEO_L432KC | tests-mbed_hal-flash        | OK     | 89.81              | shell       |
| NUCLEO_L476RG-ARM | NUCLEO_L476RG | tests-mbed_drivers-flashiap | OK     | 88.22              | shell       |
| NUCLEO_L476RG-ARM | NUCLEO_L476RG | tests-mbed_hal-flash        | OK     | 91.76              | shell       |
+-------------------+---------------+-----------------------------+--------+--------------------+-------------+
  • F7
+-------------------+---------------+-----------------------------+--------+--------------------+-------------+
| target            | platform_name | test suite                  | result | elapsed_time (sec) | copy_method |
+-------------------+---------------+-----------------------------+--------+--------------------+-------------+
| DISCO_F746NG-ARM  | DISCO_F746NG  | tests-mbed_drivers-flashiap | OK     | 86.8               | shell       |
| DISCO_F746NG-ARM  | DISCO_F746NG  | tests-mbed_hal-flash        | OK     | 84.71              | shell       |
| DISCO_F769NI-ARM  | DISCO_F769NI  | tests-mbed_drivers-flashiap | OK     | 87.89              | shell       |
| DISCO_F769NI-ARM  | DISCO_F769NI  | tests-mbed_hal-flash        | OK     | 85.29              | shell       |
| NUCLEO_F746ZG-ARM | NUCLEO_F746ZG | tests-mbed_drivers-flashiap | OK     | 87.58              | shell       |
| NUCLEO_F746ZG-ARM | NUCLEO_F746ZG | tests-mbed_hal-flash        | OK     | 85.19              | shell       |
| NUCLEO_F756ZG-ARM | NUCLEO_F756ZG | tests-mbed_drivers-flashiap | OK     | 87.13              | shell       |
| NUCLEO_F756ZG-ARM | NUCLEO_F756ZG | tests-mbed_hal-flash        | OK     | 85.64              | shell       |
| NUCLEO_F767ZI-ARM | NUCLEO_F767ZI | tests-mbed_drivers-flashiap | OK     | 86.89              | shell       |
| NUCLEO_F767ZI-ARM | NUCLEO_F767ZI | tests-mbed_hal-flash        | OK     | 84.49              | shell       |
+-------------------+---------------+-----------------------------+--------+--------------------+-------------+
  • F4
+-------------------+---------------+-----------------------------+--------+--------------------+-------------+
| target            | platform_name | test suite                  | result | elapsed_time (sec) | copy_method |
+-------------------+---------------+-----------------------------+--------+--------------------+-------------+
| DISCO_F413ZH-ARM  | DISCO_F413ZH  | tests-mbed_drivers-flashiap | OK     | 26.99              | shell       |
| DISCO_F413ZH-ARM  | DISCO_F413ZH  | tests-mbed_hal-flash        | OK     | 26.72              | shell       |
| DISCO_F429ZI-ARM  | DISCO_F429ZI  | tests-mbed_drivers-flashiap | OK     | 26.61              | shell       |
| DISCO_F429ZI-ARM  | DISCO_F429ZI  | tests-mbed_hal-flash        | OK     | 26.58              | shell       |
| DISCO_F469NI-ARM  | DISCO_F469NI  | tests-mbed_drivers-flashiap | OK     | 25.93              | shell       |
| DISCO_F469NI-ARM  | DISCO_F469NI  | tests-mbed_hal-flash        | OK     | 26.36              | shell       |
| NUCLEO_F401RE-ARM | NUCLEO_F401RE | tests-mbed_drivers-flashiap | OK     | 27.19              | shell       |
| NUCLEO_F401RE-ARM | NUCLEO_F401RE | tests-mbed_hal-flash        | OK     | 26.13              | shell       |
| NUCLEO_F410RB-ARM | NUCLEO_F410RB | tests-mbed_drivers-flashiap | OK     | 24.56              | shell       |
| NUCLEO_F410RB-ARM | NUCLEO_F410RB | tests-mbed_hal-flash        | OK     | 24.79              | shell       |
| NUCLEO_F411RE-ARM | NUCLEO_F411RE | tests-mbed_drivers-flashiap | OK     | 26.43              | shell       |
| NUCLEO_F411RE-ARM | NUCLEO_F411RE | tests-mbed_hal-flash        | OK     | 26.24              | shell       |
| NUCLEO_F412ZG-ARM | NUCLEO_F412ZG | tests-mbed_drivers-flashiap | OK     | 27.16              | shell       |
| NUCLEO_F412ZG-ARM | NUCLEO_F412ZG | tests-mbed_hal-flash        | OK     | 26.68              | shell       |
| NUCLEO_F429ZI-ARM | NUCLEO_F429ZI | tests-mbed_drivers-flashiap | OK     | 26.49              | shell       |
| NUCLEO_F429ZI-ARM | NUCLEO_F429ZI | tests-mbed_hal-flash        | OK     | 26.85              | shell       |
| NUCLEO_F439ZI-ARM | NUCLEO_F439ZI | tests-mbed_drivers-flashiap | OK     | 26.47              | shell       |
| NUCLEO_F439ZI-ARM | NUCLEO_F439ZI | tests-mbed_hal-flash        | OK     | 26.63              | shell       |
| NUCLEO_F446ZE-ARM | NUCLEO_F446ZE | tests-mbed_drivers-flashiap | OK     | 26.75              | shell       |
| NUCLEO_F446ZE-ARM | NUCLEO_F446ZE | tests-mbed_hal-flash        | OK     | 27.05              | shell       |
+-------------------+---------------+-----------------------------+--------+--------------------+-------------+

Rather than Unlocking flash during flash object creation, and leaving
the flash possibly continuously unlocked a(s object might bever be freed),
we decide to Unlock then Lock again at each erase or program call.
@LMESTM
Copy link
Contributor Author

LMESTM commented Sep 6, 2017

@theotherjimmy Testing complete so "needs:work" label can be updated I think.
Is there a real build error in CI ? I can't get the details

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 6, 2017

I restarted the build, the result there looked suspicios (not related to this changeset).

I'll label this as needs: CI soon, reviewing.

Copy link
Contributor

@0xc0170 0xc0170 left a comment

Choose a reason for hiding this comment

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

LGTM

Is there any latency now expected (how long it takes to lock/unlock flash) ?

@LMESTM
Copy link
Contributor Author

LMESTM commented Sep 6, 2017

@0xc0170 THX. Added latency should be transparent compared to program / erase operations. The lock/unlock prevents or allows writing to the Configuration Registers, not on the flash itself. (Well yes indirectly it prevents access to the flash ... hope I'm clear enough )

@LMESTM
Copy link
Contributor Author

LMESTM commented Sep 13, 2017

@0xc0170 when is CI planned ?

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 21, 2017

@0xc0170 when is CI planned ?

We can't timebox this as our minor and patch release are due soon (CI pipeline is being occupied most of the time, as we are adding also some older jobs, so this will get in there also).

@theotherjimmy
Copy link
Contributor

/morph test

@mbed-bot
Copy link

Result: ABORTED

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 1364

Build Prep failed!

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 26, 2017

/morph test

@mbed-bot
Copy link

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 1391

All builds and test passed!

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 27, 2017

/morph test-nightly

@mbed-bot
Copy link

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test-nightly

Output

mbed Build Number: 1400

All builds and test passed!

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.

4 participants