br101 / zephyr-dw3000-examples

DW3000 Examples
18 stars 9 forks source link

nRFConnect #1

Open Ozark-iot opened 1 year ago

Ozark-iot commented 1 year ago

Almost all zephyr projects are opened through nRF Connect now. Withoiut trying to be difficult would it be relatively simple for you to create a repository with any of the example code whereby it could be opened with nRF Connect ?

I've tried to get things to compile and headers are missing.

In addition would it not be more simple to change a board overlay to include the following ?: `&spi0 { status = "okay"; sck-pin = <2>; mosi-pin = <20>; miso-pin = <3>; cs-gpios = <&gpio0 17 GPIO_ACTIVE_LOW>;

dw3000@0 {
    compatible = "decawave,dw3000";
    label = "DW3000";
    spi-max-frequency = <1000000>;
    reg = <0>;
    reset-gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
    irq-gpios = <&gpio0 15 GPIO_ACTIVE_LOW>;
    wakeup-gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
    //spi-pol-gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
    //spi-pha-gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
};

};`

Thank you...

br101 commented 1 year ago

I don't understand your issue. All these examples are running in nRF Connect (version 2.0.0)

Ozark-iot commented 1 year ago

Hmmm, so you are using Visual Studio.

I'm using SDK V1.9.1, (Segger) none of the examples compile without me placing an overlay nRF52840dk.nRF52840.overlay in the root directory of the project.

As follows: / SPDX-License-Identifier: LicenseRef-BSD-5-Clause-Nordic /

&uart1 { compatible = "nordic,nrf-uarte"; current-speed = <115200>; status = "disabled"; };

&i2c1 { status = "disabled"; compatible = "nordic,nrf-twim"; sda-pin = <29>; scl-pin = <45>; clock-frequency = ; si7055@40 { compatible = "silabs,si7055"; reg = <0x40>; label = "si7055"; }; };

&spi0 { status = "okay"; sck-pin = <47>;
miso-pin = <46>; mosi-pin = <45>; cs-gpios = <&gpio1 12 GPIO_ACTIVE_LOW>;

dw3000@0 {
    compatible        = "decawave,dw3000";
    label             = "DW3000";
    spi-max-frequency = <1000000>;
    reg               = <0>;
    wakeup-gpios      = <&gpio1 11 GPIO_ACTIVE_HIGH>;
    irq-gpios         = <&gpio1 10 GPIO_ACTIVE_HIGH>;
    reset-gpios       = <&gpio1  9 GPIO_ACTIVE_LOW>;
    spi-pol-gpios     = <&gpio1  2 GPIO_ACTIVE_LOW>;
    spi-pha-gpios     = <&gpio1  1 GPIO_ACTIVE_LOW>;
};

};

arduino_i2c: &i2c0 { compatible = "nordic,nrf-twi"; status = "disabled"; sda-pin = <26>; scl-pin = <27>; };

br101 commented 1 year ago

Yes I am using Visual Studio Code, no idea about Segger... So you are using the DWS3000 shield on the nRF52840DK? Maybe it works if you activate the shield SHIELD_QORVO_DWS3000, it is already defined in the driver.

Ozark-iot commented 1 year ago

Maybe it works if you activate the shield SHIELD_QORVO_DWS3000, it is already defined in the driver.

Can you show me how ? Please

Ozark-iot commented 1 year ago

I have a better question to ask. Have you tested DS ranging using examples ex_05a_ds_twr_init and ex_05a_ds_twr_resp ?

I have managed to get it to compile and run, but I never receive the final message, I'm guessing that it is delay settings. If you have modified the delays and made it work I would be very grateful if you would share the values please.

br101 commented 1 year ago

If you use Cmake only you can add set(SHIELD qorvo_dws3000) to CMakeLists.txt Otherwise you add the shield when you define your board. Not sure how that works with Segger SDK

br101 commented 1 year ago

No, i haven't. So does the basic stuff work now?

Ozark-iot commented 1 year ago

No nothing that requires RX of a TX functions. After many hours of scrathing my head I made ex_06a_ss_twr_initiator and ex_06a_ss_twr_responder to work.

I had to change the delays in iniator `/ Receive response timeout. See NOTE 5 below. / // jc //#define RESP_RX_TIMEOUT_UUS 400

define RESP_RX_TIMEOUT_UUS 1300

` and in shared_defines.h

`/* UWB microsecond (uus) to device time unit (dtu, around 15.65 ps) conversion factor.

It would be nice to get it working :)