Hi, I am porting an app from SDK 14.2 to SDK 16 (nrf52832) and noticed some strange behaviour with nrf_delay_ms - it is not delaying anywhere nearly long enough. I have built a sample program and tested with 14.2 with a delay of 1000 ms and it works as expected. To get the same behaviour with 16 I have to pass a value of about 5000000 to get a 1000 ms delay. I'm sure I must be missing something obvious but can't really see what? I noticed the delay code has changed significantly between 14.2 and 16.
Apologies if this has been asked before but I have looked but I could not find any reference to this problem.
The test program does NOT use a soft device.
Thanks for your help!
#include <stdlib.h> #include "nrf_delay.h" #include "boards.h" int main() { // // Initialise the board. // nrf_gpio_cfg_output(LED_A); // // Loop forever toggling the led ON/OFF // bool setOn = true; while (true) { if(setOn) { nrf_gpio_pin_set(LED_A); } else { nrf_gpio_pin_clear(LED_A); } setOn = setOn ? false : true; // nrf_delay_ms(5000000); nrf_delay_ms(1000); } }