I have been trying to translate the decawave demo code from STM32 library to the nRF52832 library as my final aim is to replace the stm32 micro-controller with nRF52832 for the localization purposes. Currently I have 2 nRF52 DK (PCA10040) boards and a TREK1000 that contains 4 EVB1000. I have started with the single-sided two way ranging example provided in the git-hub by using two nRF52 boards with two EVB1000:
I have connected the nRF52 DK with the J6 External SPI connector on EVB1000 with wires and the connection is following:
EVB1000 nRF52 DK
J6 Pin2 (GND) GND
J6 Pin5 (MISO) P0.18
J6 Pin7 (SCK) P0.16
J6 Pin8 (MOSI) P0.20
J6 Pin9 (CS) P0.17
J6 Pin10 (GND) GND
I also added a picture of how I connected them although it maybe not so useful:
On nRF52, I have used the same SPI1 and I didn’t modify the example at all. I have run the ss_twr_init on one nRF52 DK and the ss_twr_resp on the other nRF52 DK.
I am able to run the code successfully after powering on both boards and run the tests in debug modes using Keil. From debuggin, I can see that the Dev_ID is read correctly as 0xDECA0130. But after when I run into the ss_init_run() and ss_resp_run() in the while(1) loop, I see that both nRF52 boards are stuck at:
/* We assume that the transmission is achieved correctly, poll for reception of a frame or error/timeout. See NOTE 8 below. */
while (!((status_reg = dwt_read32bitreg(SYS_STATUS_ID)) & (SYS_STATUS_RXFCG | SYS_STATUS_ALL_RX_TO | SYS_STATUS_ALL_RX_ERR)))
On both sides, I see the same values read from SPI of EVB1000: 0x02800002
Switch S2 and S3 on EVB1000 are set as all off.
So, what can be the problem here? I really appreciate if anyone could help me out. Thanks a lot!
Besides that, I have also attached the library of nRF52832 that I’ve written for the mapping of Demo example for the 4 anchors and 1 tag and also for this I can read the dev_id but no communication is going on between the anchors. I’ll be grateful if someone could take a look at the files. Thanks again…