measurement of RSSI or transit time of a message via BLE with the Nordic 52840 and another slave board.

I have this problem, with a Nordic nRF52840 board I have to transmit a byte of known length, which I have to select a priori, and transmit it to a second slave evaluation board and then measure the RSSI value and the time it takes for the data packet to arrive depending on where the board is located, thus also going back to the distance value at which the two boards are located.
I would then also like to do the same thing with my android smartphone used as a slave.

I have tried to follow the examples I can find of nRF connect for desktop a bit, and in particular the codes available in visual studio code, but the standard codes there do not seem to answer my question.
Could you perhaps help me by explaining where to find an example code to modify to achieve this, and how to program the second board via the nRF52840?

thanks in advance!

Parents Reply Children
  • Hi Amanda,

    I tried to upload the example you described and which I found within the GitHub repository (github.com/.../radio_test.c ), as within the examples provided by NRF Connect in VS code, there is no radio_test example.
    Downloading it and doing "open an existing application" in VS Code gives the following errors during compilation:

    1) "No SOURCES given to Zephyr library: lib__libc__common".
    2) "implicit declaration of function 'NRFX_MHZ_TO_HZ' [-Wimplicit-function-declaration]"

    in the default code found on the net, without making any changes.
    How can I proceed to resolve these errors?
    The library mentioned in the error is also present in other applications that run without errors.
    It should also not be a folder location error.

    and also if I try to add the prj.conf file configuration in the building these errors pop up:

    1) sys/printk.h: No such file or directory

     2) #include errors detected based on information provided by the configurationProvider setting. Squiggles are disabled for this translation unit (C:\Users\leonardo\Downloads\sdk-nrf-master\sdk-nrf-master\samples\peripheral\radio_test\src\radio_cmd.c).

     3) cannot open source file "init.h"

     4) init.h: No such file or directory

     5) cannot open source file "shell/shell.h"

  • Hi, 

    Which NCS version are you using?

    The radio_test sample can be found under samples/peripheral/radio_test in the nRF Connect SDK folder structure.

    I would suggest you update the SDK via the Toolchain Manager and then load the radio_test sample from the NCS instead of downloading it from the web. 

    -Amanda H.

  • OK, I solved the update issue, now the building of the "radio_test" application seems to work.

    I remind you that I have 2 boards, the nRF52840 board and the BC840E evaluation board.
    I loaded the radio test programme into the nRF52840 board connected via USB to the PC, and using the "flash" in VS Code.
    To this first board the BC840E board is connected via a 10-wire connection (for the power supply the BC840E is not connected via USB to the pc, but to an external battery), and according to what you told me above, by flashing the programme to the nRF52840 connected via 10 wires to the BC840E, the same programme should also be loaded inside this second board.


    Then through the serial terminal I give the commands you wrote me above ("start_channel" 40 and "start_tx_modulated_carrier"), always with both boards connected as I described, but opening the serial terminal I see these writings printed:
    "bfdegeffcgfedd e!e "f#d$f%f&e'e(f)f*f+c,e-f.g/f0d1g2g3f4f5c6f7g8f9g:c;d<e=g>g?c@eAfBfCgDdEfFeGfHfIdJeKfLeMgNdOfPddffeedee d
    f
    f
    ceffgadfgfddedbgfe e!b "e#f$f%f&e'f(f)e*g+d,g-e.f/g0c1f2f3g4f5e6g7g8e9e:a;g<d=e>f?b@eAfBgCgDdEgFeGfHfIcJfKfLeMhNdOfPfehfeedcd e
    f"......

    The boud rate is correct and I have also tried flashing the board via the NRF Programmer, loading the file 'zephyr.hex' (always keeping the same configuration), instead by VS Code, but it produces the same result.

    That seems to be the correct way you described to me to programme the second BC840E board.

  • Leonardo Balocchi said:
    The boud rate is correct

    What the baud rate do you use?

    Could you try to connect with Putty or use another USB cable?

    -Amanda H.

  • The baud rate is 115200 on the serial settings.

    When I connect only the nRF52840 board to the PC and load the zephyr.hex programme (i.e. without the 10 connection wires to the BC840E) the serial terminal seems to work.

    Instead it prints in the serial terminal continuously the same values I showed you above if I program the nRF52840 with the 10 connection wires attached and then the BC840E as well.

    I tried changing USBs and Putty and the same thing happens.
    Are we sure that's the right way to programme the BC840E? I'm pretty sure the problem lies in flashing the programme on nRF52840 when the other board (BC840 E) is also attached via 10 wires, because only in this case does the programme give problems.

Related