The BMD-300, BMD-301, and BMD-350 modules are loaded with RigDFU (bootloader) and RigCom (BMDware application) for legacy support.
On start-up, RigDFU will advertise for 2 seconds, then RigCom will take over and start advertising. If you do not see the change to RigCom or cannot get the SWD port to function properly the module may be in a reset loop.
There are a few things happening under the hood:
- P0.21 can be disabled, used as nRESET, or as a regular GPIO.
- RigDFU ignores P0.21. It will start and advertise correctly on a power cycle or software reset. RigDFU runs for 2 seconds.
- RigCom uses P0.21 as a GPIO interrupt input with an internal pull-up and not as the nRESET hardware reset. This is done for legacy design support.
- The first thing that RigCom does in
main()is enable the P0.21 GPIO and internal pull-up.
- Unfortunately, there appears to be a race condition when P0.21 floats low in that the code jumps to the interrupt service routine before the pin gets configured. The only thing the ISR does is execute a software reset:
- When the soft reset occurs, it jumps back to running RigDFU and gets stuck in this loop every 2 seconds. This
NVIC_SystemReset()also resets the SWD port, which is preventing it from allowing any programmer to function properly.
To solve this, either pull P0.21 high to allow RigCom to fully start which in order to break the loop.
It is also be possible to quickly run
nrfjprog -f nrf52 --recover
immediately after resetting the module, before the 2-second RigDFU timer runs out. This command is provided with Nordic's Command Line Tools: https://www.nordicsemi.com/Software-and-Tools/Development-Tools/nRF-Command-Line-Tools
Once you get nRF Connect, or
nrfjprog --recover to clear the module once, you will fully delete both RigDFU and RigCom and the reset loop along with it, allowing you to load your code without any special consideration.