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

APP_UART_COMMUNICATION_ERROR

Hi,

The device  receives data that sent form the host useing NUS. The device crashes every time. The debug log is like blow.

I shielded the code and the crash problem was solved.

I am worried whether the way of shielding the code is right?

That will cause other problems.Is there a better solution?

Thank you!

 

  • Hello,

    The device crashes every time.

    Could you elaborate on this; How does the device crash? Is this UART communication error the only issue?
    Your debug output suggests that your application might be using an invalid SVC number.
    Could you ensure that all the SVC numbers used by your application lies within the specified range of permitted SVC numbers for the specific SoftDevice you are using?

    I shielded the code and the crash problem was solved.

    I am not sure what you mean by shielding the code, do you mean the part were you commented out the error handling?
    I would not recommend this. Instead, let us find the root cause of your issue.

    Looking forward to solving this issue together,

    Best regards,
    Karl

  • Thanks for this answer.

    I'm also looking forward to the cause of a APP_UART_COMMUNICATION_ERROR, from a project based on ble_nus example. I read on an old thread that I should manage to get the error code from the p_event->data.error_communication showed below, but I'm a little lost for using it. It is indicating a register number, right ? where do I find the possibles values of this register ? Is there an example showing an analysis of an uart error ?

    void uart_event_handle(app_uart_evt_t * p_event)
    {
        //NRF_LOG_INFO("uart_event_handle \r\n");
    
        switch (p_event->evt_type)
        {
            case APP_UART_DATA_READY:
                _process_received_char();
                break;
    
            case APP_UART_COMMUNICATION_ERROR:
                NRF_LOG_INFO("APP_UART_COMMUNICATION_ERROR \r\n");
                
                APP_ERROR_HANDLER(p_event->data.error_communication);
                break;

    All the best,

  • Hello,

    benjamin.forest said:
    Thanks for this answer.

    No problem at all, I am happy to help!

    benjamin.forest said:
    I'm also looking forward to the cause of a APP_UART_COMMUNICATION_ERROR, from a project based on ble_nus example.

    Could you detail your setup a little more; Are you using a development kit, or a custom board? If so, which SoC are you using?
    You also say that the project is based on the ble_uart example, what modifications have you made here?

    Most commonly, the APP_UART_COMMUNICATION_ERROR is caused by the UART receiving invalid data - this can be the result of missing stop-bits(mismatching UART configurations between the two modules) or by leaving the RX pin floating(not connected to anything). Leaving the RX pin floating causes the UART logic to interpret the random noise it experience as UART data, and thereafter triggers the error. Could you tell me what connections you have made for the UART - Which pins are have you used on the nRF SoC, and which pins are they connected to? What is your UART communication configurations?

    benjamin.forest said:
    It is indicating a register number, right ? where do I find the possibles values of this register ?

    You can see the possible error codes in the UART's ERRORSRC register.

    Looking forward to hearing from you,

    Best regards,
    Karl

Related