Failed to port nRFConnect blinky to 52805: stuck in lfclk_spiwait()

Hello,

I want to port blinky example to 52805.

I wrote this dts file:

/dts-v1/;
#include <nordic/nrf52805_caaa.dtsi>

/ {
	model = "button";
	compatible = "nrf,button";

	chosen {
		zephyr,sram = &sram0;
		zephyr,flash = &flash0;
		zephyr,code-partition = &slot0_partition;
	};

	aliases {
		led0 = &myled0;
	};

	leds {
		compatible = "gpio-leds";
		myled0: led_0 {
			gpios = <&gpio0 16 GPIO_ACTIVE_LOW>;
			};


	};
};

&flash0 {
	partitions {
		compatible = "fixed-partitions";
		#address-cells = <1>;
		#size-cells = <1>;

		boot_partition: partition@0 {
			label = "mcuboot";
			reg = <0x0 0xc000>;
		};
		slot0_partition: partition@c000 {
			label = "image-0";
			reg = <0xc000 0xa000>;
		};
		slot1_partition: partition@16000 {
			label = "image-1";
			reg = <0x16000 0xa000>;
		};
		scratch_partition: partition@20000 {
			label = "image-scratch";
			reg = <0x20000 0xa000>;
		};
		storage_partition: partition@2a000 {
			label = "storage";
			reg = <0x2a000 0x6000>;
		};
	};
};

&gpio0 {
	status = "okay";
};

I added "CONFIG_DEBUG=y" to prj.cong.

I launch debug but main function is never reached.

Here's the call stack in which the app is stuck:

I expect a misconfiguration but I'm unable to find which.

Any idea?

Thanks

Julien

  • Digging a bit more for debugging, mode variable is set to CLOCK_CONTROL_NRF_LF_START_STABLE.

    I'm using a very small module. As P0.0 and P0.01  (which are also XL1 and XL2 pins) are available outside the module, I suspect there isn't any 32768Hz oscillator in the module.

    Datasheet states that this oscillator is optionnal.

    Searching on the net leads me to add those three lines:

    CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=n
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL=n
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_SYNTH=y

    Which fixed the problem.

  • You are an absolute genius! I can't thank you enough for this. I was stuck for 2 weeks on the same issue, dismissing the debug information thinking it was just a broken board.
    Nordic really should update documentation on their schematics warning if one doesn't populate what they call "optional" needs special firmware attention.

    Thank you once again.

    BR,

    AR

Related