This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

undefined reference to `nrf_pwr_mgmt_shutdown'

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.

Parents
  • Hello,

    Could you tell me some more about your development setup: Which IDE are you using, are you building with armgcc directly, or perhaps Segger Embedded Studios?
    Could you also verify for me the path you have supplied, and how you have added it to the makefile?
    In the case that you are using Segger Embedded Studios, could you detail for me how you have added the path to your project?

    Looking forward to resolving this issue together,

    Best regards,
    Karl

  • Hello Karl, Thank you for your help.I am currently using  nrf_power_system_off(); to put the nrf52840 dk to sleep.

    Could you please help me with how to wake it up in normal mode? All I am getting are putting to sleep with soft device enabled or with low power mode. I am not using any of them. I am simply calling the functions and want to wake up the device using an interrupt(using if statement to read the gpio).  

  • Hello,

    RJD said:
    Thank you for your help.

    No problem at all, I am happy to help!

    RJD said:
    I am currently using  nrf_power_system_off(); to put the nrf52840 dk to sleep.

    I would not recommend this. Please have a look at the nrf_power_system_off documentation.

    RJD said:
    Could you please help me with how to wake it up in normal mode? All I am getting are putting to sleep with soft device enabled or with low power mode. I am not using any of them. I am simply calling the functions and want to wake up the device using an interrupt(using if statement to read the gpio).  

    What is your desired behavior here, I am not sure I understand. You would like the the device to be in SYSTEM OFF mode, and wake on a GPIO level change?
    Be advised that the CPU is not running in SYSTEM OFF, so no code will be executed - i.e you may not check anything with an if statement.

    I would recommend that you use the power management module instead of the power HAL.
    You may see how this module is used in most of the SDK examples, for instance the BLE beacon example. They demonstrate how easy the power management module is to work with. When the device goes into low power mode here ( nrf_pwr_mgmt_run ) the device will be sleeping, but wake on interrupts.

    Please do not hesitate to let me know if anything should be unclear, or if you encounter any issues or questions.

    Best regards,
    Karl

  • Hello Karl, Hope you are doing good.

    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 

Reply Children
  • Also, here is the code snippet I am working on in accordance to the power management library:- 

     main(){
     bsp_board_init(BSP_INIT_LEDS);
    bsp_board_init(BSP_INIT_BUTTONS);
    
        APP_ERROR_CHECK(NRF_LOG_INIT(NULL));
        NRF_LOG_DEFAULT_BACKENDS_INIT();
        
         nrf_pwr_mgmt_run();
         while (1)
        {
           
           NRF_LOG_INFO("MCU WAKE UP");
           NRF_LOG_FLUSH();
    
            for(int i=0;i<2;i++){
                bsp_board_led_on(1);
            
                nrf_delay_ms(500);
    
                bsp_board_led_off(1);
                nrf_delay_ms(1000);
            //bsp_board_led_on(0);
    
                NRF_LOG_INFO("THIS SHOULD BE DISPLAYED");
                NRF_LOG_FLUSH();
            }
       
            bsp_wakeup_button_enable(1);
        nrf_pwr_mgmt_shutdown(NRF_PWR_MGMT_SHUTDOWN_GOTO_SYSOFF);
    //sd_power_system_off();
        NRF_LOG_INFO("SHOULD NOT BE DISPLAYED");
        NRF_LOG_FLUSH();
    if(bsp_button_is_pressed(1)){
     NVIC_SystemReset();   
    }
        
    }    
        
        

  • 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

Related