thotro / arduino-dw1000

A library that offers functionality to use Decawave's DW1000 chips/modules with Arduino.
Apache License 2.0
527 stars 287 forks source link

Problem in using with Aduino M0 Pro #316

Open 4KARA opened 4 years ago

4KARA commented 4 years ago

I am facing some problems while using the library with Arduino M0 Pro (ATMEL SAMD21G)

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!

jsouriadakis commented 3 years ago

@4KARA did you manage to fix the issue with the samd board? If yes please let me know how. Thanks