I have added the include and src. file paths to the MAKEFILE and yet I am experiencing this error.
I tried deleting the main.c.o file too, but am still experiencing this issue.
I have added the include and src. file paths to the MAKEFILE and yet I am experiencing this error.
I tried deleting the main.c.o file too, but am still experiencing this issue.
Also, kindly please let me know the function(s) to put it to sleep and the function calls or the button commands to wake it up from sleep. and where to place it and what are the alternative functions to use in place of the above ones I used in the code
Hello,
RJD said:I actually want my device to go to sleep when there is an inactivity and wake up on an interrupt from a sensor, take 20 readings and then go back to sleep and wake up again on an interrupt. I do not wnat to use soft devices
Ah, my apologies, I made a wrong assumption that you were using the SoftDevice.
When you say "go to sleep", do you mean go to SYSTEM_OFF ( lowest power consumption ) - i.e the device being completely off, and waking only with a reset, or do you mean go to SYSTEM_ON( some subsystems retaining power )?
RJD said:Also, here is the code snippet I am working on in accordance to the power management library:-
Have you seen how the power management module is used in other examples, such as the Proximity example? In the code snippet you shared, you are calling nrf_pwr_mgm_run outside the main loop - it is supposed to be called in a loop, to ensure that you are in the lower power state whenever nothing else is being done. This is why in most applications, the nrf_pwr_mgmt_run function is the only thing happening in the main-while loop - the rest is handled in event handlers and ISR's.
I am not sure that it makes sense for you to call nrf_pwr_mgmt_run as you are doing right now, unless you intend on your application waking up and configuring logging, then going to a low power SYSTEM ON state, before receiving an interrupt of any kind and continuing into the while loop. I am not sure this is what you have inteded.
RJD said:Also, kindly please let me know the function(s) to put it to sleep and the function calls or the button commands to wake it up from sleep.
Please confirm for me whether you intend on the device going to SYSTEM_OFF, when you say "go to sleep". nrf_pwr_mgmt_run places the device in a low power SYSTEM ON state, not in SYSTEM OFF.
If you are in a low power SYSTEM ON state, then the device will be wake from any interrupt. If you are in SYSTEM OFF state, then you will need an external interrupt.
It might be beneficial to read the answers by my colleague Edvin in this ticket.
Best regards,
Karl
Hello Karl,
Thank you for your reply.
Yes , I confirm that I intend on the device going to SYSTEM_OFF ( lowest power consumption ), when I say "go to sleep".
I also called the nrf_pwr_mgmt_run() in the main loop, but now i started getting the error of the image
I tried the solutions in this link- devzone.nordicsemi.com/.../nrf_section_iter-problem-with-sdk-15-and-armgcc
Hello Karl, I have got the solution to the image issue. Please help me with the SYSTEM_OFF problem
Hello,
RJD said:I have got the solution to the image issue.
I am happy to hear that you were able to resolve this issue. I would warn you that your path is very long - possibly nearing window's limit of 244 characters. If you are not exceeding this already, you should be aware of it if you path should grow even longer.
RJD said:Please help me with the SYSTEM_OFF problem
RJD said:
I confirm that I intend on the device going to SYSTEM_OFF ( lowest power consumption ), when I say "go to sleep".
I also called the nrf_pwr_mgmt_run() in the main loop,
Thank you for confirming this. It is good that you are now running nrf_pwm_mgmt_run in the main loop now - this should reduce your power consumption when the device is awake and idle.
In order to go to SYSTEM OFF, you will need to prepare the device, so that it knows what to wake from, such as button-presses or other external interrupts.
A simple version of this could look something like the function shown below:
static void sleep_mode_enter(void)
{
ret_code_t err_code;
//make DK indicate IDLE
err_code = bsp_indication_set(BSP_INDICATE_IDLE);
APP_ERROR_CHECK(err_code);
// Prepare wakeup buttons to trigger wakeup.
err_code = bsp_btn_ble_sleep_mode_prepare();
APP_ERROR_CHECK(err_code);
// Go to system-off mode
// this function will not return. wakeup will cause a reset.
err_code = sd_power_system_off();
APP_ERROR_CHECK(err_code);
}