Wireless timer synchronization nRF5340 (build error).

Hello

I want to make an application that will be sending data from 3 peripheral BLE devices to the central device which wil be connected to PC and transmitting data (from all 3 peripheral devices) to it.
Sensor data will be received and sent 100 times per second from each device to the central device. Data from sensors must be collected and sent at the same time to prevent the receiver (central device) to receiving data from different moments in time. The measurement should last even 3 hours and clocks of peripheral devices cannot differ so much that the data received by the central device will be shifted relative to each other in time by more than 1 ms during the entire measurement.

I saw this time synchronization project:
Wireless timer synchronization among nRF5 devices
https://github.com/nordic-auko/nRF5-ble-timesync-demo

but I have problem with building it on nRF5340.
I am using NRF Connect SDK 2.5.0 and toolchain 2.5.0


This my build configuration:


this is what I have on my terminal:


I don't know why this error occurred. I just try to build code from github without any modyfication.
Can you help me resolve this problem?

I also have a question whether this is the only example of wireless clock synchronization or are there others (which might be better suited for my application) ?


Best Regards

Parents Reply Children
  • Hi,

    Here is log file for nRF5340 build





    No, build wasn't successful on nRF52840
    log with error:




    Best Regards

  • Hi,

    I have tested the sample again on nrf52840-dk and building was successful. To further test, clone the repository close to your root folder, open terminal window from NCS v2.5.0 Toolchain Manager and run "west build -b nrf52840dk_nrf52840 -d build" command from your terminal.

    On nrf5340-dk, you could try to build the sample for the network core. The network core conf file enables empty application core image.

    Best regards,
    Dejan

  • Hi,

    Thanks a lot, now it is working on nRF5340 network core.

    Regarding to nRF52840 I found out why building was unsuccessful. I don't know why, but in my SDK v2.5.0 there was no tinycrypt library, so I copied it from another SDK folder (I had this library in SDK 2.4.3 and 2.6.1 folders, but not in 2.5.0 folder) and now it is building.

    I also have 2 more questions.
    1. Why this sample isn't building when I choose nRF5340 cpuapp ?
    2. How to convert this sample for SDK v2.6.1 or v2.7.0 ?

    Best Regards

  • Hi,

    ..... said:
    1. Why this sample isn't building when I choose nRF5340 cpuapp ?

    This sample has the requirement to be built for the network core.

    ..... said:
    2. How to convert this sample for SDK v2.6.1 or v2.7.0 ?

    The timesync sample has been made as out-of-tree application with its own west manifest. You could try to update west.yml file for the application with appropriate NCS version you want to use. You can look at nrf west.yml for needed versions. Then you should use "west init -l timesync_sample" and "west update". Check that ZEPHYR_BASE points to your local Zephyr directory. There is an old guide which provides relevant information. Afterwards, try to build and flash the sample and look for possible clues in the error log (if you get an error). 

    Best regards,
    Dejan

  • I'm trying to do the same thing, get the above Github repo: github.com/.../nRF5-ble-timesync-demo to work on the nrf5340-dk. I have updated the overlay files and copied over the necessary libraries but cannot get the sample functional on the nrf5340-dk. I receive the following compile time overflow error of ~25k when building for the nrf5340-dk's network core:

    ---



    ---

    I have gotten around this by modifying the file: "ncs/zephyr/dts/arm/nordic/nrf5340_cpunet_qkaa.dtsi" to have a flash1 reg of 512k instead of 256k. This works to get around the compile time over flow error but when I attempt to flash the build I get a new error:

    ^ showing the build succeeding 


    ^ showing "flash-time" error

    This "flash-time" error leads me to believe I'm incorrectly increasing the 5340's network core flash size.

    ---

    I have also tried to use the "CONFIG_SIZE_OPTIMIZATION=y" config option, which does reduce the image size but still not enough to flash to the default partition size. I do however get a small enough size by turning off logging but the sample does not work as expected and I think its due to the warnings from the above build output regarding the Timers and their configs.

    I really appreciate this forum post and I look forward to a response indicating how I can get this sample functional on my nRF5340-dk. I think the most appropriate way to do this is by increasing the network core flash partition size to allow for logging at the same time as the sample is running to help debug the sample on my 5340.

    While I wait for a reply I will try toggling the synch pin manually and add gpio-callbacks to the forwarded buttons to ensure they're functioning as expected. This will show for sure that the problem lies with the Timers as the cmake warnings indicate. Again, Thank you for your time and help.

    Please show me that you achieve the correct functionality when using an nRF5340-dk by showing a screenshot of your osciliscope and the skew between two or more devices with the sample running. It is not clear from this forum post that  was able to achieve the correct functionality on the 5340-dk network core.


    ---

    Here are images of the sample working great on my nrf5240s with logging enabled:





    Respectfully,
    Brady

Related