I am trying to make a central device that is similar to the NUS central example in the SDK. I have a function that is the same as ble_nus_chars_received_uart_print to print data over uart. When the app_uart_put() function is called I get error 0x4 which I think is the no memory error(correct me if I'm wrong). Any ideas on how to fix this or what is causing this issue? I can try to post the project files for the central and peripheral devices if that would help.
static void ble_emg_chars_received_uart_print(uint8_t * p_data, uint16_t data_len)
{
ret_code_t ret_val;
NRF_LOG_DEBUG("Receiving data.");
NRF_LOG_HEXDUMP_DEBUG(p_data, data_len);
for (uint32_t i = 0; i < data_len; i++)
{
do
{
ret_val = app_uart_put(p_data[i]);
if ((ret_val != NRF_SUCCESS) && (ret_val != NRF_ERROR_BUSY))
{
NRF_LOG_ERROR("app_uart_put failed for index 0x%04x.", i);
APP_ERROR_CHECK(ret_val);
}
} while (ret_val == NRF_ERROR_BUSY);
}
if (p_data[data_len-1] == '\r')
{
while (app_uart_put('\n') == NRF_ERROR_BUSY);
}
}