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

ble_peripheral\ble_app_uart current is big even diabled the uart peripheral.

i use ble_app_uart to send data to centrol, and i don't need the UART peripheral, so diabled uart with it: NRF_UART0->ENABLE = UART_ENABLE_ENABLE_Disabled;

but the problem is the current still is big,  I  set the APP_ADV_INTERVAL = 1000  , the current is about 750uA when in advertisement,  but if i use the same APP_ADV_INTERVAL in example"experimental_ble_app_blinky" , the current could be less than 60uA in advertisement mode, it means "ble_app_uart" example consumed more about 700uA, 

So my question is : which has consume that 700uA current, how to diable it?  

  • Happy to hear that you found the culprit. 

    The GPIOTE peripheral can either use the IN event or the PORT event to trigger an interrupt. The IN event requires the HFCLK to be running, even when you go to sleep. The Port event on the other hand does not require the HFCLK to be running, but the GPIOTE PORT event can only detect one pin at the time. If you have several pins triggering the PORT event, the event will only trigger once. This due to a DETECT signal in the GPIOTE core which is muxed with all the GPIOs configured with wakeup.

    If you only need to detect one external GPIO asserting at the time then you can simply change .hi_accuracy from true to false innrf_drv_gpiote_in_config_t struct passed to the nrf_drv_gpiote_in_init() call that initializes the input pin.

    If you need to detect multiple pins asserting at the same time then I recommend that you use the fw-library app_gpiote. This library allows the user to have multiple wake-up sources, because the library inverts the wakeup polarity on the specific pin.

Related