Skip to content
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

Do not read or write feature flags from an ISR #1338

Merged
merged 1 commit into from
May 25, 2017

Conversation

sergeuz
Copy link
Member

@sergeuz sergeuz commented May 18, 2017

Problem

Device panic (assertion failure) occurs when DFU mode is triggered via baud rate change.

Solution

Do not read or write feature flags, which are stored in DCT, from an ISR. Users are still allowed to call such methods as System.reset() and System.dfu() from an ISR to preserve backwards compatibility.

Steps to Test

  • Try to enable DFU mode via baud rate change.
  • Check what happens with System.resetReason(), characterize the behavior.

Example App

N/A

References

N/A


Completeness

  • User is totes amazing for contributing!
  • Contributor has signed CLA (Info here)
  • Problem and Solution clearly stated
  • Run unit/integration/application tests on device
  • Added documentation
  • Added to CHANGELOG.md after merging (add links to docs and issues)

@sergeuz sergeuz added this to the 0.7.0 milestone May 18, 2017
@sergeuz sergeuz requested a review from avtolstoy May 18, 2017 13:46
@@ -1270,10 +1280,9 @@ int HAL_Feature_Set(HAL_Feature feature, bool enabled)
current |= 2; // 0bxxxxxx10 to disable the clock, any other value to enable it.
}
dct_write_app_data(&current, DCT_RADIO_FLAGS_OFFSET, 1);
return 0;
Copy link
Member

Choose a reason for hiding this comment

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

Any reason we don't use the same error checking pattern here?

int result = dct_read_app_data_copy(DCT_RADIO_FLAGS_OFFSET, &current, sizeof(current));
if (result != 0) {
    return result;
}
//...
result = dct_write_app_data(&current, DCT_RADIO_FLAGS_OFFSET, 1);
if (result != 0) {
    return result;
}

@technobly technobly merged commit 1c5ca3b into feature/photon/wiced-3.7.0-7 May 25, 2017
@technobly technobly deleted the fix/dfu_from_isr branch May 25, 2017 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants