llpm sample project not working correctly?

Hello,

I think llpm's sample project is wrong. Evaluation board is not supposed to be communicating.

To verify the defect, the value of the time variable is fixed. This time variable should be sent via the gatt latency service.

	/* Start sending the timestamp to its peer */
	while (default_conn) {
		uint32_t time = 1000000;

		err = bt_latency_request(&latency_client, &time, sizeof(time));
		if (err && err != -EALREADY) {
			printk("Latency failed (err %d)\n", err);
		}

		k_sleep(K_MSEC(200)); /* wait for latency response */

In addition, it also removes the formula in the callback. This is not always necessary, but it makes it easier to understand.

static void latency_response_handler(const void *buf, uint16_t len)
{
	uint32_t latency_time;

	if (len == sizeof(latency_time)) {
		/* compute how long the time spent */
		latency_time = *((uint32_t *)buf);
		uint32_t cycles_spent = latency_time;
		llpm_latency.latency =
			(uint32_t)k_cyc_to_ns_floor64(cycles_spent) / 2000;
	}
}

Build and run. Note that the other evaluation board will write an unmodified sample project.

Transmission Latency: 226403 (us), CRC mismatches: 0
Transmission Latency: 226403 (us), CRC mismatches: 0
Transmission Latency: 226403 (us), CRC mismatches: 0
Transmission Latency: 226403 (us), CRC mismatches: 0
Transmission Latency: 226403 (us), CRC mismatches: 0
Transmission Latency: 226403 (us), CRC mismatches: 0
Transmission Latency: 226403 (us), CRC mismatches: 0
Transmission Latency: 226403 (us), CRC mismatches: 0
Transmission Latency: 226403 (us), CRC mismatches: 0
Transmission Latency: 226403 (us), CRC mismatches: 0
Transmission Latency: 226403 (us), CRC mismatches: 0
Transmission Latency: 226403 (us), CRC mismatches: 0
Transmission Latency: 226403 (us), CRC mismatches: 0
Transmission Latency: 226403 (us), CRC mismatches: 0
Transmission Latency: 226403 (us), CRC mismatches: 0
Connection interval updated: LLPM (1 ms)
Transmission Latency: 226403 (us), CRC mismatches: 0
Transmission Latency: 226403 (us), CRC mismatches: 0
Transmission Latency: 226403 (us), CRC mismatches: 0
Transmission Latency: 226403 (us), CRC mismatches: 0
Transmission Latency: 226403 (us), CRC mismatches: 0
Transmission Latency: 226403 (us), CRC mismatches: 0

Then the firmware that has not been modified will show the fixed values. I believe this should appear on the other side's evaluation board, am I wrong?
So this evaluation board is not communicating, correct?
If my understanding is incorrect, please correct.

Best Regards,
Yoshihiro Goto

Parents
  • Yoshihiro-san,

    I have not tried to test this on many different nrf52840DKs using nrf connect sdk 2.9.0 with the llpm sample and I get a sensible values at the terminal.

    What is it different between your and my setup?

  • Hello Susheel,

    The numbers displayed in the log are strange because I rewrote the source code, not a bug. And my apologize, I misunderstood the purpose of this sample project. Also I understood that the purpose of this sample project was to measure response times, not to send data.

    I was able to verify that the data is being sent with debug logging enabled. I also understood that it was not displaying the received data (nor setting up callbacks) because this is a project to measure response time.

    So if I want to use received data based on this sample project, I will set up a callback for received_latency_request(), right?

    Best Regards,
    Yoshihiro Goto

Reply
  • Hello Susheel,

    The numbers displayed in the log are strange because I rewrote the source code, not a bug. And my apologize, I misunderstood the purpose of this sample project. Also I understood that the purpose of this sample project was to measure response times, not to send data.

    I was able to verify that the data is being sent with debug logging enabled. I also understood that it was not displaying the received data (nor setting up callbacks) because this is a project to measure response time.

    So if I want to use received data based on this sample project, I will set up a callback for received_latency_request(), right?

    Best Regards,
    Yoshihiro Goto

Children
Related