Comments (6)
Unfortunately, debugging softdevice faults is not fun as it's mostly a black box. Also unfortunately, unwinding through the softdevice doesn't work as GDB lacks the debug info, that's just the way it is :(
id=1 indicates an assertion inside softdevice's code failed. In that case searching Nordic's forums for the PC value usually helps. For PC=0x16ACC I could find this thread which indicates it's an interrupt timing issue.
The softdevice is very picky about timing because the BLE radio requires very precise timing to sync with connected devices. You must not do anything that causes softdevice's interrupts to be delayed:
- Use
interrupt
functions fromnrf_softdevice
instead ofcortex_m
. These ensure only the non-softdevice interrupts are ever disabled. - you can't use GDB breakpoints. They do work but as soon as you resume the softdevice notices the timing is off and asserts. That's just the way it is, haven't found a workaround :(
- Haven't personally tested it, but I think semihosting won't work either since it involves pausing the CPU too. Are you using it for logging? If so, consider switching to uart, rtt or defmt.
from nrf-softdevice.
i not use breakpoints. and olny use semihosting when panic.
Unbelievable, the bug has disappear, when i build with --release
.
from nrf-softdevice.
i want to use probe-run
, but it not work on my windows. both jlink and dap-link.
have you try to use probe-run
on windows?
from nrf-softdevice.
You probably have something blocking the softdevice interrupts. Compiling with --release
makes your code faster, so it's less likely to break softdevice's timing, but it's still not guaranteed.
- Check that you're NOT using
cortex_m::interrupt::free
or othercortex_m
functions. Use functions fromnrf_softdevice::interrupt
instead. - Check that you're not using interrupt priorities 0 and 1 (highest levels). If your interrupts have these priorities, they can delay softdevice's interrupts. Priority is 0 by default, so you have to change it manually.
Yes, probe-run works on Windows but you'll have to fiddle with USB drivers (using Zadig for example)
from nrf-softdevice.
How to solve this bug?
panicked at 'fault_handler 4097 285196 0'
only happen when build without --release
.
from nrf-softdevice.
This is the same as https://github.com/akiles/embassy/issues/42 .
When you get a softdevice fault, check the NRF_FAULT_ID. In this case it's NRF_FAULT_ID_APP_MEMACC. Docs on it say this:
Application invalid memory access. The info parameter will contain 0x00000000,
in case of SoftDevice RAM access violation. In case of SoftDevice peripheral
register violation the info parameter will contain the sub-region number of
PREGION[0], on whose address range the disallowed write access caused the
memory access fault.The PC value points to somewhere in your code where presumably the bad access happened. I'd check what's in there and go from there.
from nrf-softdevice.
Related Issues (20)
- `FixedGattValue` (and other ble traits) should be provided by a separate library
- Recommendation to enable squash merges?
- Use PHY Coded as Primary PHY for advertisement HOT 1
- Connecting to an incorrect Mac address causes a "hang" due to underlying NRF_ERROR_NOT_FOUND HOT 1
- Connecting with 2M PHY HOT 4
- L2CAP Channel API Design Flaws HOT 1
- Switch examples to use default `gatts_attr_tab_size` ? HOT 1
- Add descriptor to a characteristic HOT 2
- NRF52832/S132 Freezes Upon Connection HOT 3
- There is currently no way to disable the SoftDevice HOT 2
- Softdevice peripheral clash with RNG peripheral HOT 3
- Implement `NorFlash` for `Flash` HOT 2
- Debugging HOT 1
- Store and load bond info using `nrf_softdevice::Flash` HOT 13
- Softdevice.run_with_callback never calls the callback HOT 1
- Improve defmt trace HOT 1
- Could not execute process probe-run --chip nRF52840_xxAA HOT 3
- Security connection HOT 1
- Allow to open/close a BLE pairing&bonding window HOT 4
- Flash Capacity Definition Discrepancy for nRF52832 and nRF52833 Chips HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nrf-softdevice.