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

nrf: writes via machine.Flash cause assertion violations with SoftDevice enabled #4170

Open
bgould opened this issue Mar 3, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@bgould
Copy link
Member

bgould commented Mar 3, 2024

When performing writes via the NVMC registers, the SoftDevice generates an assertion violation if enabled.

In the nRF SDK, there are 2 "backends" for flash storage, one via the NVMC controller (as in machine.Flash) and another that designed for compatibility with SoftDevice enabled: https://infocenter.nordicsemi.com/index.jsp?topic=%2Fstruct_sdk%2Fstruct%2Fsdk_nrf5_latest.html

It would be nice to be able to support both backends; It could be the case that the implementation of the SoftDevice backend belongs in tinygo.org/x/bluetooth (or a subpackage). In that case, it might be beneficial to refactor machine.Flash to allow for specifying a "backend" other than the NVMC implementation.

relevant "SD" fstorage backend implementation: https://github.com/cmdwtf/nRF5_SDK/blob/master/components/libraries/fstorage/nrf_fstorage_sd.c

@aykevl
Copy link
Member

aykevl commented Mar 3, 2024

I was afraid we'd run into this.

Perhaps the least complicated way to solve this is by doing it in the same way I've solved wfi before:
https://github.com/tinygo-org/tinygo/blob/release/src/runtime/runtime_nrf_softdevice.go

@deadprogram deadprogram added the bug Something isn't working label Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants