Skip to content

STM32F76x: Add support of dual bank flash mode #7088

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
Jun 11, 2018

Conversation

bcostm
Copy link
Contributor

@bcostm bcostm commented Jun 1, 2018

Description

This PR adds support of Dual Bank flash mode on NUCLEO_F767ZI and DISCO_F769NI platforms.

Fixes Issue #6955

Tested OK using tests-mbed_drivers-flashiap and tests-mbed_hal-flash tests.

Note
The Single Bank mode is selected by default on these 2 boards.
To enable the Dual Bank mode you have to:

  • enable the FLASH_DUAL_BANK configuration using a json file
  • enable the Dual Bank in the option bytes using STLink-Utility software (uncheck the nDBANK box)
  • upgrade the STLink fw on the board to the latest version (V2.J30.M21 as of today)

Uncyclo page:
https://os.mbed.com/teams/ST/wiki/How-to-enable-flash-dual-bank

Pull request type

[X] Fix
[ ] Refactor
[ ] New target
[ ] Feature
[ ] Breaking change

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 4, 2018

@dhwalters423 Please review. Does this address the issue you reported?

@0xc0170 0xc0170 requested a review from dhwalters423 June 4, 2018 10:22
@0xc0170 0xc0170 requested a review from a team June 4, 2018 10:22
#ifdef MBED_CONF_TARGET_FLASH_DUAL_BANK
if ((OBInit.USERConfig & OB_NDBANK_SINGLE_BANK) == OB_NDBANK_SINGLE_BANK)
{
error("The Dual Bank mode option byte (nDBANK) must be enabled (box unchecked)\n");
Copy link
Contributor

Choose a reason for hiding this comment

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

@SenRamakri with the latest changes to the error handling, can you review this error handling

@0xc0170 0xc0170 requested a review from SenRamakri June 4, 2018 10:24
@bcostm bcostm force-pushed the dev_F7_flash_dual_bank branch from 67fbdb1 to b79be41 Compare June 4, 2018 11:38
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.

Code review done.
Tests also verified on my side with single and dual configuration.

Copy link
Contributor

@dhwalters423 dhwalters423 left a comment

Choose a reason for hiding this comment

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

Looks great! Thank you!

I was able to test this by cherry picking commit into Mbed OS 5.7.4, and running Simple Cloud Client 1.3 for the NUCLEO F767ZI: https://os.mbed.com/users/dwaltersARM/code/example-Ethernet-mbed-Cloud-connect/

I used the following sector layout for SOTP/RoT:
"app.sotp-section-1-address": "(0x081C0000)",
"app.sotp-section-1-size" : "(1281024)",
"app.sotp-section-2-address": "(0x081E0000)",
"app.sotp-section-2-size" : "(128
1024)"
(sectors 22 and 23 on the 767ZI)

The RoT was inserted and preserved correctly while stored in those sectors.

We should be sure to document the process with ST-Link utility to switch the platforms into Dual Bank mode on the platform page: https://os.mbed.com/platforms/ST-Nucleo-F767ZI/

@bcostm
Copy link
Contributor Author

bcostm commented Jun 5, 2018

Thanks for the testing.

We should be sure to document the process with ST-Link utility to switch the platforms into Dual Bank mode

I will explain this in a WIKI page (in ST team area on mbed.org) as soon this PR is merged.

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 7, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Jun 7, 2018

Build : SUCCESS

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

Triggering tests

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

@cmonr
Copy link
Contributor

cmonr commented Jun 7, 2018

Halting CI builds until RC3 PRs are completed. Will resume after.

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 8, 2018

/morph test
/morph export-build

@mbed-ci
Copy link

mbed-ci commented Jun 8, 2018

@mbed-ci
Copy link

mbed-ci commented Jun 8, 2018

@cmonr
Copy link
Contributor

cmonr commented Jun 11, 2018

Looks good!

@cmonr cmonr merged commit 23bc4e0 into ARMmbed:master Jun 11, 2018
@bcostm
Copy link
Contributor Author

bcostm commented Jun 13, 2018

FYI

https://os.mbed.com/teams/ST/wiki/How-to-enable-flash-dual-bank

@mbed-ci
Copy link

mbed-ci commented Jun 13, 2018

@bcostm bcostm deleted the dev_F7_flash_dual_bank branch July 3, 2018 13:07
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.

7 participants