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

ble hangs when UART initialized

I have reformatted the code I had added earlier.

Following is the sequence of code

uart_debug_init();

gap_params_init();
services_init();
advertising_init();
conn_params_init();

Following is UART initialization code

uart_debug_init()
{
  const app_uart_comm_params_t comm_params =
  {
      7, 8,
      NULL,
      NULL,
      APP_UART_FLOW_CONTROL_DISABLED,
      false,
      UART_BAUDRATE_BAUDRATE_Baud38400
  };

  APP_UART_FIFO_INIT(&comm_params,
                     UART_RX_BUF_SIZE,
                     UART_TX_BUF_SIZE,
                     uart_error_handle,
                     APP_IRQ_PRIORITY_LOW,
                     err_code);

   APP_ERROR_CHECK(err_code);
}

I am using 'ble_app_uart' example and created my own SOCs, which are working fine if I remove UART initialization.

Has anyone experienced this kind of issue. I am not getting any error, the application just hangs. Thanks in advance.

Parents
  • I have checked the error code. It is 0x00 i.e. NRF_SUCCESS.

    in my service initialization code, code hangs at memset

    uint32_t err_code;
    ble_uuid_t service_uuid;
    ble_uuid128_t base_uuid = RP_BASE_UUID;
    
    service_uuid.uuid = BLE_UUID_RP_DEVICE_INFO_SERVICE;
    err_code = sd_ble_uuid_vs_add(&base_uuid, &service_uuid.type);
    APP_ERROR_CHECK(err_code);
    
    // Initialize service structure
    memset(&ble_device_info_service_ins, 0, sizeof(ble_device_info_service_ins));
    ble_device_info_service_ins.conn_handle = BLE_CONN_HANDLE_INVALID;
    

    Let me know if you have any insights.

Reply
  • I have checked the error code. It is 0x00 i.e. NRF_SUCCESS.

    in my service initialization code, code hangs at memset

    uint32_t err_code;
    ble_uuid_t service_uuid;
    ble_uuid128_t base_uuid = RP_BASE_UUID;
    
    service_uuid.uuid = BLE_UUID_RP_DEVICE_INFO_SERVICE;
    err_code = sd_ble_uuid_vs_add(&base_uuid, &service_uuid.type);
    APP_ERROR_CHECK(err_code);
    
    // Initialize service structure
    memset(&ble_device_info_service_ins, 0, sizeof(ble_device_info_service_ins));
    ble_device_info_service_ins.conn_handle = BLE_CONN_HANDLE_INVALID;
    

    Let me know if you have any insights.

Children
No Data
Related