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

Restart after Uart closed

Hi.

I development nRF52832(SDK15.00.00, S132).

I have modified SDK15->examples->ble_peripheral->ble_app_uart->pca10040->s132

I want to unuse uart, So I using app_uart_close() function.

But restart my module again.

and Not use app_uart_close() function, No restart module.

How can I do for it???

int main(void)
{
    bool erase_bonds;
 
   nrfx_gpiote_uninit();
 lfclk_config();
 nrf_gpio_cfg_output(13);
  nrf_gpio_cfg_output(15);
  uart_init();
  timers_init();
 power_management_init();
   ble_stack_init();   
    gap_params_init();
  services_init();
   
  conn_params_init();
  uint32_t err_code;
////adv address set
  ble_gap_addr_t p_addr;
  p_addr.addr_id_peer = 1;
  p_addr.addr_type = BLE_GAP_ADDR_TYPE_PUBLIC;
  p_addr.addr[0]=0x06;
  p_addr.addr[1]=0x05;
  p_addr.addr[2]=0x04;
  p_addr.addr[3]=0x03;
  p_addr.addr[4]=0x02;
  p_addr.addr[5]=0x01;
  
  err_code=sd_ble_gap_addr_set( &p_addr);
////adv address set

 app_uart_close();
  advertising_init();
  err_code = sd_ble_gap_tx_power_set(BLE_GAP_TX_POWER_ROLE_ADV, m_advertising.adv_handle, -40);
    APP_ERROR_CHECK(err_code);
  advertising_start();
  
         nrf_gpio_pin_set(13);
       nrf_gpio_pin_set(15);
       nrf_delay_ms(500);  //Wait Doorlock Initializing
       nrf_gpio_pin_clear(13);
         nrf_gpio_pin_clear(15); 

    for (;;)
    {
       idle_state_handle();
    }
}
Parents Reply Children
No Data
Related