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

AVR UART regarding RTS/CTS

I am using a nRF51 dongle as a BLE tranciever and using UART to communicate with an 8bit AVR. I used BLE_APP_UART peripheral example and mostly just changed the pins used for commuincation from the USB pins to some GPIO pins, and added the segger RTT. I am using a logic level converter to interface with the AVR which is running at 5 volts.

For reasons the dongle crashes if i send messages too fast, and I am thinking it might got something to do with that I disabled flow control on the dongle, since the AVR don't have it.

I have hooked up a com cable to listen on the UART line to verify that only the nRF is crashing and not the AVR as well. It crashes even if the cable is not connected as well, so it's not causing it.

The error I get when debugging is 3004, from main.c line 426 which is here:

    /**@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') || (index >= (BLE_NUS_MAX_DATA_LEN)))
                {
                    err_code = ble_nus_string_send(&m_nus, data_array, index);
                    if (err_code != NRF_ERROR_INVALID_STATE)
                    {
error trigger->       APP_ERROR_CHECK(err_code);
                    }

I'm not sure how to go about this, I sort of need to get these messages faster than once per second so i'd appreciate some clues on to how to proceed

Related