I found a function, sys_reboot() that apparently reboots the nRF9160. In order to use this function, what must be configured and what are the correct .h files?
Thanks
I found a function, sys_reboot() that apparently reboots the nRF9160. In order to use this function, what must be configured and what are the correct .h files?
Thanks
You should get what you need by setting CONFIG_REBOOT=y in your prj.conf
The function is declared in include/power/reboot.h
You should get what you need by setting CONFIG_REBOOT=y in your prj.conf
The function is declared in include/power/reboot.h
Does it it to include any other file? The build failed due to error:
implicit declaration of function 'sys_reboot'
Hi again,
I found it is also needed to include this line:
#include <misc/reboot.h>
No, you should only have to add CONFIG_REBOOT=y to prj.conf and:
#include <misc/reboot.h>
in any file that calls sys_reboot(0);
I added the line
#include <power/reboot.h>
What is the difference between power/reboot.h and misc/reboot.h?
Note that after changing proj,conf, in order for changes to to take affect one must:
1. Close the project and exit SEGGER
2. Delete the build directory build_nrf9160_pca10090ns
3. Restart SEGGER
4. Select File --> Open nRF Connect SDK project
and select the project in question
5. Do Build --> Clean
then Build --> Build Solution.
This procedure should not be necessary.
Hi.
misc/reboot.h has been moved to power/reboot.h, and is empty except for a message informing about the move, and including power/reboot. So they are the same, except for misc/reboot.h being deprecated.
After changing prj.conf, it should be enough to select File -> Open nRF Connect SDK Project, select the project in question and check the "Clean Build Directory" checkbox.
While simpler than your procedure, I agree that it is still too complicated.
An alternative approach is to use Project -> Configure nRF Connect SDK Project. One detail to be aware of with this approach is that the changes are stored inside the build directory, so if you were to delete the build directory the changes would be lost.
A third option is to use west on the command line. west will detect changes in prj.conf and re-configure the project automatically.