Now I am using nrf9160DK for development. In my project, I need to use a random number generator and a highly accurate system time stamp. Is there an API that I can call directly? If so, can you tell me the API name, calling method, and header files that need to be used. For the random number generator, I have tried to call the function sys_rand32_get (), but I get the following error during the build. Is it because the header file I added is incorrect?
In function `main ':
/opt/sourcecode/ncs/nrf/samples/nrf9160/helloworld/build/../src/main.c:8: undefined reference to `sys_rand32_get '
collect2: error: ld returned 1 exit status
for timestamp purposes you can use the system clock or k_timer functionality in the Zephyr kernel API. Here's a link to the documentation.
For random number generator the sys_rand32_get() is the correct function to use. You need to remember to set the option