NRF52840+Freertos+tickless no advertising lowpower err

I didn't use an external 32.768 crystal, the internal NRF_SDH_CLOCK_LF_SRC 0 I used。

NRF_SDH_CLOCK_LF_SRC 0

NRF_SDH_CLOCK_LF_RC_CTIV 16

NRF_SDH_CLOCK_LF_RC_TEMP_CTIV 2

NRF_SDH_CLOCK_LF_ACCURACY 1

When I don't start broadcasting, there is a 2 ms interval spike in current, as shown in the graph below

When I enable the broadcast its current is normal as shown in the figure below

Parents
  • Hello,

    It looks like there is something not quite going to sleep, but waking up every 2ms until you start advertising/broadcasting.

    Is it possible to upload your application here? zip and upload it, so that I can have a look at your main.c file, and the application settings.

    It would be easiest if I could reproduce the issue myself, and then study what's going on.

    Best regards,

    Edvin

  • Hello Edvin, I am eagerly awaiting your reply. Thank you

  • Hello,

    Sorry for not getting back to you before the weekend. 

    So I tried taking your application, and starting it looked like expected:

    Then I tried commenting out the advertising:

    void SystemInitTask(void * pvParameter)
    {
        scan_init();
    
        // Enable FPU interrupt
        NVIC_SetPriority(FPU_IRQn, APP_IRQ_PRIORITY_LOWEST);
        NVIC_ClearPendingIRQ(FPU_IRQn);
        NVIC_EnableIRQ(FPU_IRQn);
    	
    	gap_params_init();
    	gatt_init();
    	conn_params_init();
    	qwr_init();
    	services_init();
    	advertising_init();
    //	advertising_start();
        vTaskDelete(SystemInitTask_Handler);
    }
    

    And this is what I see:

    So how did you get the behavior as described in your first screenshot? Were you able to reproduce that behavior on an nRF52840 DK?

    Best regards,

    Edvin

  • Thanks for the answer, I seem to have solved this issue, I modified the way buzz is driven.

    #define BEEP_STEPS  270

    uint16_t seq_values[BEEP_STEPS];

    nrf_pwm_sequence_t seq = {
    .values.p_common = seq_values,
    .length = BEEP_STEPS,
    .repeats = 0,
    .end_delay = 0,
    };

    nrf_drv_pwm_simple_playback(&m_pwm0, &seq, 1, NRF_DRV_PWM_FLAG_STOP);

    That's the part of the changes I made.

    But I have a question, the boards we produce, using the same set of firmware, some have normal power consumption, and a few have abnormal power consumption. The phenomenon is a wake-up spike in 2 milliseconds.

Reply
  • Thanks for the answer, I seem to have solved this issue, I modified the way buzz is driven.

    #define BEEP_STEPS  270

    uint16_t seq_values[BEEP_STEPS];

    nrf_pwm_sequence_t seq = {
    .values.p_common = seq_values,
    .length = BEEP_STEPS,
    .repeats = 0,
    .end_delay = 0,
    };

    nrf_drv_pwm_simple_playback(&m_pwm0, &seq, 1, NRF_DRV_PWM_FLAG_STOP);

    That's the part of the changes I made.

    But I have a question, the boards we produce, using the same set of firmware, some have normal power consumption, and a few have abnormal power consumption. The phenomenon is a wake-up spike in 2 milliseconds.

Children
No Data
Related