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

Fix bug in MBR for NRF52 series #6798

Merged
merged 1 commit into from May 4, 2018

Conversation

Projects
None yet
4 participants
@marcuschangarm
Contributor

marcuschangarm commented May 3, 2018

Description

The MBR VTOR state depends on how the application is booted. This makes it difficult to initialize the MBR correctly since a bug prevents the MBR from being initialized more than once.

This commit resets the MBR and SoftDevice to a known state before initializing the MBR and setting the VTOR through the SoftDevice.

Pull request type

[x] Fix
[ ] Refactor
[ ] New target
[ ] Feature
[ ] Breaking change
Fix bug in MBR for NRF52 series
The MBR VTOR state depends on how the application is booted.
This makes it difficult to initialize the MBR correctly since a
bug prevents the MBR from being initialized more than once.

This commit resets the MBR and SoftDevice to a known state before
initializing the MBR and setting the VTOR through the SoftDevice.

@marcuschangarm marcuschangarm force-pushed the marcuschangarm:fix-mbr branch from fad805e to 41c1654 May 3, 2018

@marcuschangarm

This comment has been minimized.

Contributor

marcuschangarm commented May 3, 2018

@c1728p9 this should be a more robust way of booting the device.

@0xc0170

0xc0170 approved these changes May 3, 2018

@0xc0170 0xc0170 added needs: CI and removed needs: review labels May 3, 2018

@c1728p9

c1728p9 approved these changes May 3, 2018

#define UICR_BOOTLOADER_ADDRESS 0x10001014
#define MBR_ADDRESS 0x0
#define MBR_VTOR_ADDRESS 0x20000000
#define SOFTDEVICE_VTOR_ADDRESS 0x20000004

This comment has been minimized.

@c1728p9

c1728p9 May 3, 2018

Contributor

Is MBR_VTOR_ADDRESS the vector table itself or a pointer to the vector table address?


/* Reset SoftDevive VTOR. */
uint32_t *softdevice_vtor_address = (uint32_t *) SOFTDEVICE_VTOR_ADDRESS;
*softdevice_vtor_address = 0xFFFFFFFF;

This comment has been minimized.

@c1728p9

c1728p9 May 3, 2018

Contributor

Why 0xFFFFFFFF? Does this have a special meaning to the softdevice?

@0xc0170

This comment has been minimized.

Member

0xc0170 commented May 3, 2018

/morph build

@mbed-ci

This comment has been minimized.

mbed-ci commented May 3, 2018

Build : SUCCESS

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

Triggering tests

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

@mbed-ci

This comment has been minimized.

@mbed-ci

This comment has been minimized.

@0xc0170 0xc0170 merged commit 6361e92 into ARMmbed:master May 4, 2018

13 checks passed

AWS-CI uVisor Build & Test Success
Details
ci-morph-build build completed
Details
ci-morph-exporter build completed
Details
ci-morph-mbed2-build build completed
Details
ci-morph-test test completed
Details
continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
travis-ci/astyle Passed, 582 warnings (+0 warnings)
Details
travis-ci/docs Local docs testing has passed
Details
travis-ci/events Passed, runtime is 9080 cycles (-959 cycles)
Details
travis-ci/gitattributestest Local gitattributestest testing has passed
Details
travis-ci/littlefs Passed, code size is 10112B (+0.00%)
Details
travis-ci/tools Local tools testing has passed
Details

@marcuschangarm marcuschangarm deleted the marcuschangarm:fix-mbr branch May 10, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment