let me try answer the 3 issues as I have spend a lot of time on BLE and DeepDive
1. The timer.
With the Artemis BLE driver implementation, it is indeed not needed. There are NO timers enabled in the BLE driver, BUT there COULD be. There is a wakeuptimer and a HeartBeatTimer defined which are currently disabled. They can be used to improve stability and workflow and you never know whether in the future these will be enabled. Thus to keep it safe I would disable the timer after BLE.end() with ‘am_hal_ctimer_stop(7, AM_HAL_CTIMER_TIMERB)’
2. Crash after 25 times deep sleep.
Every time BLE starts in the routine AP3CordioHCITransportDriver.cpp (part of MBED target) it will request a new “handle” for WSF. WSF functions are used for passing the request and information in an organized manner between the different sub-routines in the BLE driver. A ‘handle’ is used to connect the functions. The root cause is that there is NO function call in WSF for BLE.end() to ‘free’ an earlier obtained ‘handle’ and as there are maximum 16 handles available, it will run out. The crash is after 25 times (hard re- producible) as it then starts to overwrite parts of other variables which causes the crash. Personally, I made a change to that file to only obtain a handle if it does not have one and rebuild the MBED pre-compiled archive for each board. No issues since !!
3. power consumption
For sure BLE.end() also results in a power-off BLE component in the Artemis, the HAL-driver will wait until that power-off is confirmed !. I think your issues are related to the other peripherals (IOM, ADC, UART, PWM etc). There are major issues with powering those down and crashing when you startup again. The Sparkfun Libraries (V1 and V2), as they are, do not handle deep sleep well.
Look at a deep-dive document I have done to describe deep sleep. It is working a little differently than the Sparkfun example is showing.(https://github.com/paulvha/apollo3/tree … PowerCntrl)
To overcome I had to make changes to Wire,SPI, PWM, UART in the libraries, the MBED drivers and Mbed Apollo3 target files.
With all those changes I build different BLE implementations that work with SPS30 (Wire), BME280 (communicating in SPI or WIRE) that work with deep sleep without problems.
I am still in the process to document… but other projects got in between.