Hello Everyone,
I am trying to bring-up the UART Application in NRF52833 Device.
I have downloaded "nRF5_SDK_17.0.2_d674dde" file.
Getting below error, while compiling,
error: unknown type name 'nrf_uarte_baudrate_t'
error: unknown type name 'nrf_uarte_error_mask_t'
error: unknown type name 'nrf_uarte_hwfc_t'
error: unknown type name 'nrf_uarte_parity_t'
unknown type name 'nrf_uarte_task_t'
error: unknown type name 'nrf_uarte_event_t'
error: 'NRF_UARTE_PSEL_DISCONNECTED' undeclared (first use in this function); did you mean 'NRF_UART_PSEL_DISCONNECTED'?
error: unknown type name 'nrf_uarte_baudrate_t'
error: unknown type name 'nrf_uarte_error_mask_t'
error: unknown type name 'nrf_uarte_hwfc_t'
error: unknown type name 'nrf_uarte_parity_t'
error: unknown type name 'nrf_uarte_task_t'
error: unknown type name 'nrf_uarte_event_t'
error: 'NRF_UARTE_HWFC_DISABLED' undeclared (first use in this function); did you mean 'NRF_UART_HWFC_DISABLED'?
error: 'NRF_UARTE_HWFC_ENABLED' undeclared (first use in this function); did you mean 'NRF_UART_HWFC_ENABLED'?
error: 'NRF_UARTE_PARITY_INCLUDED' undeclared (first use in this function); did you mean 'NRF_UART_PARITY_INCLUDED'?
error: 'NRF_UARTE_PARITY_EXCLUDED' undeclared (first use in this function); did you mean 'NRF_UART_PARITY_EXCLUDED'?
error: 'NRF_UARTE_PSEL_DISCONNECTED' undeclared (first use in this function); did you mean 'NRF_UART_PSEL_DISCONNECTED'?
error: 'NRF_UARTE_HWFC_DISABLED' undeclared (first use in this function); did you mean 'NRF_UART_HWFC_DISABLED'?
error: 'NRF_UARTE_HWFC_ENABLED' undeclared (first use in this function); did you mean 'NRF_UART_HWFC_ENABLED'?
error: 'NRF_UARTE_PARITY_INCLUDED' undeclared (first use in this function); did you mean 'NRF_UART_PARITY_INCLUDED'?
error: 'NRF_UARTE_PARITY_EXCLUDED' undeclared (first use in this function); did you mean 'NRF_UART_PARITY_EXCLUDED'?
Below is my Uart.c sample Application,
#include "nordic_common.h"
#include "nrf.h"
#include "ble_hci.h"
#include "ble_advdata.h"
#include "ble_conn_params.h"
#include "nrf_sdh.h"
#include "nrf_sdh_soc.h"
#include "nrf_sdh_ble.h"
#include "nrf_ble_gatt.h"
#include "nrf_ble_qwr.h"
#include "app_timer.h"
#include "ble_nus.h"
#include "app_uart.h"
#include "app_util_platform.h"
#include "bsp_btn_ble.h"
#include "nrf_pwr_mgmt.h"
#include "mesh_app_utils.h"
#if defined (UART_PRESENT)
#include "nrf_uart.h"
#endif
#if defined (UARTE_PRESENT)
#include "nrf_uarte.h"
#endif
#include "nrf_log.h"
#include "nrf_log_ctrl.h"
#include "nrf_log_default_backends.h"
#include "bsp.h"
#include "solus_uart.h"
#define APP_BLE_CONN_CFG_TAG 1 /**< A tag identifying the SoftDevice BLE configuration. */
#define DEVICE_NAME "Nordic_UART" /**< Name of device. Will be included in the advertising data. */
#define NUS_SERVICE_UUID_TYPE BLE_UUID_TYPE_VENDOR_BEGIN /**< UUID type for the Nordic UART Service (vendor specific). */
#define APP_BLE_OBSERVER_PRIO 3 /**< Application's BLE observer priority. You shouldn't need to modify this value. */
#define APP_ADV_INTERVAL 800 /**< The advertising interval (in units of 0.625 ms. This value corresponds to 500 ms). */
#define APP_ADV_DURATION BLE_GAP_ADV_TIMEOUT_GENERAL_UNLIMITED /**< Disable advertising timeout. */
#define MIN_CONN_INTERVAL MSEC_TO_UNITS(150, UNIT_1_25_MS) /**< Minimum acceptable connection interval. */
#define MAX_CONN_INTERVAL MSEC_TO_UNITS(250, UNIT_1_25_MS) /**< Maximum acceptable connection interval. */
#define SLAVE_LATENCY 0 /**< Slave latency. */
#define CONN_SUP_TIMEOUT MSEC_TO_UNITS(4000, UNIT_10_MS) /**< Connection supervisory timeout (4 seconds), Supervision Timeout uses 10 ms units. */
#define FIRST_CONN_PARAMS_UPDATE_DELAY APP_TIMER_TICKS(5000) /**< Time from initiating event (connect or start of notification) to first time sd_ble_gap_conn_param_update is called (5 seconds). */
#define NEXT_CONN_PARAMS_UPDATE_DELAY APP_TIMER_TICKS(30000) /**< Time between each call to sd_ble_gap_conn_param_update after the first call (30 seconds). */
#define MAX_CONN_PARAMS_UPDATE_COUNT 3 /**< Number of attempts before giving up the connection parameter negotiation. */
#define DEAD_BEEF 0xDEADBEEF /**< Value used as error code on stack dump, can be used to identify stack location on stack unwind. */
#define UART_TX_BUF_SIZE 256 /**< UART TX buffer size. */
#define UART_RX_BUF_SIZE 256 /**< UART RX buffer size. */
BLE_NUS_DEF(m_nus, NRF_SDH_BLE_TOTAL_LINK_COUNT); /**< BLE NUS service instance. */
static uint16_t m_conn_handle = BLE_CONN_HANDLE_INVALID; /**< Handle of the current connection. */
static uint16_t m_ble_nus_max_data_len = BLE_GATT_ATT_MTU_DEFAULT - 3; /**< Maximum length of data (in bytes) that can be transmitted to the peer by the Nordic UART service module. */
static ble_uuid_t m_adv_uuids[] = /**< Universally unique service identifier. */
{
{BLE_UUID_NUS_SERVICE, NUS_SERVICE_UUID_TYPE}
};
/**@brief Function for handling app_uart events.
*
* @details This function will receive a single character from the app_uart module and append it to
* a string. The string will be be sent over BLE when the last character received was a
* 'new line' '\n' (hex 0x0A) or if the string has reached the maximum data length.
*/
/**@snippet [Handling the data received over UART] */
void uart_event_handle(app_uart_evt_t * p_event)
{
static uint8_t data_array[BLE_NUS_MAX_DATA_LEN];
static uint8_t index = 0;
uint32_t err_code;
switch (p_event->evt_type)
{
case APP_UART_DATA_READY:
UNUSED_VARIABLE(app_uart_get(&data_array[index]));
index++;
if ((data_array[index - 1] == '\n') ||
(data_array[index - 1] == '\r') ||
(index >= m_ble_nus_max_data_len))
{
if (index > 1)
{
NRF_LOG_DEBUG("Ready to send data over BLE NUS");
NRF_LOG_HEXDUMP_DEBUG(data_array, index);
do
{
uint16_t length = (uint16_t)index;
err_code = ble_nus_data_send(&m_nus, data_array, &length, m_conn_handle);
if ((err_code != NRF_ERROR_INVALID_STATE) &&
(err_code != NRF_ERROR_RESOURCES) &&
(err_code != NRF_ERROR_NOT_FOUND) )
{
APP_ERROR_CHECK(err_code);
}
} while (err_code == NRF_ERROR_RESOURCES);
}
index = 0;
}
break;
case APP_UART_COMMUNICATION_ERROR:
APP_ERROR_HANDLER(p_event->data.error_communication);
break;
case APP_UART_FIFO_ERROR:
APP_ERROR_HANDLER(p_event->data.error_code);
break;
default:
break;
}
}
/**@snippet [Handling the data received over UART] */
/**@brief Function for initializing the UART module.
*/
/**@snippet [UART Initialization] */
int solus_uart_init(void)
{
uint32_t err_code;
app_uart_comm_params_t const comm_params =
{
.rx_pin_no = RX_PIN_NUMBER,
.tx_pin_no = TX_PIN_NUMBER,
.rts_pin_no = RTS_PIN_NUMBER,
.cts_pin_no = CTS_PIN_NUMBER,
.flow_control = APP_UART_FLOW_CONTROL_DISABLED,
.use_parity = false,
#if defined (UART_PRESENT)
.baud_rate = NRF_UART_BAUDRATE_115200
#else
.baud_rate = NRF_UARTE_BAUDRATE_115200
#endif
};
APP_UART_FIFO_INIT(&comm_params,
UART_RX_BUF_SIZE,
UART_TX_BUF_SIZE,
uart_event_handle,
APP_IRQ_PRIORITY_LOWEST,
err_code);
APP_ERROR_CHECK(err_code);
}
/**@snippet [UART Initialization] */
Can you please look into it and let me know what is causing this issue.
Thanks & Regards,
Haji