Developing on the nrf52832 with DWM1001 board and CubeMX

Hello,

I woulds like to know how best to program the nrf52832 on the DWM1001 board. I have installed Segger Embedded Studio and everything else necessary and also tested the ranging examples.
Is there a “blank” file or a basic example with which to start development (for example a simple Demo which flashes the LEDs on the board)?

Also, is CubeMX usable on the nrf52832 with the DWM1001 board and if not, is there something similar to be used with the DWM1001 or is it necessary to program the functionality of CubeMX yourself?

Thank you for the help!

Hello EEAdi

Is there a “blank” file or a basic example with which to start development (for example a simple Demo which flashes the LEDs on the board)

The example we provide for the DMW1001 is the PANS 2 firmware which provides a full RTLS (Real Time Location Service) solution based on TWR (To Way Ranging) between tags and anchors. We can’t release the full source code for this, but it is possible to create user applications that run alongside the main application. We have a couple of examples on how to do this in the DWM1001\Source_Code\DWM1001_on_board_package\DWM1001_on_board_package_R2.0\dwm\examples folder of the DWM1001 support package.

The dwm-simple example tests the accelerometer and prints a tag’s location over UART.

is CubeMX usable on the nrf52832 with the DWM1001 board and if not, is there something similar to be used with the DWM1001 or is it necessary to program the functionality of CubeMX yourself?

No, CubeMX is made by ST and only support ST based products (MCUs and devkits) AFAIK. The MCU inside the DWM1001 os made by Nordic, as far as I know they don’t have anything similar to CubeMX, or at least we don’t use it at Decawave.

The DWM1004 is based on a STM32 MCU, for which we provide examples with complete source code (though not as advanced as PANS). These examples use CubeMX and can be fairly easily ported to other targets, including Nordic MCUs (thought this will require you to drop CubeMX).

CubeMX is only really used to configure pins and peripherals on the MCU. In theory you shouldn’t have to touch the configuration and doing so might break the examples.

I see thank you very much. So would it simply be possible to delete “main” file of the ranging examples and create ones own application?

I tested the dwm-simple example by flashing it onto the DWM1001, as output I get

App : dwm-simple
Built : Dec 30 2019 13:35:05

Accelerometer chip ID: 51
LABEL(len=6): 44 57 38 32 32 45

Is this the correct output?
Also, in the dwm-simple example there are multiple functions such as dwm_shell_compile(), dwm_le_compile(), dwm_thread_create etc. but I can´t find the definition for these functions. Where would I look to learn these functions, if the definitions even are publically available.

Thank you for your answer.

So would it simply be possible to delete “main” file of the ranging examples and create ones own application?

Yes, this is certainly possible. Whether you should depends on what you want to do. The PANS system is a pretty advanced demo allowing easy access to positioning of tags while still being extensible by allowing to run a user application next to the TWR and BLE stacks. If you want to develop your own system, including implementing a custom ranging algorithm, you can use the deca_driver library directly.

The output looks correct. If the node is configured as a tag and enough anchors are in range it should also start printing the position, though to be fair I didn’t test this myself yet.

Where would I look to learn these functions, if the definitions even are publicly available.

The functions are described in section 5, API functions description, of the DWM1001 Firmware API Guide, located under DWM1001_DWM1001-DEV_MDEK1001_Sources_and_Docs_v9\DWM1001\Product_and_Design_Documents in the support package.

I also suggest to read the System Overview to get a better understanding of how the PANS system works.

If you want to start a project from scratch (i.e without PANS and/or Nordic Softdevice), I suggest looking at the examples we provide for the DWM1004. These run directly on the MCU and include some TWR algorithms, but you will have to adept them to run on the NRF52 MCU of the DWM1001 the DWM1001 examples on Github. See also the forum thread discussing these examples.

Thank you, I think I understand. Two goals I have in mind are to be able to send messages between 2 DWM1001 boards and to read the CIR Value from the registers. I have read some threads on this issue and it seems it is only possible to send data between the chips with a MQTT Broker. Is this true or would it be possible without one?
And how would one go about measuring the CIR in the first place? I know it is possible to read from registers (with dwt_read32bitreg or similar functions), and that the CIR is located in register 0x25, but trying to read the registers with the API functions only returns 0.

In the API Guide, many of these functions used in the example are not explained in the guide. Is this intended?

For this use case I suggest looking into the DWM1001 examples. Note that programming these will remove the PANS firmware from the module. The PANS firmware can later be reprogrammed with the provided binary. Also note the specific somewhat “weird” way in which the CIR data needs to be read.

The PANS system is not really designed for “simple” communication between 2 devices, it is a system designed to provide a scalable RTLS solution that can also carry some additional sensor etc. data.

I have read some threads on this issue and it seems it is only possible to send data between the chips with a MQTT Broker. Is this true or would it be possible without one?

I don’t think so, but I’m not sure TBH. It should be possible to send data between 2 nodes using the firmware API, though it should be noted this data will be sent as part of the “super frame”. Using a broker it is possible to send and receive “IoT” data to and from tags more easily, but it should be possible with firmware API calls as well. Both devices will send or receive during specific time slots in the “super frame”, meaning it is a bit hard to use for the low-level functionality you described.

In the API Guide, many of these functions used in the example are not explained in the guide. Is this intended?

Thanks for noting this, this does indeed not sound right. Could you give some examples of missing documentation?

Thanks for noting this, this does indeed not sound right. Could you give some examples of missing documentation?

So far, some functions I have found which are not defined in the API guid are:

dwm_shell_compile(), dwm_le_compile(), dwm_serial_spi_compile(), dwm_thread_create, dwm_thread_resume

These are all used in the dwm-simple example. As far as I have seen, these are not in the API guide and there may be other functions in different examples which are not in the guide.

Hi Seppe,

I just want to correct the name of the software stack which comes for free with the DWM1001C. It is called PANS and not LEAPS.

LEAPS is a more advanced modular system which is currently under development and will be marketed by us at LEAPS company (https://www.leapslabs.com/).

Cheers,
TDK

You are correct, sorry for this. I corrected it.

Seppe

1 Like