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

send data from msp430

Now i try to send many data from external device. I can send it for 4 times. But after that,the device will be disconnection. I used analog discovery and I was able to confirm that the data is coming. I want to solve the problem,but I don't know what is cause.

thank you in advanced

the picture is shown in below. gyazo.com/ba22bef2273e66ca23d5105f556e0a43 gyazo.com/a4ef65861f6cbba748fdc2225ae0210d

Parents
  • thank you for your reply! ・I am using MSP 430 on UART connection. ・i am using the nRF52832-DK. ・i am using 14.0.0 version. ・i am using iphone 6s

    Regards!!

  • You are sending data back over BLE in the nus_data_handler? The function looks by default like this:

    static void nus_data_handler(ble_nus_evt_t *p_evt)
    {
        if (p_evt->type == BLE_NUS_EVT_RX_DATA)
        {
            uint32_t err_code;
    
            NRF_LOG_DEBUG("Received data from BLE NUS. Writing data on UART.");
            NRF_LOG_HEXDUMP_DEBUG(p_evt->params.rx_data.p_data, p_evt->params.rx_data.length);
    
            for (uint32_t i = 0; i < p_evt->params.rx_data.length; i++)
            {
                do
                {
                    err_code = app_uart_put(p_evt->params.rx_data.p_data[i]);
                    if ((err_code != NRF_SUCCESS) && (err_code != NRF_ERROR_BUSY))
                    {
                        NRF_LOG_ERROR("Failed receiving NUS message. Error 0x%x. ", err_code);
                        APP_ERROR_CHECK(err_code);
                    }
                } while (err_code == NRF_ERROR_BUSY);
            }
            if (p_evt->params.rx_data.p_data[p_evt->params.rx_data.length - 1] == '\r')
            {
                while (app_uart_put('\n') == NRF_ERROR_BUSY);
            }
        }
    }
    

    What are you trying to achieve by changing the nus_data_handler() function ?

Reply
  • You are sending data back over BLE in the nus_data_handler? The function looks by default like this:

    static void nus_data_handler(ble_nus_evt_t *p_evt)
    {
        if (p_evt->type == BLE_NUS_EVT_RX_DATA)
        {
            uint32_t err_code;
    
            NRF_LOG_DEBUG("Received data from BLE NUS. Writing data on UART.");
            NRF_LOG_HEXDUMP_DEBUG(p_evt->params.rx_data.p_data, p_evt->params.rx_data.length);
    
            for (uint32_t i = 0; i < p_evt->params.rx_data.length; i++)
            {
                do
                {
                    err_code = app_uart_put(p_evt->params.rx_data.p_data[i]);
                    if ((err_code != NRF_SUCCESS) && (err_code != NRF_ERROR_BUSY))
                    {
                        NRF_LOG_ERROR("Failed receiving NUS message. Error 0x%x. ", err_code);
                        APP_ERROR_CHECK(err_code);
                    }
                } while (err_code == NRF_ERROR_BUSY);
            }
            if (p_evt->params.rx_data.p_data[p_evt->params.rx_data.length - 1] == '\r')
            {
                while (app_uart_put('\n') == NRF_ERROR_BUSY);
            }
        }
    }
    

    What are you trying to achieve by changing the nus_data_handler() function ?

Children
No Data
Related