Skip to content

Fix bug in MBR for NRF52 series #6798

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
May 4, 2018
Merged

Fix bug in MBR for NRF52 series #6798

merged 1 commit into from
May 4, 2018

Conversation

marcuschangarm
Copy link
Contributor

@marcuschangarm 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

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
Copy link
Contributor Author

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

#define UICR_BOOTLOADER_ADDRESS 0x10001014
#define MBR_ADDRESS 0x0
#define MBR_VTOR_ADDRESS 0x20000000
#define SOFTDEVICE_VTOR_ADDRESS 0x20000004
Copy link
Contributor

Choose a reason for hiding this comment

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

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;
Copy link
Contributor

Choose a reason for hiding this comment

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

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

@0xc0170
Copy link
Contributor

0xc0170 commented May 3, 2018

/morph build

@mbed-ci
Copy link

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
Copy link

mbed-ci commented May 4, 2018

@mbed-ci
Copy link

mbed-ci commented May 4, 2018

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