After 3 days of debugging and hours on the forums trying out various things, I just wanted to post a mini quick start guide to getting low power working. Turns out that all of the various "fixes" posted before over the years "seem" to have been rolled into the SDK as all I needed to get things going are listed below - one of which I havent seen mentioned elsewhere
ble_app_hrs_freertos is the template code used. I am testing this on my own board using a BMD350 module using an Otii Arc as a power supply and very accurate current meter.
Compiling and programming the unchanged code will draw approx 5.5mA - so not going to sleep at all.
First, turn off Logging in sdk_config.h. Set NRF_LOG_ENABLED to 0 to disable.
Next, it appears that having the BSP Init function check for button presses prevents the sleep mode. In buttons_leds_init
change
err_code = bsp_init(BSP_INIT_LEDS | BSP_INIT_BUTTONS, bsp_event_handler);
to
err_code = bsp_init(BSP_INIT_LEDS, bsp_event_handler);
And thats it. I now measure 3.2uA on my board with the radio connected and received data using nRF Connect
Edit :
Add the below to FreeRTOSConfig.h to fix the FPU issue. This is from https://devzone.nordicsemi.com/f/nordic-q-a/39918/going-low-power-in-freertos-app/294672#294672
/* Fix for Errata #87 nrf52832 */ \
#define configPRE_SLEEP_PROCESSING(xMIdleTime) if ( xMIdleTime > 0 ) { \
__set_FPSCR(__get_FPSCR() & ~(0x0000009F)); \
(void) __get_FPSCR(); \
NVIC_ClearPendingIRQ(FPU_IRQn); \
}