Re: Seeed BLE Micro (nrf51822) hangs on k_msleep


Vinayak Kariappa
 

Hi Matias,

From the schematics posted in seedstudio website, indeed a 32KHz crystal is said to be present. You may always use the internal 32 KHz RC oscillator in nRF51 to check if the system timer is not the problem.

Enable the following to use RC Oscillator:
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_500PPM=y

16MHz clock is essential for 2.4 GHz radio peripheral.

Regards,
Vinayak


On Sat, Jun 6, 2020 at 5:31 AM Matias N. <matias@...> wrote:
Hi,
I'm starting a project based on the BLE Micro module from Seeedstudio. Since this "board" was not supported but the RedBear BLE nano board is the most similar one, I created a custom board directory for it using this as a template. I managed to flash the blinky sample to the module (using openocd and a ST-Link v2 clone device) and can also connect with gdb to debug. I have this module soldered to a custom PCB which features a LED and thus I set the correct LED GPIO in the dts file. I managed to control the LED but from my debugging it seems to hang when calling k_msleep(). When it hangs, if I pause the execution it appears to be right after the "wfi" instruction (i'm assuming the debugger breaks the sleep).

I'm not sure why this could be happening. My guess it is something to do with the clock configuration. The module features a 32.768hz crystal (just like the BLE Nano) but also a 16 MHz crystal (which I'm not sure is used or not by zephyr). I tried disabling tickless, but the behavior does not change.

As I'm new to zephyr I'm not quite sure what else to check. Googling for this problem I found old issues in GitHub relating to tickless mode, low-power, rtc, etc. But all seem to be merged/closed. I would appreciate any help in this.

Best,
Matias

Join users@lists.zephyrproject.org to automatically receive all group messages.