Problems retrieving Location coords with dwm_loc_get()

We have set the location update rate as follows:

[color=#000000][size=x-small][font=Menlo]dwm_upd_rate_set([color=#272ad8]1[/color], [color=#272ad8]5[/color]);[/font][/size][/color]

… which I believe is a request to calculate new location at 10 Hz

We are also capturing the location data ready event as follows:

[color=#000000][size=x-small][font=Menlo] HAL_GPIO_SetupCb([color=#272ad8]3[/color], HAL_GPIO_INT_EDGE_RISING, &gpio_cb);
[/font][/size][/color][color=#000000][size=x-small][font=Menlo] dwm_int_cfg([color=#272ad8]1[/color]);[/font][/size][/color]

If this event function gpio_cb() does nothing, it fires at about 7 Hz

However if we call dwm_loc_get() within gpio_cb() via SPI, at best we get the location data at about 2 Hz (via UART it’s barely 1 Hz)

So the question is - what is the most efficient way to get the location data off the Decawave module and into our host (Raspberry Pi 3) ?

Any help much appreciated.


[size=small]Hi Gerry,[/size]

[size=small]Can you try the following [color=#000000][font=Menlo]dwm_upd_rate_set([/font][/color][color=#272ad8][font=Menlo]1[/font][/color][font=Menlo][color=#000000], [/color][color=#272ad8]1[/color][/font][color=#000000][font=Menlo]); ? [/font][/color][/size]

Also, how many tags do you have at the same time in your setup ?

Thnank you,

Setting [color=#000000][font=Menlo]dwm_upd_rate_set([/font][/color][color=#272ad8][font=Menlo]1[/font][/color][color=#333333][font=Menlo][color=#000000], [/color][color=#272ad8]1[/color][/font][/color][color=#000000][font=Menlo]) makes no difference to the rate at which [color=#333333]dwm_loc_get() returns over SPI or UART.[/color][/font][/color]

[color=#000000][font=Menlo][color=#333333]As I said above the rate at which the data available event fires is close to the 10Hz suggested by the call to dwm_upd_rate_set - what seems to be limiting is the rate at which the API answers over SPI or UART.[/color][/font][/color]

[color=#000000][font=Menlo][color=#333333]We only have 1 Tag in our environment (10 anchors distributed over our test area - the tag sees 3 or 4 anchors at all times).[/color][/font][/color]

[color=#000000][font=Menlo][color=#333333]My question is how can I improve the rate at which I can get the location data off the Decawave board ?[/color][/font][/color]


Hi mistergerf,

For SPI mode, can you try to do the below changes:
in file lmh_spirx.c, function LMH_SPIRX_WaitForRx, change HAL_Delay(lmh_spirx_wait*10) to HAL_Delay(lmh_spirx_wait)
in file hal_spi.h, find #define HAL_SPI_WAIT_PERIOD 10, change 10 to 1.
Please let me know if this helps?