Distance Measurement Sample Code

When using the distance measurement sample code on my nrf5340 development kits, LEDs 1 and 2 seem to be working correctly, but LED 3 does not light up when connected. The only thing I changed about the sample code was adding this line:

CONFIG_SOC_NRF53_CPUNET_ENABLE=y
to the prj.conf file to get the measurements to output to my serial terminal. Before adding this line, only LED 1 would stay lit consistently with nothing outputting to the terminal. Does anyone know why LED 3 is not lighting at all?
Parents
  • Hi

    I can confirm that I'm able to reproduce this on my end, and after doing some debugging, it makes sense, because the two devices don't actually connect to each other by default. The synchronization and ranging is done without the two ever being connected, which is why LED3 is never being lit. You can see in the connected() function in main.c that LED3 is toggled on if the connected callback is returned, but it never is. As per the block diagram in the sample, this is how the ranging is done by default. 

    If you need the devices to connect, you're welcome to implement that yourself.

    Best regards,

    Simon

Reply
  • Hi

    I can confirm that I'm able to reproduce this on my end, and after doing some debugging, it makes sense, because the two devices don't actually connect to each other by default. The synchronization and ranging is done without the two ever being connected, which is why LED3 is never being lit. You can see in the connected() function in main.c that LED3 is toggled on if the connected callback is returned, but it never is. As per the block diagram in the sample, this is how the ranging is done by default. 

    If you need the devices to connect, you're welcome to implement that yourself.

    Best regards,

    Simon

Children
Related