DW1000 library with Arduino M0 Pro

I am using the dw1000 library by @thotro, which was made for using dwm1000 with arduino micro controllers. However, I am facing some issues which are explained below. I hope developers of Decawave can help us with this problem.

  • Arduino IDE version or Toolchain: 1.8.0 (went back to an older version to be sure that the problem is not because of the new updates)
  • dw1000 Library version: Latest
  • Arduino device: Arduino M0 Pro

I am using Native Port.

When I upload the BasicConnectivity.ino I get this in the output:

    Device ID: FFFF - model: 255, version: 15, revision: 15
    Unique ID: FF:FF:FF:FF:FF:FF:FF:FF
    Network ID & Device Address: PAN: FFFF, Short Address: FFFF
    Device mode: Data rate: 6800 kb/s, PRF: 16 MHz, Preamble: 128 symbols (code #4), Channel: #5

This usually means that the connections between the micro controller and the module are bad, but I have checked it several times with a multi-meter and it seems to be fine. I also checked the same dwm1000 with another board (Teensy 3.6) and it works perfectly fine.

I have read that I have to change the _fastSPI and _slowSPI to 12MHz and 1.5MHz respectively, but it did not help in this situation.

I assume it is a software problem because when I upload the BasicSender.ino from the examples, the compiler gives me these warnings:

    c:/users/hypos/appdata/local/arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe: warning: changing start of section .bss by 4 bytes

    c:/users/hypos/appdata/local/arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe: warning: changing start of section .bss by 4 bytes

    c:/users/hypos/appdata/local/arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe: warning: changing start of section .bss by 4 bytes

    c:/users/hypos/appdata/local/arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe: warning: changing start of section .bss by 4 bytes

    c:/users/hypos/appdata/local/arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld.exe: warning: changing start of section .bss by 4 bytes

And it does not print anything on the Serial monitor. However, when I upload the BasicReceiver.ino and BasicConnectivityTest.ino there are no warnings. I have already shown the output of BasicConnectivityTest.ino, but in BasicReceiver.ino the output is empty (it does not print anything on the Serial monitor)

When I make first upload of any of those example codes, I get this warning:

    In file included from C:\Users\hypos\AppData\Local\Arduino15\packages\arduino\tools\CMSIS-Atmel\1.2.0/CMSIS/Device/ATMEL/samd21/include/samd21.h:69:0,

                     from C:\Users\hypos\AppData\Local\Arduino15\packages\arduino\tools\CMSIS-Atmel\1.2.0/CMSIS/Device/ATMEL/samd.h:105,

                     from C:\Users\hypos\AppData\Local\Arduino15\packages\arduino\tools\CMSIS-Atmel\1.2.0/CMSIS/Device/ATMEL/sam.h:540,

                     from C:\Users\hypos\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.8.4\cores\arduino/Arduino.h:48,

                     from C:\Users\hypos\Documents\Arduino\libraries\arduino-dw1000-master\src\DW1000.h:34,

                     from C:\Users\hypos\Documents\Arduino\libraries\arduino-dw1000-master\src\DW1000.cpp:21:

    C:\Users\hypos\AppData\Local\Arduino15\packages\arduino\tools\CMSIS-Atmel\1.2.0/CMSIS/Device/ATMEL/samd21/include/samd21g18a.h:226:0: warning: "LITTLE_ENDIAN" redefined

     #define LITTLE_ENDIAN          1

     

    In file included from c:\users\hypos\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\sys\types.h:67:0,

                     from c:\users\hypos\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\stdio.h:61,

                     from C:\Users\hypos\Documents\Arduino\libraries\arduino-dw1000-master\src\DW1000.h:31,

                     from C:\Users\hypos\Documents\Arduino\libraries\arduino-dw1000-master\src\DW1000.cpp:21:

    c:\users\hypos\appdata\local\arduino15\packages\arduino\tools\arm-none-eabi-gcc\7-2017q4\arm-none-eabi\include\machine\endian.h:17:0: note: this is the location of the previous definition

     #define LITTLE_ENDIAN _LITTLE_ENDIAN

But it disappears on the second try of uploading the codes. If you know the reason of this issue too, please let me know.

I tried to use Programming Port of Arduino M0 Pro, the same weird things happen to it too. The only difference is that I get some things printed out on the Serial monitor.

for BasicReceiver.ino I get this:

    Y.j
    DW1000 initialized ...
    Committed configuration ...
    Device ID: FFFF - model: 255, version: 15, revision: 15
    Unique ID: FF:FF:FF:FF:FF:FF:FF:FF
    Network ID & Device Address: PAN: FFFF, Short Address: FFFF
    Device mode: Data rate: 110 kb/s, PRF: 16 MHz, Preamble: 2048 symbols (code #4), Channel: #5

for BasicSender.ino I get this:

    j
    DW1000 initialized ...
    Committed configuration ...
    Device ID: FFFF - model: 255, version: 15, revision: 15
    Unique ID: FF:FF:FF:FF:FF:FF:FF:FF
    Network ID & Device Address: PAN: FFFF, Short Address: FFFF
    Device mode: Data rate: 110 kb/s, PRF: 16 MHz, Preamble: 2048 symbols (code #4), Channel: #5
    Transmitting packet ... #0

For some reason the first line is not doing the right thing, but I do not think it is an issue.

If you know anything that can help, please let me know!

All the code I used here is example code of dw1000 library which is available at: DW1000 Library Link

Sorry, all very general since I don’t have your setup or any experience with the arduino library.

You are using a module that you know works and software libraries that should work. The software runs but you are getting what looks like a complete lack of any communication between the module and the processor.

To me that sounds like a hardware setup issue. Either the SPI bus is connected incorrectly, there is an issue with the power/ground connections, there is a signal integrity issue due to connection length/quality, or there is a signal integrity issue due to voltage threshold levels between the devices.

Do you have an oscilloscope available to check the signals?

3 Likes

AndyA,
Thank you! I have checked the connections with an oscilloscope and it turned out that Arduino M0 Pro does not have default SPI I/O pins. Therefore, after changing everything to ICSP header, everything worked fine!

2 Likes